Changeset 7312
- Timestamp:
- 02/03/11 16:20:43 (14 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r7288 r7312 356 356 ./modules/GroundingLineMigrationx/GroundingLineMigrationx.h\ 357 357 ./modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h\ 358 ./modules/GroundingLineMigrationx/CreateElementOnIceShelf.cpp\ 359 ./modules/GroundingLineMigrationx/CreateElementTouchingIceShelf.cpp\ 360 ./modules/GroundingLineMigrationx/CreateElementOnGroundingLine.cpp\ 361 ./modules/GroundingLineMigrationx/UpdateShelfStatus.cpp\ 358 ./modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp\ 362 359 ./modules/ModelProcessorx/ModelProcessorx.h\ 363 360 ./modules/ModelProcessorx/ModelProcessorx.cpp\ … … 935 932 ./modules/GroundingLineMigrationx/GroundingLineMigrationx.h\ 936 933 ./modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h\ 937 ./modules/GroundingLineMigrationx/CreateElementOnIceShelf.cpp\ 938 ./modules/GroundingLineMigrationx/CreateElementTouchingIceShelf.cpp\ 939 ./modules/GroundingLineMigrationx/CreateElementOnGroundingLine.cpp\ 940 ./modules/GroundingLineMigrationx/UpdateShelfStatus.cpp\ 934 ./modules/GroundingLineMigrationx/GroundingLineMigrationxUtils.cpp\ 941 935 ./modules/ModelProcessorx/ModelProcessorx.h\ 942 936 ./modules/ModelProcessorx/ModelProcessorx.cpp\ … … 1180 1174 ./solutions/transient2d_core.cpp\ 1181 1175 ./solutions/transient3d_core.cpp\ 1176 ./solutions/groundinglinemigration2d_core.cpp\ 1182 1177 ./solutions/steadystate_core.cpp\ 1183 1178 ./solutions/steadystateconvergence.cpp\ -
issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationx.cpp
r7288 r7312 5 5 #include "./GroundingLineMigrationx.h" 6 6 #include "./GroundingLineMigrationxLocal.h" 7 7 8 #include "../../shared/shared.h" 8 9 #include "../../include/include.h" 9 10 #include "../../toolkits/toolkits.h" 10 11 #include "../../EnumDefinitions/EnumDefinitions.h" 12 #include "../../Container/Container.h" 11 13 12 14 void GroundingLineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){ 13 15 14 int i,j;15 Element* element=NULL;16 double* element_touching_iceshelf=NULL;17 int nflipped;18 16 17 int migration_style; 18 19 19 _printf_(VerboseModule()," Migrating grounding line\n"); 20 21 /*retrieve parameters: */ 22 parameters->FindParam(&migration_style,GroundingLineMigrationEnum); 23 24 /*call different migration modules, according to user wishes: */ 25 if(migration_style==AgressiveMigrationEnum) AgressiveMigration(elements,nodes, vertices,loads,materials, parameters); 26 else if(migration_style==SoftMigrationEnum) AgressiveMigration(elements,nodes, vertices,loads,materials, parameters); 27 else if(migration_style==NoneEnum)_printf_("%s\n","NoneEnum supplied for migration style, doing nothing!"); 28 else _error_("%s not supported yet!",EnumToString(migration_style)); 20 29 21 /*Loop until no more nodes and elements change from grounded to floating: */22 nflipped=1; //arbitrary, get things started23 24 while(nflipped){25 26 /*reset counter: */27 nflipped=0;28 29 /*Create vector holding all the elements that touch the ice shelf, by any node: */30 element_touching_iceshelf=CreateElementTouchingIceShelf(elements);31 32 /*Carry out grounding line migration for those elements: */33 for(i=0;i<elements->Size();i++){34 element=(Element*)elements->GetObjectByOffset(i);35 if(element_touching_iceshelf[element->Sid()]) element->MigrateGroundingLine();36 }37 38 /*Now, update shelf flags in nodes and elements: */39 nflipped=UpdateShelfStatus(elements,nodes,parameters,element_touching_iceshelf);40 _printf_(VerboseModule()," number of migrated nodes: %i\n",nflipped);41 42 /*avoid memory leaks: */43 xfree((void**)&element_touching_iceshelf);44 }45 46 47 /*free ressouces: */48 xfree((void**)&element_touching_iceshelf);49 30 } -
issm/trunk/src/c/modules/GroundingLineMigrationx/GroundingLineMigrationxLocal.h
r7288 r7312 11 11 12 12 /* local prototypes: */ 13 14 void AgressiveMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters); 15 void SoftMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters); 16 13 17 double* CreateElementOnIceShelf(Elements* elements); 14 18 bool* CreateElementOnGroundingLine(Elements* elements,double* element_on_iceshelf); 15 19 double* CreateElementTouchingIceShelf(Elements* elements); 16 int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf);20 int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf); 17 21 18 22 #endif /* _GROUNDINGLINEMIGRATIONXLOCAL_H */
Note:
See TracChangeset
for help on using the changeset viewer.