Changeset 7287
- Timestamp:
- 02/02/11 18:45:18 (14 years ago)
- Location:
- issm/trunk/src/c/modules/GroundingLineMigrationx
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/GroundingLineMigrationx/CreateElementOnIceShelf.cpp
r7078 r7287 22 22 for(i=0;i<elements->Size();i++){ 23 23 element=(Element*)elements->GetObjectByOffset(i); 24 printf("%i\n",i); 24 25 VecSetValue(vec_element_on_iceshelf,element->Sid(),(int)element->IsOnShelf(),INSERT_VALUES); 25 26 } -
issm/trunk/src/c/modules/GroundingLineMigrationx/CreateElementTouchingIceShelf.cpp
r7078 r7287 22 22 for(i=0;i<elements->Size();i++){ 23 23 element=(Element*)elements->GetObjectByOffset(i); 24 VecSetValue(vec_element_touching_iceshelf,element->Sid(), (int)element->IsNodeOnShelf(),INSERT_VALUES);24 VecSetValue(vec_element_touching_iceshelf,element->Sid(),element->IsNodeOnShelf()?1.0:0.0,INSERT_VALUES); 25 25 } 26 26 -
issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationx.cpp
r7078 r7287 18 18 _printf_(VerboseModule()," Migrating grounding line\n"); 19 19 20 /*Create vector holding all the elements that touch the ice shelf: */ 21 element_touching_iceshelf=CreateElementTouchingIceShelf(elements); 20 /*Loop until no more nodes and elements change from grounded to floating: */ 21 nflipped=1; //arbitrary, get things started 22 while(nflipped){ 22 23 23 /*Carry out grounding line migration for those elements: */ 24 for(i=0;i<elements->Size();i++){ 25 if (element_touching_iceshelf[i]){ 24 /*reset counter: */ 25 nflipped=0; 26 27 /*Create vector holding all the elements that touch the ice shelf, by any node: */ 28 element_touching_iceshelf=CreateElementTouchingIceShelf(elements); 29 30 /*Carry out grounding line migration for those elements: */ 31 for(i=0;i<elements->Size();i++){ 26 32 element=(Element*)elements->GetObjectByOffset(i); 27 element->MigrateGroundingLine();33 if(element_touching_iceshelf[element->Sid()]) element->MigrateGroundingLine(); 28 34 } 35 36 /*Now, update shelf flags in nodes and elements: */ 37 nflipped=UpdateShelfStatus(elements,nodes,parameters,element_touching_iceshelf); 38 _printf_(VerboseModule()," number of migrated nodes: %i\n",nflipped); 39 40 /*avoid memory leaks: */ 41 xfree((void**)&element_touching_iceshelf); 29 42 } 30 31 /*Now, update shelf flags in nodes and elements. We could not do this before, 32 *because we would end up with discontinuous bed and surface otherwise: */ 33 for(i=0;i<elements->Size();i++){ 34 element=(Element*)elements->GetObjectByOffset(i); 35 element->UpdateShelfStatus(); 36 } 37 43 44 38 45 /*free ressouces: */ 39 46 xfree((void**)&element_touching_iceshelf); -
issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h
r7078 r7287 12 12 bool* CreateElementOnGroundingLine(Elements* elements,double* element_on_iceshelf); 13 13 double* CreateElementTouchingIceShelf(Elements* elements); 14 int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters); 15 int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf); 14 16 15 17 #endif /* _GROUNDINGLINEMIGRATIONXLOCAL_H */
Note:
See TracChangeset
for help on using the changeset viewer.