- Timestamp:
- 04/16/12 14:57:18 (13 years ago)
- Location:
- issm/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk ¶
- Property svn:ignore
-
TabularUnified
old new 7 7 config.status 8 8 configure 9 doxygen10 9 ISSM.paf 11 10 ISSM.ppf 12 11 ISSM.ppf_cache 13 12 libtool 14 list15 13 Makefile 16 14 Makefile.in
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
TabularUnified issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp ¶
r10400 r11995 17 17 double* vertices_ungrounding = NULL; 18 18 double* old_floatingice = NULL; 19 Vec vec_old_floatingice = NULL;19 Vector* vec_old_floatingice = NULL; 20 20 Element* element = NULL; 21 21 … … 39 39 /*Create vector with vertices initially floating and serialize*/ 40 40 vec_old_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type); 41 VecToMPISerial(&old_floatingice,vec_old_floatingice);41 old_floatingice=vec_old_floatingice->ToMPISerial(); 42 42 43 43 /*Migrate grounding line : */ … … 48 48 49 49 /*free ressouces: */ 50 VecFree(&vec_old_floatingice);50 xdelete(&vec_old_floatingice); 51 51 xfree((void**)&vertices_potentially_ungrounding); 52 52 xfree((void**)&vertices_ungrounding); … … 55 55 56 56 /*FUNCTION CreateNodesOnFloatingIce {{{1*/ 57 Vec CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){57 Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){ 58 58 59 59 int i,numnods; 60 Vec vec_nodes_on_floatingice = NULL;60 Vector* vec_nodes_on_floatingice = NULL; 61 61 Node *node = NULL; 62 62 63 63 /*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */ 64 64 numnods=nodes->NumberOfNodes(configuration_type); 65 vec_nodes_on_floatingice= NewVec(numnods);65 vec_nodes_on_floatingice=new Vector(numnods); 66 66 67 67 /*Loop through nodes, and fill vec_nodes_on_floatingice: */ … … 70 70 if(node->InAnalysis(configuration_type)){ 71 71 if(node->IsFloating()){ 72 VecSetValue(vec_nodes_on_floatingice,node->Sid(),1.0,INSERT_VALUES);72 vec_nodes_on_floatingice->SetValue(node->Sid(),1.0,INS_VAL); 73 73 } 74 74 } … … 76 76 77 77 /*Assemble vector: */ 78 VecAssemblyBegin(vec_nodes_on_floatingice); 79 VecAssemblyEnd(vec_nodes_on_floatingice); 78 vec_nodes_on_floatingice->Assemble(); 80 79 81 80 return vec_nodes_on_floatingice; … … 87 86 int i,numberofvertices; 88 87 double* vertices_potentially_ungrounding = NULL; 89 Vec vec_vertices_potentially_ungrounding = NULL;88 Vector* vec_vertices_potentially_ungrounding = NULL; 90 89 Element* element = NULL; 91 90 92 91 /*Initialize vector with number of vertices*/ 93 92 numberofvertices=vertices->NumberOfVertices(); 94 vec_vertices_potentially_ungrounding= NewVec(numberofvertices); //grounded vertex that could start floating93 vec_vertices_potentially_ungrounding=new Vector(numberofvertices); //grounded vertex that could start floating 95 94 96 95 /*Fill vector vertices_potentially_floating: */ … … 101 100 102 101 /*Assemble vector and serialize */ 103 VecAssemblyBegin(vec_vertices_potentially_ungrounding); 104 VecAssemblyEnd(vec_vertices_potentially_ungrounding); 105 VecToMPISerial(&vertices_potentially_ungrounding,vec_vertices_potentially_ungrounding); 102 vec_vertices_potentially_ungrounding->Assemble(); 103 vertices_potentially_ungrounding=vec_vertices_potentially_ungrounding->ToMPISerial(); 106 104 107 105 /*free ressouces and return: */ 108 VecFree(&vec_vertices_potentially_ungrounding);106 xdelete(&vec_vertices_potentially_ungrounding); 109 107 return vertices_potentially_ungrounding; 110 108 } … … 118 116 double* nodes_on_floatingice = NULL; 119 117 double* elements_neighboring_floatingce = NULL; 120 Vec vec_elements_neighboring_floatingice = NULL;121 Vec vec_nodes_on_floatingice = NULL;118 Vector* vec_elements_neighboring_floatingice = NULL; 119 Vector* vec_nodes_on_floatingice = NULL; 122 120 Node* node = NULL; 123 121 Element* element = NULL; … … 130 128 /*recover vec_nodes_on_floatingice*/ 131 129 vec_nodes_on_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type); 132 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice);130 nodes_on_floatingice=vec_nodes_on_floatingice->ToMPISerial(); 133 131 134 132 nflipped=1; //bootstrap … … 136 134 137 135 /*Vector of size number of elements*/ 138 vec_elements_neighboring_floatingice= NewVec(elements->NumberOfElements(),true);136 vec_elements_neighboring_floatingice=new Vector(elements->NumberOfElements(),true); 139 137 140 138 /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/ 141 139 for(i=0;i<elements->Size();i++){ 142 140 element=(Element*)elements->GetObjectByOffset(i); 143 VecSetValue(vec_elements_neighboring_floatingice,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INSERT_VALUES);141 vec_elements_neighboring_floatingice->SetValue(element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INS_VAL); 144 142 } 145 143 146 144 /*Assemble vector and serialize: */ 147 VecAssemblyBegin(vec_elements_neighboring_floatingice); 148 VecAssemblyEnd(vec_elements_neighboring_floatingice); 149 VecToMPISerial(&elements_neighboring_floatingce,vec_elements_neighboring_floatingice); 145 vec_elements_neighboring_floatingice->Assemble(); 146 elements_neighboring_floatingce=vec_elements_neighboring_floatingice->ToMPISerial(); 150 147 151 148 /*Go through elements_neighboring_floatingce, and update vector of the nodes that will start floating*/ … … 157 154 } 158 155 } 159 VecAssemblyBegin(vec_nodes_on_floatingice); 160 VecAssemblyEnd(vec_nodes_on_floatingice); 156 vec_nodes_on_floatingice->Assemble(); 161 157 162 158 MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD); … … 168 164 169 165 /*Assemble and serialize:*/ 170 VecFree(&vec_elements_neighboring_floatingice);171 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice);166 xdelete(&vec_elements_neighboring_floatingice); 167 nodes_on_floatingice=vec_nodes_on_floatingice->ToMPISerial(); 172 168 } 173 169 174 170 /*Free ressources:*/ 175 VecFree(&vec_nodes_on_floatingice);171 xdelete(&vec_nodes_on_floatingice); 176 172 xfree((void**)&elements_neighboring_floatingce); 177 173
Note:
See TracChangeset
for help on using the changeset viewer.