Changeset 10309
- Timestamp:
- 10/26/11 08:52:51 (13 years ago)
- Location:
- issm/trunk/src/c/modules/GroundinglineMigrationx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r10300 r10309 5 5 #include "./GroundinglineMigrationx.h" 6 6 #include "./GroundinglineMigrationxLocal.h" 7 8 7 #include "../../shared/shared.h" 9 8 #include "../../io/io.h" 10 9 #include "../../include/include.h" 11 #include "../../io/io.h"12 10 #include "../../toolkits/toolkits.h" 13 11 #include "../../EnumDefinitions/EnumDefinitions.h" … … 16 14 void GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){ 17 15 18 int migration_style; 16 int i, migration_style; 17 Element* element=NULL; 19 18 20 19 _printf_(VerboseModule()," Migrating grounding line\n"); … … 24 23 25 24 /*call different migration modules, according to user wishes: */ 26 if(migration_style==AgressiveMigrationEnum) AgressiveMigration(elements,nodes, vertices,loads,materials, parameters); 27 else if(migration_style==SoftMigrationEnum) SoftMigration(elements,nodes, vertices,loads,materials, parameters); 25 if(migration_style==AgressiveMigrationEnum){ 26 /*Migrate grounding line : */ 27 for(i=0;i<elements->Size();i++){ 28 element=(Element*)elements->GetObjectByOffset(i); 29 element->AgressiveMigration(); 30 } 31 32 /*Synchronise mask: */ 33 for(i=0;i<elements->Size();i++){ 34 element=(Element*)elements->GetObjectByOffset(i); 35 element->ShelfSync(); 36 } 37 } 38 else if(migration_style==SoftMigrationEnum){ 39 40 /*Create flag for nodes above the hydrostatic equilibrium: */ 41 double* potential_sheet_ungrounding=PotentialSheetUngrounding(elements,nodes,parameters); 42 43 /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */ 44 double* sheet_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,parameters,potential_sheet_ungrounding); 45 46 /*Now, use the sheet_ungrounding flags to unground the ice sheet (at the same time, take care of grounding elements of the ice shelf 47 * that want to: */ 48 for(i=0;i<elements->Size();i++){ 49 element=(Element*)elements->GetObjectByOffset(i); 50 element->SoftMigration(sheet_ungrounding); 51 } 52 53 /*Synchronise mask*/ 54 for(i=0;i<elements->Size();i++){ 55 element=(Element*)elements->GetObjectByOffset(i); 56 element->ShelfSync(); 57 } 58 59 /*free ressouces: */ 60 xfree((void**)&potential_sheet_ungrounding); 61 xfree((void**)&sheet_ungrounding); 62 } 28 63 else if(migration_style==NoneEnum) _printf_(true,"%s\n","NoneEnum supplied for migration style, doing nothing!"); 29 64 else _error_("%s not supported yet!",EnumToStringx(migration_style)); -
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationxLocal.h
r10300 r10309 11 11 12 12 /* local prototypes: */ 13 void AgressiveMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);14 void SoftMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);15 13 double* PotentialSheetUngrounding(Elements* elements,Nodes* nodes,Parameters* parameters); 16 14 double* PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Parameters* parameters,double* potential_sheet_ungrounding); -
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationxUtils.cpp
r10300 r10309 12 12 #include "../../EnumDefinitions/EnumDefinitions.h" 13 13 14 /*FUNCTION AgressiveMigration{{{1*/15 void AgressiveMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){16 /*Here, whatever nodes inside the ice sheet want to unground, we allow -> instantaneous transmission of water through the bedrock: */17 18 int i;19 Element* element=NULL;20 21 _printf_(VerboseModule()," Migrating grounding line\n");22 23 /*Carry out grounding line migration for those elements: */24 for(i=0;i<elements->Size();i++){25 element=(Element*)elements->GetObjectByOffset(i);26 element->AgressiveMigration();27 }28 29 /*Synchronize shelf status: */30 for(i=0;i<elements->Size();i++){31 element=(Element*)elements->GetObjectByOffset(i);32 element->ShelfSync();33 }34 35 }36 /*}}}*/37 /*FUNCTION SoftMigration {{{1*/38 void SoftMigration(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){39 40 /*intermediary: */41 int i;42 double* potential_sheet_ungrounding=NULL;43 double* sheet_ungrounding=NULL;44 Element* element=NULL;45 46 _printf_(VerboseModule()," Migrating grounding line\n");47 48 /*First, figure out which nodes that are on the ice sheet want to unground. Build a flags vector for this (size number of nodes: */49 potential_sheet_ungrounding=PotentialSheetUngrounding(elements,nodes,parameters);50 51 /*Now, propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */52 sheet_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,parameters,potential_sheet_ungrounding);53 54 /*Now, use the sheet_ungrounding flags to unground the ice sheet (at the same time, take care of grounding elements of the ice shelf55 * that want to: */56 for(i=0;i<elements->Size();i++){57 element=(Element*)elements->GetObjectByOffset(i);58 element->SoftMigration(sheet_ungrounding);59 }60 61 /*Synchronize shelf status: */62 for(i=0;i<elements->Size();i++){63 element=(Element*)elements->GetObjectByOffset(i);64 element->ShelfSync();65 }66 67 /*free ressouces: */68 xfree((void**)&potential_sheet_ungrounding);69 xfree((void**)&sheet_ungrounding);70 71 }72 /*}}}*/73 14 /*FUNCTION PotentialSheetUngrounding {{{1*/ 74 15 double* PotentialSheetUngrounding(Elements* elements,Nodes* nodes,Parameters* parameters){ … … 168 109 } 169 110 /*}}}*/ 170 /*FUNCTION CreateElementOnGrounding nine {{{1*/111 /*FUNCTION CreateElementOnGroundingline {{{1*/ 171 112 bool* CreateElementOnGroundingline(Elements* elements,double* element_on_iceshelf){ 172 113 173 int i; 174 int j; 114 int i,j; 175 115 Element *element = NULL; 176 116 bool *element_on_gl = NULL; … … 330 270 Node* node=NULL; 331 271 332 333 272 /*First, initialize nodes_on_iceshelf, which will track which nodes have changed status: */ 334 273 numnods=nodes->NumberOfNodes(configuration_type);
Note:
See TracChangeset
for help on using the changeset viewer.