Changeset 3383 for issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
- Timestamp:
- 04/04/10 23:08:44 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
r3332 r3383 9 9 #include "../../shared/shared.h" 10 10 #include "../../MeshPartitionx/MeshPartitionx.h" 11 #include "../../include/typedefs.h" 11 12 #include "../IoModel.h" 12 13 … … 33 34 Matice* matice = NULL; 34 35 Matpar* matpar = NULL; 36 ElementProperties* tria_properties=NULL; 37 ElementProperties* penta_properties=NULL; 35 38 36 39 /*output: */ … … 47 50 /*tria constructor input: */ 48 51 int tria_id; 49 int tria_m id;50 int tria_m parid;51 int tria_numpar id;52 int tria_ g[3];52 int tria_matice_id; 53 int tria_matpar_id; 54 int tria_numpar_id; 55 int tria_node_ids[3]; 53 56 double tria_h[3]; 54 57 double tria_s[3]; … … 57 60 double tria_melting[3]; 58 61 double tria_accumulation[3]; 59 double tria_geothermalflux[3];60 62 int tria_friction_type; 61 63 double tria_p; … … 71 73 /*penta constructor input: */ 72 74 int penta_id; 73 int penta_m id;74 int penta_m parid;75 int penta_numpar id;76 int penta_ g[6];75 int penta_matice_id; 76 int penta_matpar_id; 77 int penta_numpar_id; 78 int penta_node_ids[6]; 77 79 double penta_h[6]; 78 80 double penta_s[6]; … … 88 90 double penta_melting[6]; 89 91 double penta_accumulation[6]; 90 double penta_geothermalflux[6];91 int penta_thermal_steadystate;92 92 bool penta_onwater; 93 93 … … 218 218 /*ids: */ 219 219 tria_id=i+1; //matlab indexing. 220 tria_m id=i+1; //refers to the corresponding material property card221 tria_m parid=iomodel->numberofelements+1;//refers to the corresponding parmat property card222 tria_numpar id=1;223 224 /*vertices offsets: */225 tria_ g[0]=(int)*(iomodel->elements+elements_width*i+0);226 tria_ g[1]=(int)*(iomodel->elements+elements_width*i+1);227 tria_ g[2]=(int)*(iomodel->elements+elements_width*i+2);220 tria_matice_id=i+1; //refers to the corresponding material property card 221 tria_matpar_id=iomodel->numberofelements+1;//refers to the corresponding parmat property card 222 tria_numpar_id=1; 223 224 /*vertices ids: */ 225 tria_node_ids[0]=(int)*(iomodel->elements+elements_width*i+0); 226 tria_node_ids[1]=(int)*(iomodel->elements+elements_width*i+1); 227 tria_node_ids[2]=(int)*(iomodel->elements+elements_width*i+2); 228 228 229 229 /*thickness,surface and bed:*/ … … 263 263 tria_onwater=(bool)*(iomodel->elementonwater+i); 264 264 265 /*Create properties: */ 266 tria_properties=new ElementProperties(3,tria_h, tria_s, tria_b, tria_k, tria_melting, tria_accumulation, NULL, 267 tria_friction_type, tria_p, tria_q, tria_shelf, UNDEF,tria_onwater, UNDEF,UNDEF,UNDEF); 268 265 269 /*Create tria element using its constructor:*/ 266 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_numparid,tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_onwater); 270 tria=new Tria(tria_id, tria_node_ids, tria_matice_id, tria_matpar_id, tria_numpar_id, tria_properties); 271 272 /*delete properties: */ 273 delete tria_properties; 267 274 268 275 /*Add tria element to elements dataset: */ … … 351 358 /*name and id: */ 352 359 penta_id=i+1; //matlab indexing. 353 penta_m id=i+1; //refers to the corresponding material property card354 penta_m parid=iomodel->numberofelements+1;//refers to the corresponding parmat property card355 penta_numpar id=1;360 penta_matice_id=i+1; //refers to the corresponding material property card 361 penta_matpar_id=iomodel->numberofelements+1;//refers to the corresponding parmat property card 362 penta_numpar_id=1; 356 363 357 364 /*vertices,thickness,surface,bed and drag: */ 358 365 for(j=0;j<6;j++){ 359 penta_ g[j]=(int)*(iomodel->elements+elements_width*i+j);366 penta_node_ids[j]=(int)*(iomodel->elements+elements_width*i+j); 360 367 penta_h[j]=*(iomodel->thickness+ ((int)*(iomodel->elements+elements_width*i+j)-1)); 361 368 penta_s[j]=*(iomodel->surface+ ((int)*(iomodel->elements+elements_width*i+j)-1)); … … 385 392 } 386 393 394 /*Create element properties: */ 395 penta_properties=new ElementProperties(6,penta_h, penta_s, penta_b, penta_k, penta_melting, penta_accumulation, NULL, penta_friction_type, penta_p, penta_q, penta_shelf, penta_onbed, penta_onwater, penta_onsurface, penta_collapse, UNDEF); 387 396 388 397 /*Create Penta using its constructor:*/ 389 penta= new Penta( penta_id,penta_mid,penta_mparid,penta_numparid,penta_g,penta_h,penta_s,penta_b,penta_k,penta_friction_type,390 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface, 391 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,392 penta_thermal_steadystate,penta_onwater);398 penta= new Penta(penta_id,penta_node_ids, penta_matice_id, penta_matpar_id, penta_numpar_id, penta_properties); 399 400 /*delete properties: */ 401 delete penta_properties; 393 402 394 403 /*Add penta element to elements dataset: */
Note:
See TracChangeset
for help on using the changeset viewer.