Changeset 23515
- Timestamp:
- 12/06/18 21:18:32 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
r23066 r23515 8 8 #include "./ModelProcessorx.h" 9 9 10 void CreateElements VerticesAndMaterials(Elements* elements,Vertices* vertices,Materials* materials,IoModel* iomodel,const int nummodels,int solution_type){10 void CreateElements(Elements* elements,IoModel* iomodel,const int nummodels){/*{{{*/ 11 11 12 12 /*Intermediary*/ 13 int i;14 int materials_type;15 13 bool control_analysis; 16 bool dakota_analysis;17 14 bool adolc_analysis; 18 bool isoceancoupling;19 int nnat,dummy;20 int* nature=NULL;21 15 22 16 /*Fetch parameters: */ 23 17 iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol"); 24 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota");25 iomodel->FindConstant(&materials_type,"md.materials.type");26 18 iomodel->FindConstant(&adolc_analysis,"md.autodiff.isautodiff"); 27 iomodel->FindConstant(&isoceancoupling,"md.transient.isoceancoupling");28 19 29 20 /*Did we already create the elements? : */ … … 38 29 switch(iomodel->meshelementtype){ 39 30 case TriaEnum: 40 for(i =0;i<iomodel->numberofelements;i++){31 for(int i=0;i<iomodel->numberofelements;i++){ 41 32 if(iomodel->my_elements[i]) elements->AddObject(new Tria(i+1,i,iomodel,nummodels)); 42 33 } 43 34 break; 44 35 case TetraEnum: 45 for(i =0;i<iomodel->numberofelements;i++){36 for(int i=0;i<iomodel->numberofelements;i++){ 46 37 if(iomodel->my_elements[i]) elements->AddObject(new Tetra(i+1,i,iomodel,nummodels)); 47 38 } … … 49 40 case PentaEnum: 50 41 iomodel->FetchData(2,"md.mesh.upperelements","md.mesh.lowerelements"); 51 for(i =0;i<iomodel->numberofelements;i++){42 for(int i=0;i<iomodel->numberofelements;i++){ 52 43 if(iomodel->my_elements[i]) elements->AddObject(new Penta(i+1,i,iomodel,nummodels)); 53 44 } … … 56 47 _error_("Mesh not supported yet"); 57 48 } 49 50 /*Free data: */ 51 iomodel->DeleteData(4,"md.mesh.upperelements","md.mesh.lowerelements","md.inversion.min_parameters","md.inversion.max_parameters"); 52 }/*}}}*/ 53 void CreateMaterials(Elements* elements,Materials* materials,IoModel* iomodel,const int nummodels){/*{{{*/ 54 55 /*Intermediary*/ 56 int i; 57 int nnat,dummy; 58 int* nature=NULL; 59 60 /*Fetch parameters: */ 61 int materials_type; 62 iomodel->FindConstant(&materials_type,"md.materials.type"); 63 64 /*Did we already create the materiaas? : */ 65 _assert_(materials->Size()==0); 58 66 59 67 /*Create materials*/ … … 223 231 224 232 /*Free data: */ 225 iomodel->DeleteData( 7,"md.mesh.upperelements","md.mesh.lowerelements","md.material.rheology_B","md.material.rheology_n","md.damage.D","md.inversion.min_parameters","md.inversion.max_parameters");233 iomodel->DeleteData(3,"md.material.rheology_B","md.material.rheology_n","md.damage.D"); 226 234 227 235 /*Add new constant material property to materials, at the end: */ 228 236 materials->AddObject(new Matpar(iomodel));//put it at the end of the materials 229 237 230 /*Create vertices: */ 238 239 }/*}}}*/ 240 void CreateVertices(Elements* elements,Vertices* vertices,IoModel* iomodel,int solution_type){/*{{{*/ 241 242 /*Fetch parameters: */ 243 bool isoceancoupling; 244 iomodel->FindConstant(&isoceancoupling,"md.transient.isoceancoupling"); 231 245 232 246 /*Fetch data:*/ … … 239 253 240 254 int lid = 0; 241 for(i =0;i<iomodel->numberofvertices;i++){255 for(int i=0;i<iomodel->numberofvertices;i++){ 242 256 if(iomodel->my_vertices[i]) vertices->AddObject(new Vertex(i+1,i,lid++,i,iomodel)); 243 257 } … … 247 261 if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->DeleteData(3,"md.mesh.lat","md.mesh.long","md.mesh.r"); 248 262 if (isoceancoupling) iomodel->DeleteData(2,"md.mesh.lat","md.mesh.long"); 249 } 263 }/*}}}*/ 264 265 void CreateElementsVerticesAndMaterials(Elements* elements,Vertices* vertices,Materials* materials,IoModel* iomodel,const int nummodels,int solution_type){/*{{{*/ 266 267 CreateElements(elements,iomodel,nummodels); 268 CreateMaterials(elements,materials,iomodel,nummodels); 269 CreateVertices(elements,vertices,iomodel,solution_type); 270 271 }/*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.