- Timestamp:
- 10/31/11 14:48:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r10377 r10378 17 17 double* vertices_ungrounding = NULL; 18 18 double* old_floatingice = NULL; 19 Vec vec_old_floatingice = NULL; 19 20 Element* element = NULL; 20 21 … … 36 37 } 37 38 38 /*Create vector with vertices initially floating*/ 39 old_floatingice=CreateNodesOnIceShelf(nodes,analysis_type); 39 /*Create vector with vertices initially floating and serialize*/ 40 vec_old_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type); 41 VecToMPISerial(&old_floatingice,vec_old_floatingice); 40 42 41 43 /*Migrate grounding line : */ … … 46 48 47 49 /*free ressouces: */ 50 VecFree(&vec_old_floatingice); 48 51 xfree((void**)&vertices_potentially_ungrounding); 49 52 xfree((void**)&vertices_ungrounding); 50 53 xfree((void**)&old_floatingice); 51 54 } 55 56 /*FUNCTION CreateNodesOnFloatingIce {{{1*/ 57 Vec CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){ 58 59 int i,numnods; 60 Vec vec_nodes_on_floatingice = NULL; 61 Node* node = NULL; 62 63 /*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */ 64 numnods=nodes->NumberOfNodes(configuration_type); 65 vec_nodes_on_floatingice=NewVec(numnods); 66 67 /*Loop through nodes, and fill vec_nodes_on_floatingice: */ 68 for(i=0;i<nodes->Size();i++){ 69 node=(Node*)nodes->GetObjectByOffset(i); 70 if(node->InAnalysis(configuration_type)){ 71 if(node->IsFloating()){ 72 VecSetValue(vec_nodes_on_floatingice,node->Sid(),1.0,INSERT_VALUES); 73 } 74 } 75 } 76 77 /*Assemble vector: */ 78 VecAssemblyBegin(vec_nodes_on_floatingice); 79 VecAssemblyEnd(vec_nodes_on_floatingice); 80 81 return vec_nodes_on_floatingice; 82 } 83 /*%}}}*/ 52 84 /*FUNCTION PotentialSheetUngrounding {{{1*/ 53 85 double* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){ … … 97 129 98 130 /*recover vec_nodes_on_floatingice*/ 99 vec_nodes_on_floatingice=NewVec(numberofvertices); 100 101 /*Loop through nodes, and fill nodes_on_floatingice: */ 102 for(i=0;i<nodes->Size();i++){ 103 node=(Node*)nodes->GetObjectByOffset(i); 104 if(node->InAnalysis(analysis_type)){ 105 if(node->IsFloating()){ 106 VecSetValue(vec_nodes_on_floatingice,node->Sid(),1.0,INSERT_VALUES); 107 } 108 } 109 } 110 111 /*Assemble vector and serialize: */ 112 VecAssemblyBegin(vec_nodes_on_floatingice); 113 VecAssemblyEnd(vec_nodes_on_floatingice); 131 vec_nodes_on_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type); 114 132 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice); 115 133 … … 161 179 } 162 180 /*}}}*/ 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.