Changeset 7288
- Timestamp:
- 02/03/11 06:26:36 (14 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r7178 r7288 359 359 ./modules/GroundingLineMigrationx/CreateElementTouchingIceShelf.cpp\ 360 360 ./modules/GroundingLineMigrationx/CreateElementOnGroundingLine.cpp\ 361 ./modules/GroundingLineMigrationx/UpdateShelfStatus.cpp\ 361 362 ./modules/ModelProcessorx/ModelProcessorx.h\ 362 363 ./modules/ModelProcessorx/ModelProcessorx.cpp\ … … 937 938 ./modules/GroundingLineMigrationx/CreateElementTouchingIceShelf.cpp\ 938 939 ./modules/GroundingLineMigrationx/CreateElementOnGroundingLine.cpp\ 940 ./modules/GroundingLineMigrationx/UpdateShelfStatus.cpp\ 939 941 ./modules/ModelProcessorx/ModelProcessorx.h\ 940 942 ./modules/ModelProcessorx/ModelProcessorx.cpp\ -
issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationx.cpp
r7287 r7288 14 14 int i,j; 15 15 Element* element=NULL; 16 double* element_touching_iceshelf=NULL; 16 double* element_touching_iceshelf=NULL; 17 int nflipped; 17 18 18 19 _printf_(VerboseModule()," Migrating grounding line\n"); … … 20 21 /*Loop until no more nodes and elements change from grounded to floating: */ 21 22 nflipped=1; //arbitrary, get things started 23 22 24 while(nflipped){ 23 25 -
issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h
r7287 r7288 7 7 8 8 class Elements; 9 class Nodes; 10 class Parameters; 9 11 10 12 /* local prototypes: */ … … 12 14 bool* CreateElementOnGroundingLine(Elements* elements,double* element_on_iceshelf); 13 15 double* CreateElementTouchingIceShelf(Elements* elements); 14 int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters);15 16 int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf); 16 17 -
issm/trunk/src/c/modules/GroundingLineMigrationx/UpdateShelfStatus.cpp
r7287 r7288 1 1 /*!\file UpdateShelfStatus 2 * \brief: update elements and nodes shelf status. Plus return how many nodes have changed status. */2 * \brief: update elements and nodes shelf status. Plus return how many nodes have changed status. 3 3 */ 4 4 … … 16 16 int numnods; 17 17 Vec vec_new_shelf_nodes=NULL; 18 double* new_shelf_nodes=NULL; 18 19 19 20 /*output: */ 21 int local_nflipped=0; 20 22 int nflipped=0; 21 23 … … 31 33 for(i=0;i<elements->Size();i++){ 32 34 element=(Element*)elements->GetObjectByOffset(i); 33 nflipped+=element->UpdateShelfStatus(vec_new_shelf_nodes); 35 if(element_touching_iceshelf[element->Sid()]){ 36 local_nflipped+=element->UpdateShelfStatus(vec_new_shelf_nodes); 37 } 34 38 } 39 MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD); 35 40 36 41 /*Serialize vec_new_shelf_nodes: */ -
issm/trunk/src/c/objects/Elements/Element.h
r7089 r7288 84 84 virtual double TimeAdapt()=0; 85 85 virtual void MigrateGroundingLine()=0; 86 virtual void UpdateShelfStatus()=0; 86 virtual int UpdateShelfStatus(Vec new_shelf_nodes)=0; 87 virtual void UpdateShelfFlags(double* new_shelf_nodes)=0; 87 88 88 89 /*Implementation: */ -
issm/trunk/src/c/objects/Elements/Penta.cpp
r7220 r7288 5040 5040 /*Check solution*/ 5041 5041 if(isnan(values[i])) _error_("NaN found in solution vector"); 5042 if(values[i]<0) printf("temperature < 0°K found in solution vector\n");5043 if(values[i]>275) printf("temperature > 275°K found in solution vector (Paterson's rheology associated is negative)\n");5042 //if(values[i]<0) printf("temperature < 0°K found in solution vector\n"); 5043 //if(values[i]>275) printf("temperature > 275°K found in solution vector (Paterson's rheology associated is negative)\n"); 5044 5044 } 5045 5045 … … 6131 6131 /*}}}*/ 6132 6132 /*FUNCTION Penta::UpdateShelfStatus{{{1*/ 6133 void Penta::UpdateShelfStatus(void){6133 int Penta::UpdateShelfStatus(Vec new_shelf_nodes){ 6134 6134 _error_("Not implemented yet"); 6135 6135 } 6136 6136 /*}}}*/ 6137 /*FUNCTION Penta::UpdateShelfFlags{{{1*/ 6138 void Penta::UpdateShelfFlags(double* new_shelf_nodes){ 6139 _error_("Not implemented yet"); 6140 } 6141 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Penta.h
r7089 r7288 125 125 double SurfaceArea(void); 126 126 void Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type); 127 void UpdateShelfStatus(void); 127 int UpdateShelfStatus(Vec new_shelf_nodes); 128 void UpdateShelfFlags(double* new_shelf_nodes); 128 129 double TimeAdapt(); 129 130 int* GetHorizontalNeighboorSids(void); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r7242 r7288 53 53 /*Build horizontalneighborsids list: */ 54 54 _assert_(iomodel->elementconnectivity); 55 for (i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1;55 //for (i=0;i<3;i++) this->horizontalneighborsids[i]=(int)iomodel->elementconnectivity[3*index+i]-1; 56 56 57 57 /*intialize inputs and results: */ … … 4437 4437 b[i]=ba[i]; 4438 4438 s[i]=b[i]+h[i]; 4439 //printf("Node id %i is starting to ground\n",nodes[i]->Id()); 4439 4440 } 4440 4441 else{ … … 4450 4451 s[i]=(1-density)*h[i]; 4451 4452 b[i]=-density*h[i]; 4453 //printf("Node id %i is starting to float\n",nodes[i]->Id()); 4452 4454 } 4453 4455 else{ … … 5327 5329 /*}}}*/ 5328 5330 /*FUNCTION Tria::UpdateShelfStatus{{{1*/ 5329 void Tria::UpdateShelfStatus(void){5331 int Tria::UpdateShelfStatus(Vec new_shelf_nodes){ 5330 5332 5331 5333 int i; … … 5341 5343 double density; 5342 5344 bool elementonshelf = false; 5345 int flipped=0; 5346 bool shelfstatus[3]; 5343 5347 5344 5348 … … 5358 5362 density=rho_ice/rho_water; 5359 5363 5364 /*Initialize current status of nodes: */ 5365 for(i=0;i<3;i++){ 5366 shelfstatus[i]=nodes[i]->inputs->GetInput(NodeOnIceShelfEnum); 5367 } 5368 5360 5369 /*go through vertices, and figure out if they are grounded or not, then update their status: */ 5370 flipped=0; 5361 5371 for(i=0;i<3;i++){ 5362 5372 if(b[i]<=ba[i]){ 5363 5373 nodes[i]->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,false)); 5364 5374 nodes[i]->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,true)); 5375 if(shelfstatus[i])flipped++; 5376 //printf("node %i flipping to sheet\n",nodes[i]->Sid()); 5377 VecSetValue(new_shelf_nodes,nodes[i]->Sid(),0,INSERT_VALUES); 5365 5378 } 5366 5379 else{ 5367 5380 nodes[i]->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,true)); 5368 5381 nodes[i]->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,false)); 5382 if(!shelfstatus[i])flipped++; 5383 //printf("node %i flipping to shelf\n",nodes[i]->Sid()); 5384 VecSetValue(new_shelf_nodes,nodes[i]->Sid(),1,INSERT_VALUES); 5369 5385 } 5370 5386 } 5371 5387 5372 5388 /*Now, update shelf status of element. An element can only be on shelf if all its nodes are on shelf: */ 5373 elementonshelf= true;5389 elementonshelf=false; 5374 5390 for(i=0;i<3;i++){ 5375 if(nodes[i]->IsOnShe et()){5376 elementonshelf= false;5391 if(nodes[i]->IsOnShelf()){ 5392 elementonshelf=true; 5377 5393 break; 5378 5394 } 5379 5395 } 5380 5396 this->inputs->AddInput(new BoolInput(ElementOnIceShelfEnum,elementonshelf)); 5381 } 5382 /*}}}*/ 5397 5398 return flipped; 5399 } 5400 /*}}}*/ 5401 /*FUNCTION Tria::UpdateShelfFlags{{{1*/ 5402 void Tria::UpdateShelfFlags(double* new_shelf_nodes){ 5403 5404 /*go through vertices, and update the status of NodeOnIceShelfEnum and NodeOnIceSheetEnum flags: */ 5405 bool flag; 5406 int i; 5407 5408 for(i=0;i<3;i++){ 5409 flag=(bool)new_shelf_nodes[nodes[i]->Sid()]; 5410 nodes[i]->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,flag)); 5411 nodes[i]->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,!flag)); 5412 } 5413 } 5414 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Tria.h
r7089 r7288 129 129 double SurfaceArea(void); 130 130 void Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type); 131 void UpdateShelfStatus(void); 131 int UpdateShelfStatus(Vec new_shelf_nodes); 132 void UpdateShelfFlags(double* new_shelf_nodes); 132 133 double TimeAdapt(); 133 134 int* GetHorizontalNeighboorSids(void); -
issm/trunk/src/c/solutions/control_core.cpp
r6412 r7288 108 108 109 109 /*Temporary saving every 5 control steps: */ 110 if (((n+1)%5)==0){110 /*if (((n+1)%5)==0){ 111 111 _printf_(VerboseControl(),"%s\n"," saving temporary results"); 112 112 controlrestart(femmodel,J); 113 } 113 }*/ 114 114 } 115 115 -
issm/trunk/src/c/solutions/transient2d_core.cpp
r7109 r7288 53 53 step+=1; 54 54 55 _printf_(VerboseSolution(),"%s%g%s%i%s%g%s%g\n","time [yr]: ",time/yts," iteration number: ",step,"/",floor( finaltime/dt)," dt [yr]: ",dt/yts);55 _printf_(VerboseSolution(),"%s%g%s%i%s%g%s%g\n","time [yr]: ",time/yts," iteration number: ",step,"/",floor((finaltime-time)/dt)," dt [yr]: ",dt/yts); 56 56 57 57 _printf_(VerboseSolution(),"%s\n"," computing new velocity"); -
issm/trunk/src/c/solutions/transient3d_core.cpp
r7109 r7288 51 51 time+=dt; 52 52 53 _printf_(VerboseSolution(),"%s%g%s%i%s%g%s%g\n","time [yr]: ",time/yts," iteration number: ",step,"/",floor( finaltime/dt)," dt [yr]: ",dt/yts);53 _printf_(VerboseSolution(),"%s%g%s%i%s%g%s%g\n","time [yr]: ",time/yts," iteration number: ",step,"/",floor((finaltime-time)/dt)," dt [yr]: ",dt/yts); 54 54 55 55 _printf_(VerboseSolution()," computing temperatures:\n");
Note:
See TracChangeset
for help on using the changeset viewer.