Changeset 10364
- Timestamp:
- 10/31/11 10:29:35 (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
r10356 r10364 27 27 28 28 if(migration_style==SoftMigrationEnum){ 29 /*Create flag for nodes above the hydrostatic equilibrium: */29 /*Create flag for grounded vertices above the hydrostatic equilibrium: */ 30 30 vertices_potentially_ungrounding=PotentialSheetUngrounding(elements,vertices,parameters); 31 31 32 32 /*propagate ice shelf into connex areas of the ice sheet that potentially want to unground: */ 33 vertices_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes, parameters,vertices_potentially_ungrounding);33 vertices_ungrounding=PropagateShelfIntoConnexIceSheet(elements,nodes,vertices,parameters,vertices_potentially_ungrounding); 34 34 } 35 35 -
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationxLocal.h
r10356 r10364 12 12 13 13 /* local prototypes: */ 14 double* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);15 double* PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Parameters* parameters,double* vertices_potentially_ungrounding);16 14 bool* CreateElementOnGroundingline(Elements* elements,double* element_on_iceshelf); 17 15 double* CreateElementOnIceShelf(Elements* elements); 18 double* CreateElementTouchingIceShelf(Elements* elements,Vec vec_nodes_on_iceshelf); 19 Vec CreateNodesOnIceShelf(Nodes* nodes,int analysis_type); 16 double* CreateElementTouchingIceShelf(Elements* elements,double* nodes_on_iceshelf); 17 Vec CreateNodesOnIceShelf(Nodes* nodes,Vertices* vertices,int analysis_type); 18 double* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters); 19 double* PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding); 20 20 21 21 int UpdateShelfStatus(Elements* elements,Nodes* nodes,Parameters* parameters,double* element_touching_iceshelf); -
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationxUtils.cpp
r10359 r10364 75 75 /*}}}*/ 76 76 /*FUNCTION CreateElementTouchingIceShelf {{{1*/ 77 double* CreateElementTouchingIceShelf(Elements* elements, Vec vec_nodes_on_iceshelf){77 double* CreateElementTouchingIceShelf(Elements* elements,double* nodes_on_iceshelf){ 78 78 79 79 int i; 80 double *nodes_on_iceshelf = NULL;81 80 double *element_touching_iceshelf = NULL; 82 81 Element *element = NULL; 83 82 Vec vec_element_touching_iceshelf = NULL; 84 83 85 /*serialize: */86 VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);87 88 84 /*Create vector holding all the elements IsFloating flags: */ 89 85 vec_element_touching_iceshelf=NewVec(elements->NumberOfElements(),true); … … 104 100 /*free ressouces: */ 105 101 VecFree(&vec_element_touching_iceshelf); 106 xfree((void**)&nodes_on_iceshelf);107 102 108 103 return element_touching_iceshelf; … … 110 105 /*}}}*/ 111 106 /*FUNCTION CreateNodesOnIceShelf {{{1*/ 112 Vec CreateNodesOnIceShelf(Nodes* nodes, int configuration_type){113 114 int i,num nods;107 Vec CreateNodesOnIceShelf(Nodes* nodes,Vertices* vertices,int configuration_type){ 108 109 int i,numberofvertices; 115 110 Vec nodes_on_iceshelf = NULL; 116 111 Node* node = NULL; 117 112 118 113 /*First, initialize nodes_on_iceshelf, which will track which nodes have changed status: */ 119 num nods=nodes->NumberOfNodes(configuration_type);120 nodes_on_iceshelf=NewVec(num nods);114 numberofvertices=vertices->NumberOfVertices(); 115 nodes_on_iceshelf=NewVec(numberofvertices); 121 116 122 117 /*Loop through nodes, and fill nodes_on_iceshelf: */ … … 168 163 /*}}}*/ 169 164 /*FUNCTION PropagateShelfIntoConnexIceSheet {{{1*/ 170 double* PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes, Parameters* parameters,double* vertices_potentially_ungrounding){165 double* PropagateShelfIntoConnexIceSheet(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){ 171 166 172 167 int i,analysis_type; … … 180 175 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 181 176 182 /*recover vec_nodes_on_iceshelf: */ 183 vec_nodes_on_iceshelf=CreateNodesOnIceShelf(nodes,analysis_type); 177 /*recover vec_nodes_on_iceshelf and serialize: */ 178 vec_nodes_on_iceshelf=CreateNodesOnIceShelf(nodes,vertices,analysis_type); 179 VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf); 184 180 185 181 nflipped=1; //bootstrap … … 187 183 188 184 /*get a list of potential elements that have nodes on ice shelf: */ 189 elements_touching_iceshelf=CreateElementTouchingIceShelf(elements,vec_nodes_on_iceshelf); 190 191 /*now, go through elements_touching_iceshelf, and if they have nodes inside potential_sheet_ungrounding, 192 * flag it: */ 185 elements_touching_iceshelf=CreateElementTouchingIceShelf(elements,nodes_on_iceshelf); 186 187 /*Go through elements_touching_iceshelf, and flag their nodes that can unground inside potential_sheet_ungrounding*/ 193 188 local_nflipped=0; 194 195 /*serialize vec_nodes_on_iceshelf, needed by element's UpdatePotentialSheetUngrounding routine, to figure out if196 * nodes have flipped from grounded to ungrounded: */197 VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf);198 199 189 for(i=0;i<elements->Size();i++){ 200 190 element=(Element*)elements->GetObjectByOffset(i); … … 208 198 209 199 /*Avoid leaks: */ 200 xfree((void**)&elements_touching_iceshelf); 210 201 xfree((void**)&nodes_on_iceshelf); 211 xfree((void**)&elements_touching_iceshelf); 212 213 /*Assemble:*/ 202 203 /*Assemble and serialize:*/ 214 204 VecAssemblyBegin(vec_nodes_on_iceshelf); 215 205 VecAssemblyEnd(vec_nodes_on_iceshelf); 216 } 217 218 /*Serialize: */ 219 VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf); 206 VecToMPISerial(&nodes_on_iceshelf,vec_nodes_on_iceshelf); 207 } 220 208 221 209 /*Free ressources:*/
Note:
See TracChangeset
for help on using the changeset viewer.