- Timestamp:
- 10/31/11 14:39:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r10376 r10377 13 13 void GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){ 14 14 15 int i, migration_style ;15 int i, migration_style,analysis_type; 16 16 double* vertices_potentially_ungrounding = NULL; 17 17 double* vertices_ungrounding = NULL; 18 double* old_floatingice = NULL; 18 19 Element* element = NULL; 19 20 … … 22 23 /*retrieve parameters: */ 23 24 parameters->FindParam(&migration_style,GroundinglineMigrationEnum); 25 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 26 24 27 if(migration_style==NoneEnum) return; 25 28 if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error_("%s not supported yet!",EnumToStringx(migration_style)); … … 33 36 } 34 37 38 /*Create vector with vertices initially floating*/ 39 old_floatingice=CreateNodesOnIceShelf(nodes,analysis_type); 40 35 41 /*Migrate grounding line : */ 36 42 for(i=0;i<elements->Size();i++){ 37 43 element=(Element*)elements->GetObjectByOffset(i); 38 element->MigrateGroundingLine(vertices_ungrounding); 39 } 40 41 /*Synchronise mask: */ 42 for(i=0;i<elements->Size();i++){ 43 element=(Element*)elements->GetObjectByOffset(i); 44 element->ShelfSync(); 44 element->MigrateGroundingLine(old_floatingice,vertices_ungrounding); 45 45 } 46 46 … … 48 48 xfree((void**)&vertices_potentially_ungrounding); 49 49 xfree((void**)&vertices_ungrounding); 50 xfree((void**)&old_floatingice); 50 51 } 51 52 /*FUNCTION PotentialSheetUngrounding {{{1*/ … … 67 68 } 68 69 69 /*Assemble vector :*/70 /*Assemble vector and serialize */ 70 71 VecAssemblyBegin(vec_vertices_potentially_ungrounding); 71 72 VecAssemblyEnd(vec_vertices_potentially_ungrounding); 72 73 /*Serialize vector: */74 73 VecToMPISerial(&vertices_potentially_ungrounding,vec_vertices_potentially_ungrounding); 75 74 … … 162 161 } 163 162 /*}}}*/ 163 /*FUNCTION CreateNodesOnIceShelf {{{1*/ 164 double* CreateNodesOnIceShelf(Nodes* nodes,int configuration_type){ 165 166 int i,numnods; 167 double* nodes_on_floatingice = NULL; 168 Vec vec_nodes_on_iceshelf = NULL; 169 Node* node = NULL; 170 171 /*First, initialize nodes_on_iceshelf, which will track which nodes have changed status: */ 172 numnods=nodes->NumberOfNodes(configuration_type); 173 vec_nodes_on_iceshelf=NewVec(numnods); 174 175 /*Loop through nodes, and fill vec_nodes_on_iceshelf: */ 176 for(i=0;i<nodes->Size();i++){ 177 node=(Node*)nodes->GetObjectByOffset(i); 178 if(node->InAnalysis(configuration_type)){ 179 if(node->IsFloating()){ 180 VecSetValue(vec_nodes_on_iceshelf,node->Sid(),1.0,INSERT_VALUES); 181 } 182 } 183 } 184 185 /*Assemble vector: */ 186 VecAssemblyBegin(vec_nodes_on_iceshelf); 187 VecAssemblyEnd(vec_nodes_on_iceshelf); 188 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_iceshelf); 189 190 /*Free ressources*/ 191 VecFree(&vec_nodes_on_iceshelf); 192 193 return nodes_on_floatingice; 194 } 195 /*%}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.