Changeset 3417
- Timestamp:
- 04/07/10 12:23:51 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 9 added
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.h
r3372 r3417 7 7 8 8 9 #ifndef DATASET_H_10 #define DATASET_H_9 #ifndef _DATASET_H_ 10 #define _DATASET_H_ 11 11 12 12 #include <vector> -
issm/trunk/src/c/Dofx/Dofx.cpp
r3332 r3417 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 int Dofx( DofVec** ppartition, DofVec** ptpartition, DataSet* elements,DataSet* nodes, DataSet* params) {12 int Dofx( DofVec** ppartition, DofVec** ptpartition, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* params) { 13 13 14 14 int noerr=1; … … 21 21 /*intermediary: */ 22 22 int numberofnodes; 23 int numberofvertices; 23 24 int numberofdofspernode; 24 25 … … 31 32 tpartition=new DofVec("tpartition"); 32 33 33 /*First, recover number of grids from parameters: */ 34 /*First, recover number of vertices and nodes from parameters: */ 35 found=params->FindParam(&numberofvertices,"numberofvertices"); 36 if(!found)ISSMERROR(" could not find numberofvertices in parameters"); 37 34 38 found=params->FindParam(&numberofnodes,"numberofnodes"); 35 39 if(!found)ISSMERROR(" could not find numberofnodes in parameters"); … … 41 45 /*Ensure that only for each cpu, the partition border nodes only will be taken into account once 42 46 * across the cluster. To do so, we flag all the clone nodes: */ 47 vertices->FlagClones(numberofvertices); 43 48 nodes->FlagClones(numberofnodes); 44 49 -
issm/trunk/src/c/Dofx/Dofx.h
r2316 r3417 9 9 10 10 /* local prototypes: */ 11 int Dofx( DofVec** partition, DofVec** ptpartition,DataSet* elements,DataSet* nodesin, DataSet* params);11 int Dofx( DofVec** partition, DofVec** ptpartition,DataSet* elements,DataSet* nodesin, DataSet* verticesin, DataSet* params); 12 12 13 13 #endif /* _DOFX_H */ -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp
r3383 r3417 15 15 int ParametersEnum(void){ return 106; } 16 16 int ResultsEnum(void){ return 107; } 17 int VerticesEnum(void){ return 108; } 17 18 18 19 /*ANALYSIS TYPES: */ … … 71 72 int ElementEnum(void){ return 410; } 72 73 int TriaEnum(void){ return 411; } 73 int ElementPropertiesEnum(void){ return 412; } 74 int PentaEnum(void){ return 413; } 75 int SingEnum(void){ return 414; } 76 int BeamEnum(void){ return 415; } 74 int ElementPropertiesEnum(void){ return 412; } 75 int NodePropertiesEnum(void){ return 413; } 76 int PentaEnum(void){ return 414; } 77 int SingEnum(void){ return 415; } 78 int BeamEnum(void){ return 416; } 79 int DofIndexingEnum(void){ return 417; } 80 77 81 /*Grids: */ 78 int NodeEnum(void){ return 420; } 82 int VertexEnum(void){ return 420; } 83 int NodeEnum(void){ return 421; } 79 84 /*Loads: */ 80 85 int LoadEnum(void){ return 430; } -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r3383 r3417 16 16 int ParametersEnum(void); 17 17 int ResultsEnum(void); 18 int VerticesEnum(void); 18 19 19 20 /*ANALYSIS TYPES: */ … … 73 74 int TriaEnum(void); 74 75 int ElementPropertiesEnum(void); 76 int NodePropertiesEnum(void); 75 77 int PentaEnum(void); 76 78 int SingEnum(void); 77 79 int BeamEnum(void); 80 int DofIndexingEnum(void); 78 81 /*Grids: */ 79 82 int NodeEnum(void); 83 int VertexEnum(void); 80 84 /*Loads: */ 81 85 int LoadEnum(void); -
issm/trunk/src/c/Makefile.am
r3406 r3417 52 52 ./objects/DakotaPlugin.h\ 53 53 ./objects/DakotaPlugin.cpp\ 54 ./objects/Node.h\55 ./objects/Node.cpp\56 54 ./objects/Vertex.h\ 57 55 ./objects/Vertex.cpp\ 58 56 ./objects/Hook.h\ 59 57 ./objects/Hook.cpp\ 58 ./objects/DofIndexing.h\ 59 ./objects/DofIndexing.cpp\ 60 ./objects/NodeProperties.h\ 61 ./objects/NodeProperties.cpp\ 62 ./objects/Node.h\ 63 ./objects/Node.cpp\ 60 64 ./objects/Result.h\ 61 65 ./objects/Result.cpp\ … … 201 205 ./ModelProcessorx/IoModel.h\ 202 206 ./ModelProcessorx/IoModel.cpp\ 207 ./ModelProcessorx/Partitioning.cpp\ 203 208 ./ModelProcessorx/CreateDataSets.cpp\ 204 209 ./ModelProcessorx/CreateParameters.cpp\ … … 446 451 ./objects/DakotaPlugin.h\ 447 452 ./objects/DakotaPlugin.cpp\ 453 ./objects/DofIndexing.h\ 454 ./objects/DofIndexing.cpp\ 455 ./objects/NodeProperties.h\ 456 ./objects/NodeProperties.cpp\ 448 457 ./objects/Node.h\ 449 458 ./objects/Node.cpp\ … … 592 601 ./ModelProcessorx/IoModel.h\ 593 602 ./ModelProcessorx/IoModel.cpp\ 603 ./ModelProcessorx/Partitioning.cpp\ 594 604 ./ModelProcessorx/CreateDataSets.cpp\ 595 605 ./ModelProcessorx/CreateParameters.cpp\ -
issm/trunk/src/c/ModelProcessorx/Balancedthickness/CreateElementsNodesAndMaterialsBalancedthickness.cpp
r3383 r3417 13 13 14 14 15 void CreateElementsNodesAndMaterialsBalancedthickness(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){15 void CreateElementsNodesAndMaterialsBalancedthickness(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 16 16 17 17 … … 26 26 DataSet* elements = NULL; 27 27 DataSet* nodes = NULL; 28 DataSet* vertices = NULL; 28 29 DataSet* materials = NULL; 29 30 30 31 /*Objects: */ 31 32 Node* node = NULL; 33 NodeProperties node_properties; 34 Vertex* vertex = NULL; 32 35 Tria* tria = NULL; 33 36 Penta* penta = NULL; … … 96 99 /* node constructor input: */ 97 100 int node_id; 98 int node_partitionborder=0; 99 double node_x[3]; 100 double node_sigma; 101 int vertex_id; 102 int partitionborder=0; 101 103 int node_onbed; 102 104 int node_onsurface; … … 121 123 elements = new DataSet(ElementsEnum()); 122 124 nodes = new DataSet(NodesEnum()); 125 vertices = new DataSet(VerticesEnum()); 123 126 materials = new DataSet(MaterialsEnum()); 124 127 … … 436 439 #endif 437 440 441 #ifdef _PARALLEL_ 442 if(my_bordergrids[i]>1.0) { //this grid belongs to a partition border 443 partitionborder=1; 444 } 445 else{ 446 partitionborder=0; 447 } 448 #else 449 partitionborder=0; 450 #endif 451 452 /*create vertex: */ 453 vertex_id=i+1; 454 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]),partitionborder); 455 vertices->AddObject(vertex); 456 457 /*create node: */ 438 458 node_id=i+1; //matlab indexing 439 459 440 460 441 442 #ifdef _PARALLEL_ 443 if(my_bordergrids[i]>1.0) { //this grid belongs to a partition border 444 node_partitionborder=1; 445 } 446 else{ 447 node_partitionborder=0; 448 } 449 #else 450 node_partitionborder=0; 451 #endif 452 453 node_x[0]=iomodel->x[i]; 454 node_x[1]=iomodel->y[i]; 455 node_x[2]=iomodel->z[i]; 456 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]); 457 458 node_onbed=(int)iomodel->gridonbed[i]; 459 node_onsurface=(int)iomodel->gridonsurface[i]; 460 node_onshelf=(int)iomodel->gridoniceshelf[i]; 461 node_onsheet=(int)iomodel->gridonicesheet[i]; 461 node_properties.SetProperties( 462 (int)iomodel->gridonbed[i], 463 (int)iomodel->gridonsurface[i], 464 (int)iomodel->gridoniceshelf[i], 465 (int)iomodel->gridonicesheet[i]); 462 466 463 467 if (strcmp(iomodel->meshtype,"3d")==0){ … … 475 479 476 480 /*Create node using its constructor: */ 477 node=new Node(node_id,node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet); 481 node=new Node(node_id,vertex_id, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 482 478 483 479 484 /*set single point constraints.: */ … … 497 502 * datasets, it will not be redone: */ 498 503 elements->Presort(); 504 vertices->Presort(); 499 505 nodes->Presort(); 500 506 materials->Presort(); … … 531 537 *pelements=elements; 532 538 *pnodes=nodes; 539 *pvertices=vertices; 533 540 *pmaterials=materials; 534 541 -
issm/trunk/src/c/ModelProcessorx/Balancedvelocities/CreateElementsNodesAndMaterialsBalancedvelocities.cpp
r3383 r3417 13 13 14 14 15 void CreateElementsNodesAndMaterialsBalancedvelocities(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){15 void CreateElementsNodesAndMaterialsBalancedvelocities(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 16 16 17 17 … … 26 26 DataSet* elements = NULL; 27 27 DataSet* nodes = NULL; 28 DataSet* vertices = NULL; 28 29 DataSet* materials = NULL; 29 30 ElementProperties* tria_properties=NULL; … … 32 33 /*Objects: */ 33 34 Node* node = NULL; 35 Vertex* vertex = NULL; 34 36 Tria* tria = NULL; 35 37 Penta* penta = NULL; … … 96 98 /* node constructor input: */ 97 99 int node_id; 98 int node_partitionborder=0; 99 double node_x[3]; 100 double node_sigma; 100 int vertex_id; 101 int partitionborder=0; 101 102 int node_onbed; 102 103 int node_onsurface; … … 121 122 elements = new DataSet(ElementsEnum()); 122 123 nodes = new DataSet(NodesEnum()); 124 vertices = new DataSet(VerticesEnum()); 123 125 materials = new DataSet(MaterialsEnum()); 124 126 … … 435 437 #endif 436 438 439 /*create vertex: */ 440 vertex_id=i+1; 441 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i])); 442 443 vertices->AddObject(vertex); 444 437 445 node_id=i+1; //matlab indexing 438 446 439 440 441 447 #ifdef _PARALLEL_ 442 448 if(my_bordergrids[i]>1.0) { //this grid belongs to a partition border … … 450 456 #endif 451 457 452 node_x[0]=iomodel->x[i]; 453 node_x[1]=iomodel->y[i]; 454 node_x[2]=iomodel->z[i]; 455 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]); 456 457 node_onbed=(int)iomodel->gridonbed[i]; 458 node_onsurface=(int)iomodel->gridonsurface[i]; 459 node_onshelf=(int)iomodel->gridoniceshelf[i]; 460 node_onsheet=(int)iomodel->gridonicesheet[i]; 458 node_properties.SetProperties( 459 (int)iomodel->gridonbed[i], 460 (int)iomodel->gridonsurface[i], 461 (int)iomodel->gridoniceshelf[i], 462 (int)iomodel->gridonicesheet[i]); 463 461 464 462 465 if (strcmp(iomodel->meshtype,"3d")==0){ … … 474 477 475 478 /*Create node using its constructor: */ 476 node=new Node(node_id, node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);479 node=new Node(node_id,vertex_id, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 477 480 478 481 /*set single point constraints.: */ … … 497 500 elements->Presort(); 498 501 nodes->Presort(); 502 vertices->Presort(); 499 503 materials->Presort(); 500 504 … … 530 534 *pelements=elements; 531 535 *pnodes=nodes; 536 *pvertices=vertices; 532 537 *pmaterials=materials; 533 538 -
issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp
r3354 r3417 15 15 16 16 17 void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** p materials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){17 void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 18 18 19 19 /*create parameters common to all solutions: */ … … 26 26 if (iomodel->sub_analysis_type==HorizAnalysisEnum()){ 27 27 28 CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes, pmaterials, iomodel,iomodel_handle);28 CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 29 29 CreateConstraintsDiagnosticHoriz(pconstraints,iomodel,iomodel_handle); 30 30 CreateLoadsDiagnosticHoriz(ploads,iomodel,iomodel_handle); … … 34 34 else if (iomodel->sub_analysis_type==VertAnalysisEnum()){ 35 35 36 CreateElementsNodesAndMaterialsDiagnosticVert(pelements,pnodes, pmaterials, iomodel,iomodel_handle);36 CreateElementsNodesAndMaterialsDiagnosticVert(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 37 37 CreateConstraintsDiagnosticVert(pconstraints,iomodel,iomodel_handle); 38 38 CreateLoadsDiagnosticVert(ploads,iomodel,iomodel_handle); … … 41 41 else if (iomodel->sub_analysis_type==StokesAnalysisEnum()){ 42 42 43 CreateElementsNodesAndMaterialsDiagnosticStokes(pelements,pnodes, pmaterials, iomodel,iomodel_handle);43 CreateElementsNodesAndMaterialsDiagnosticStokes(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 44 44 CreateConstraintsDiagnosticStokes(pconstraints,iomodel,iomodel_handle); 45 45 CreateLoadsDiagnosticStokes(ploads,iomodel,iomodel_handle); … … 48 48 else if (iomodel->sub_analysis_type==HutterAnalysisEnum()){ 49 49 50 CreateElementsNodesAndMaterialsDiagnosticHutter(pelements,pnodes,p materials, iomodel,iomodel_handle);50 CreateElementsNodesAndMaterialsDiagnosticHutter(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 51 51 CreateConstraintsDiagnosticHutter(pconstraints,iomodel,iomodel_handle); 52 52 CreateLoadsDiagnosticHutter(ploads,iomodel,iomodel_handle); … … 56 56 else if (iomodel->analysis_type==SlopecomputeAnalysisEnum()){ 57 57 58 CreateElementsNodesAndMaterialsSlopeCompute(pelements,pnodes, pmaterials, iomodel,iomodel_handle);58 CreateElementsNodesAndMaterialsSlopeCompute(pelements,pnodes, pvertices,pmaterials, iomodel,iomodel_handle); 59 59 CreateConstraintsSlopeCompute(pconstraints,iomodel,iomodel_handle); 60 60 CreateLoadsSlopeCompute(ploads,iomodel,iomodel_handle); … … 63 63 else if (iomodel->analysis_type==ThermalAnalysisEnum()){ 64 64 65 CreateElementsNodesAndMaterialsThermal(pelements,pnodes,p materials, iomodel,iomodel_handle);65 CreateElementsNodesAndMaterialsThermal(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 66 66 CreateConstraintsThermal(pconstraints,iomodel,iomodel_handle); 67 67 CreateLoadsThermal(ploads,iomodel,iomodel_handle); … … 71 71 else if (iomodel->analysis_type==MeltingAnalysisEnum()){ 72 72 73 CreateElementsNodesAndMaterialsMelting(pelements,pnodes,p materials, iomodel,iomodel_handle);73 CreateElementsNodesAndMaterialsMelting(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 74 74 CreateConstraintsMelting(pconstraints,iomodel,iomodel_handle); 75 75 CreateLoadsMelting(ploads,iomodel,iomodel_handle); … … 78 78 else if (iomodel->analysis_type==PrognosticAnalysisEnum()){ 79 79 80 CreateElementsNodesAndMaterialsPrognostic(pelements,pnodes,p materials, iomodel,iomodel_handle);80 CreateElementsNodesAndMaterialsPrognostic(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 81 81 CreateConstraintsPrognostic(pconstraints,iomodel,iomodel_handle); 82 82 CreateLoadsPrognostic(ploads,iomodel,iomodel_handle); … … 86 86 else if (iomodel->analysis_type==Prognostic2AnalysisEnum()){ 87 87 88 CreateElementsNodesAndMaterialsPrognostic2(pelements,pnodes,p materials, iomodel,iomodel_handle);88 CreateElementsNodesAndMaterialsPrognostic2(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 89 89 CreateConstraintsPrognostic2(pconstraints,iomodel,iomodel_handle); 90 90 CreateLoadsPrognostic2(ploads,iomodel,iomodel_handle); … … 94 94 else if (iomodel->analysis_type==BalancedthicknessAnalysisEnum()){ 95 95 96 CreateElementsNodesAndMaterialsBalancedthickness(pelements,pnodes,p materials, iomodel,iomodel_handle);96 CreateElementsNodesAndMaterialsBalancedthickness(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 97 97 CreateConstraintsBalancedthickness(pconstraints,iomodel,iomodel_handle); 98 98 CreateLoadsBalancedthickness(ploads,iomodel,iomodel_handle); … … 102 102 else if (iomodel->analysis_type==BalancedvelocitiesAnalysisEnum()){ 103 103 104 CreateElementsNodesAndMaterialsBalancedvelocities(pelements,pnodes,p materials, iomodel,iomodel_handle);104 CreateElementsNodesAndMaterialsBalancedvelocities(pelements,pnodes,pvertices,pmaterials, iomodel,iomodel_handle); 105 105 CreateConstraintsBalancedvelocities(pconstraints,iomodel,iomodel_handle); 106 106 CreateLoadsBalancedvelocities(ploads,iomodel,iomodel_handle); -
issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
r3359 r3417 238 238 parameters->AddObject(param); 239 239 240 /*numberofgrids: */ 240 /*numberofvertices: */ 241 count++; 242 param= new Param(count,"numberofvertices",DOUBLE); 243 param->SetDouble(iomodel->numberofvertices); 244 parameters->AddObject(param); 245 246 /*numberofnodes: */ 241 247 count++; 242 248 param= new Param(count,"numberofnodes",DOUBLE); 243 249 if (iomodel->analysis_type==Prognostic2AnalysisEnum()) param->SetDouble(3*iomodel->numberofelements); 244 else param->SetDouble(iomodel->numberof nodes);250 else param->SetDouble(iomodel->numberofvertices); 245 251 parameters->AddObject(param); 246 252 -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
r3383 r3417 13 13 14 14 15 void CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 16 17 18 /*output: int* epart, int* my_grids, double* my_bordergrids*/ 15 void CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 19 16 20 17 21 18 int i,j,k,n; 22 extern int my_rank;23 extern int num_procs;24 19 25 20 /*DataSets: */ 26 21 DataSet* elements = NULL; 27 22 DataSet* nodes = NULL; 23 DataSet* vertices = NULL; 28 24 DataSet* materials = NULL; 29 25 30 26 /*Objects: */ 31 27 Node* node = NULL; 28 Vertex* vertex = NULL; 32 29 Tria* tria = NULL; 33 30 Penta* penta = NULL; 34 31 Matice* matice = NULL; 35 32 Matpar* matpar = NULL; 36 ElementProperties* tria_properties=NULL; 37 ElementProperties* penta_properties=NULL; 38 39 /*output: */ 40 int* epart=NULL; //element partitioning. 41 int* npart=NULL; //node partitioning. 42 int* my_grids=NULL; 43 double* my_bordergrids=NULL; 44 45 46 /*intermediary: */ 47 int elements_width; //size of elements 48 double B_avg; 49 50 /*tria constructor input: */ 51 int tria_id; 52 int tria_matice_id; 53 int tria_matpar_id; 54 int tria_numpar_id; 55 int tria_node_ids[3]; 56 double tria_h[3]; 57 double tria_s[3]; 58 double tria_b[3]; 59 double tria_k[3]; 60 double tria_melting[3]; 61 double tria_accumulation[3]; 62 int tria_friction_type; 63 double tria_p; 64 double tria_q; 65 int tria_shelf; 66 bool tria_onwater; 67 68 /*matice constructor input: */ 69 int matice_mid; 70 double matice_B; 71 double matice_n; 72 73 /*penta constructor input: */ 74 int penta_id; 75 int penta_matice_id; 76 int penta_matpar_id; 77 int penta_numpar_id; 78 int penta_node_ids[6]; 79 double penta_h[6]; 80 double penta_s[6]; 81 double penta_b[6]; 82 double penta_k[6]; 83 int penta_friction_type; 84 double penta_p; 85 double penta_q; 86 int penta_shelf; 87 int penta_onbed; 88 int penta_onsurface; 89 int penta_collapse; 90 double penta_melting[6]; 91 double penta_accumulation[6]; 92 bool penta_onwater; 93 94 /*matpar constructor input: */ 95 int matpar_mid; 96 double matpar_rho_ice; 97 double matpar_rho_water; 98 double matpar_heatcapacity; 99 double matpar_thermalconductivity; 100 double matpar_latentheat; 101 double matpar_beta; 102 double matpar_meltingpoint; 103 double matpar_mixed_layer_capacity; 104 double matpar_thermal_exchange_velocity; 105 double matpar_g; 106 107 /* node constructor input: */ 108 int node_id; 109 int node_partitionborder=0; 110 double node_x[3]; 111 double node_sigma; 112 int node_onbed; 113 int node_onsurface; 114 int node_onsheet; 115 int node_onshelf; 116 int node_upper_node_id; 117 int node_numdofs; 118 119 120 #ifdef _PARALLEL_ 121 /*Metis partitioning: */ 122 int range; 123 Vec gridborder=NULL; 124 int my_numgrids; 125 int* all_numgrids=NULL; 126 int gridcount; 127 int count; 128 #endif 129 int first_grid_index; 130 131 /*Rifts:*/ 132 int el1,el2; 133 33 34 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */ 35 if (!iomodel->ismacayealpattyn)goto cleanup_and_return; 36 134 37 /*First create the elements, nodes and material properties: */ 135 38 elements = new DataSet(ElementsEnum()); 136 39 nodes = new DataSet(NodesEnum()); 40 vertices = new DataSet(VerticesEnum()); 137 41 materials = new DataSet(MaterialsEnum()); 138 42 139 140 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */ 141 if (!iomodel->ismacayealpattyn)goto cleanup_and_return; 142 143 /*Width of elements: */ 144 if(strcmp(iomodel->meshtype,"2d")==0){ 145 elements_width=3; //tria elements 146 } 147 else{ 148 elements_width=6; //penta elements 149 } 150 151 152 153 #ifdef _PARALLEL_ 154 /*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/ 155 if(strcmp(iomodel->meshtype,"2d")==0){ 156 /*load elements: */ 157 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements"); 158 } 159 else{ 160 /*load elements2d: */ 161 IoModelFetchData(&iomodel->elements2d,NULL,NULL,iomodel_handle,"elements2d"); 162 } 163 164 MeshPartitionx(&epart, &npart,iomodel->numberofelements,iomodel->numberofnodes,iomodel->elements, iomodel->numberofelements2d,iomodel->numberofnodes2d,iomodel->elements2d,iomodel->numlayers,elements_width, iomodel->meshtype,num_procs); 165 166 /*Free elements and elements2d: */ 167 xfree((void**)&iomodel->elements); 168 xfree((void**)&iomodel->elements2d); 169 170 171 /*Deal with rifts, they have to be included into one partition only, not several: */ 172 IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo"); 173 174 for(i=0;i<iomodel->numrifts;i++){ 175 el1=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)-1; //matlab indexing to c indexing 176 el2=(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+3)-1; //matlab indexing to c indexing 177 epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding grids; 178 } 179 /*Free rifts: */ 180 xfree((void**)&iomodel->riftinfo); 181 182 /*Used later on: */ 183 my_grids=(int*)xcalloc(iomodel->numberofnodes,sizeof(int)); 184 #endif 185 186 187 188 /*elements created vary if we are dealing with a 2d mesh, or a 3d mesh: */ 43 /*Partition elements and vertices and nodes: */ 44 Partitioning(&iomodel->my_elements, &iomodel->my_vertices, &iomodel->my_nodes, &iomodel->my_bordervertices, iomodel, iomodel_handle); 189 45 190 46 /*2d mesh: */ … … 209 65 for (i=0;i<iomodel->numberofelements;i++){ 210 66 211 #ifdef _PARALLEL_ 212 /*!All elements have been partitioned above, only create elements for this CPU: */ 213 if(my_rank==epart[i]){ 214 #endif 215 216 if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 1 are Hutter type Tria. Don't create this elements. 67 if(iomodel->my_elements[i]){ 217 68 218 /*ids: */ 219 tria_id=i+1; //matlab indexing. 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 229 /*thickness,surface and bed:*/ 230 tria_h[0]= *(iomodel->thickness+ ((int)*(iomodel->elements+elements_width*i+0)-1)); //remember, elements is an index of vertices offsets, in matlab indexing. 231 tria_h[1]=*(iomodel->thickness+ ((int)*(iomodel->elements+elements_width*i+1)-1)); 232 tria_h[2]=*(iomodel->thickness+ ((int)*(iomodel->elements+elements_width*i+2)-1)) ; 233 234 tria_s[0]=*(iomodel->surface+ ((int)*(iomodel->elements+elements_width*i+0)-1)); 235 tria_s[1]=*(iomodel->surface+ ((int)*(iomodel->elements+elements_width*i+1)-1)); 236 tria_s[2]=*(iomodel->surface+ ((int)*(iomodel->elements+elements_width*i+2)-1)); 237 238 tria_b[0]=*(iomodel->bed+ ((int)*(iomodel->elements+elements_width*i+0)-1)); 239 tria_b[1]=*(iomodel->bed+ ((int)*(iomodel->elements+elements_width*i+1)-1)); 240 tria_b[2]=*(iomodel->bed+ ((int)*(iomodel->elements+elements_width*i+2)-1)); 241 242 /*basal drag:*/ 243 tria_friction_type=(int)iomodel->drag_type; 244 245 tria_k[0]=*(iomodel->drag+ ((int)*(iomodel->elements+elements_width*i+0)-1)); 246 tria_k[1]=*(iomodel->drag+ ((int)*(iomodel->elements+elements_width*i+1)-1)); 247 tria_k[2]=*(iomodel->drag+ ((int)*(iomodel->elements+elements_width*i+2)-1)); 248 249 tria_p=iomodel->p[i]; 250 tria_q=iomodel->q[i]; 251 252 /*meling and accumulation*/ 253 tria_melting[0]=*(iomodel->melting+ ((int)*(iomodel->elements+elements_width*i+0)-1)); 254 tria_melting[1]=*(iomodel->melting+ ((int)*(iomodel->elements+elements_width*i+1)-1)); 255 tria_melting[2]=*(iomodel->melting+ ((int)*(iomodel->elements+elements_width*i+2)-1)); 256 257 tria_accumulation[0]=*(iomodel->accumulation+ ((int)*(iomodel->elements+elements_width*i+0)-1)); 258 tria_accumulation[1]=*(iomodel->accumulation+ ((int)*(iomodel->elements+elements_width*i+1)-1)); 259 tria_accumulation[2]=*(iomodel->accumulation+ ((int)*(iomodel->elements+elements_width*i+2)-1)); 260 261 /*element on iceshelf, water?:*/ 262 tria_shelf=(int)*(iomodel->elementoniceshelf+i); 263 tria_onwater=(bool)*(iomodel->elementonwater+i); 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 269 /*Create tria element using its constructor:*/ 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; 274 275 /*Add tria element to elements dataset: */ 276 elements->AddObject(tria); 277 278 /*Deal with material property card: */ 279 matice_mid=i+1; //same as the material id from the geom2 elements. 280 281 /*Average B over 3 grid elements: */ 282 B_avg=0; 283 for(j=0;j<3;j++){ 284 B_avg+=*(iomodel->B+((int)*(iomodel->elements+elements_width*i+j)-1)); 69 if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 1 are Hutter type Tria. Don't create this elements. 70 71 /*Create and add tria element to elements dataset: */ 72 elements->AddObject(new Tria(i,iomodel)); 73 74 /*Create and add material property to materials dataset: */ 75 materials->AddObject(new Matice(i,iomodel,3)); 285 76 } 286 B_avg=B_avg/3; 287 matice_B=B_avg; 288 matice_n=(double)*(iomodel->n+i); 289 290 /*Create matice using its constructor:*/ 291 matice= new Matice(matice_mid,matice_B,matice_n); 292 293 /*Add matice element to materials dataset: */ 294 materials->AddObject(matice); 295 296 } //if(!MacAyealFormulationEnum) 297 298 #ifdef _PARALLEL_ 299 /*Now that we are here, we can also start building the list of grids belonging to this node partition: we use 300 *the element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing) 301 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 302 will hold which grids belong to this partition*/ 303 my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1; 304 my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1; 305 my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1; 306 #endif 307 308 #ifdef _PARALLEL_ 309 }//if(my_rank==epart[i]) 310 #endif 311 77 } 312 78 }//for (i=0;i<numberofelements;i++) 313 314 79 315 80 /*Free data : */ … … 349 114 350 115 for (i=0;i<iomodel->numberofelements;i++){ 351 #ifdef _PARALLEL_ 352 /*We are using our element partition to decide which elements will be created on this node: */ 353 if(my_rank==epart[i]){ 354 #endif 355 356 if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum() | *(iomodel->elements_type+2*i+0)==PattynFormulationEnum()){ //elements of type 1 are Hutter type Tria. Don't create this elements. 357 358 /*name and id: */ 359 penta_id=i+1; //matlab indexing. 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; 363 364 /*vertices,thickness,surface,bed and drag: */ 365 for(j=0;j<6;j++){ 366 penta_node_ids[j]=(int)*(iomodel->elements+elements_width*i+j); 367 penta_h[j]=*(iomodel->thickness+ ((int)*(iomodel->elements+elements_width*i+j)-1)); 368 penta_s[j]=*(iomodel->surface+ ((int)*(iomodel->elements+elements_width*i+j)-1)); 369 penta_b[j]=*(iomodel->bed+ ((int)*(iomodel->elements+elements_width*i+j)-1)); 370 penta_k[j]=*(iomodel->drag+ ((int)*(iomodel->elements+elements_width*i+j)-1)); 371 penta_melting[j]=*(iomodel->melting+ ((int)*(iomodel->elements+elements_width*i+j)-1)); 372 penta_accumulation[j]=*(iomodel->accumulation+ ((int)*(iomodel->elements+elements_width*i+j)-1)); 116 if(my_elements[i]){ 117 if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum() | *(iomodel->elements_type+2*i+0)==PattynFormulationEnum()){ //elements of type 1 are Hutter type Tria. Don't create this elements. 118 /*Create and add penta element to elements dataset: */ 119 elements->AddObject(new Penta(i,iomodel)); 120 121 /*Create and add material property to materials dataset: */ 122 materials->AddObject(new Matice(i,iomodel,6)); 123 373 124 } 374 375 /*basal drag:*/ 376 penta_friction_type=(int)iomodel->drag_type; 377 378 penta_p=iomodel->p[i]; 379 penta_q=iomodel->q[i]; 380 381 /*diverse: */ 382 penta_shelf=(int)*(iomodel->elementoniceshelf+i); 383 penta_onbed=(int)*(iomodel->elementonbed+i); 384 penta_onsurface=(int)*(iomodel->elementonsurface+i); 385 penta_onwater=(bool)*(iomodel->elementonwater+i); 386 387 if (*(iomodel->elements_type+2*i+0)==MacAyealFormulationEnum()){ //elements of type 3 are MacAyeal type Penta. We collapse the formulation on their base. 388 penta_collapse=1; 389 } 390 else{ 391 penta_collapse=0; 392 } 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); 396 397 /*Create Penta using its constructor:*/ 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; 402 403 /*Add penta element to elements dataset: */ 404 elements->AddObject(penta); 405 406 407 /*Deal with material:*/ 408 matice_mid=i+1; //same as the material id from the geom2 elements. 409 /*Average B over 6 element grids: */ 410 B_avg=0; 411 for(j=0;j<6;j++){ 412 B_avg+=*(iomodel->B+((int)*(iomodel->elements+elements_width*i+j)-1)); 413 } 414 B_avg=B_avg/6; 415 matice_B= B_avg; 416 matice_n=(double)*(iomodel->n+i); 417 418 /*Create matice using its constructor:*/ 419 matice= new Matice(matice_mid,matice_B,matice_n); 420 421 /*Add matice element to materials dataset: */ 422 materials->AddObject(matice); 423 424 } 425 426 #ifdef _PARALLEL_ 427 /*Now that we are here, we can also start building the list of grids belonging to this node partition: we use 428 *the element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing) 429 into the grid coordinates. If we start plugging 1 into my_grids for each index[n][i] (i=0:2), then my_grids 430 will hold which grids belong to this partition*/ 431 my_grids[(int)*(iomodel->elements+elements_width*i+0)-1]=1; 432 my_grids[(int)*(iomodel->elements+elements_width*i+1)-1]=1; 433 my_grids[(int)*(iomodel->elements+elements_width*i+2)-1]=1; 434 my_grids[(int)*(iomodel->elements+elements_width*i+3)-1]=1; 435 my_grids[(int)*(iomodel->elements+elements_width*i+4)-1]=1; 436 my_grids[(int)*(iomodel->elements+elements_width*i+5)-1]=1; 437 #endif 438 439 #ifdef _PARALLEL_ 440 }//if(my_rank==epart[i]) 441 #endif 125 }//if(my_elements[i]) 442 126 443 127 }//for (i=0;i<numberofelements;i++) … … 463 147 } //if (strcmp(meshtype,"2d")==0) 464 148 465 /*Add one constant material property to materials: */ 466 matpar_mid=iomodel->numberofelements+1; //put it at the end of the materials 467 matpar_g=iomodel->g; 468 matpar_rho_ice=iomodel->rho_ice; 469 matpar_rho_water=iomodel->rho_water; 470 matpar_thermalconductivity=iomodel->thermalconductivity; 471 matpar_heatcapacity=iomodel->heatcapacity; 472 matpar_latentheat=iomodel->latentheat; 473 matpar_beta=iomodel->beta; 474 matpar_meltingpoint=iomodel->meltingpoint; 475 matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity; 476 matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity; 477 478 /*Create matpar object using its constructor: */ 479 matpar=new Matpar(matpar_mid,matpar_rho_ice,matpar_rho_water,matpar_heatcapacity,matpar_thermalconductivity, 480 matpar_latentheat,matpar_beta,matpar_meltingpoint,matpar_mixed_layer_capacity, 481 matpar_thermal_exchange_velocity,matpar_g); 482 483 /*Add to materials datset: */ 484 materials->AddObject(matpar); 485 486 #ifdef _PARALLEL_ 487 /*From the element partitioning, we can determine which grids are on the inside of this cpu's 488 *element partition, and which are on its border with other nodes:*/ 489 gridborder=NewVec(iomodel->numberofnodes); 490 491 for (i=0;i<iomodel->numberofnodes;i++){ 492 if(my_grids[i])VecSetValue(gridborder,i,1,ADD_VALUES); 493 } 494 VecAssemblyBegin(gridborder); 495 VecAssemblyEnd(gridborder); 496 497 #ifdef _ISSM_DEBUG_ 498 VecView(gridborder,PETSC_VIEWER_STDOUT_WORLD); 499 #endif 500 501 VecToMPISerial(&my_bordergrids,gridborder); 502 503 #ifdef _ISSM_DEBUG_ 504 if(my_rank==0){ 505 for (i=0;i<iomodel->numberofnodes;i++){ 506 printf("Grid id %i Border grid %lf\n",i+1,my_bordergrids[i]); 507 } 508 } 509 #endif 510 #endif 511 512 /*Partition penalties in 3d: */ 513 if(strcmp(iomodel->meshtype,"3d")==0){ 514 515 /*Get penalties: */ 516 IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties"); 517 518 if(iomodel->numpenalties){ 519 520 iomodel->penaltypartitioning=(int*)xmalloc(iomodel->numpenalties*sizeof(int)); 521 #ifdef _SERIAL_ 522 for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=1; 523 #else 524 for(i=0;i<iomodel->numpenalties;i++)iomodel->penaltypartitioning[i]=-1; 525 526 for(i=0;i<iomodel->numpenalties;i++){ 527 first_grid_index=(int)(*(iomodel->penalties+i*iomodel->numlayers+0)-1); 528 if((my_grids[first_grid_index]==1) && (my_bordergrids[first_grid_index]<=1.0) ) { //this grid belongs to this node's internal partition grids 529 /*All grids that are being penalised belong to this node's internal grid partition.:*/ 530 iomodel->penaltypartitioning[i]=1; 531 } 532 if(my_bordergrids[first_grid_index]>1.0) { //this grid belongs to a partition border 533 iomodel->penaltypartitioning[i]=0; 534 } 535 } 536 #endif 537 } 538 539 /*Free penalties: */ 540 xfree((void**)&iomodel->penalties); 541 } 542 543 /*Ok, let's summarise. Now, every CPU has the following two arrays: my_grids, and my_bordergrids. 544 We can therefore determine which grids are internal to this node's partition 545 and which ones are shared with other nodes because they are on the border of this node's partition. Knowing 546 that, go and create the grids*/ 547 548 /*Create nodes from x,y,z, as well as the spc values on those grids: */ 549 550 /*First fetch data: */ 551 if (strcmp(iomodel->meshtype,"3d")==0){ 552 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 553 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 554 } 149 150 /*Add new constrant material property tgo materials, at the end: */ 151 materials->AddObject(new Matpar(iomodel)); 152 153 /*Create nodes and vertices: */ 555 154 IoModelFetchData(&iomodel->x,NULL,NULL,iomodel_handle,"x"); 556 155 IoModelFetchData(&iomodel->y,NULL,NULL,iomodel_handle,"y"); … … 563 162 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 564 163 IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf"); 565 566 /*Get number of dofs per node: */ 567 DistributeNumDofs(&node_numdofs,iomodel->analysis_type,iomodel->sub_analysis_type); 568 569 for (i=0;i<iomodel->numberofnodes;i++){ 570 #ifdef _PARALLEL_ 571 572 /*keep only this partition's nodes:*/ 573 if((my_grids[i]==1)){ 574 #endif 575 576 node_id=i+1; //matlab indexing 164 if (strcmp(iomodel->meshtype,"3d")==0){ 165 IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids"); 166 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 167 } 168 169 170 for (i=0;i<iomodel->numberovertices;i++){ 171 172 /*vertices and nodes (same number, as we are running continuous galerkin formulation: */ 173 if(iomodel->my_vertices[i]){ 577 174 578 579 #ifdef _PARALLEL_ 580 if(my_bordergrids[i]>1.0) { //this grid belongs to a partition border 581 node_partitionborder=1; 175 /*Add vertex to vertices dataset: */ 176 vertices->AddObject(new Vertex(i,iomodel)); 177 178 /*Add node to nodes dataset: */ 179 nodes->AddObject(new Node(i,iomodel)); 180 582 181 } 583 else{584 node_partitionborder=0;585 }586 #else587 node_partitionborder=0;588 #endif589 590 node_x[0]=iomodel->x[i];591 node_x[1]=iomodel->y[i];592 node_x[2]=iomodel->z[i];593 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]);594 595 node_onbed=(int)iomodel->gridonbed[i];596 node_onsurface=(int)iomodel->gridonsurface[i];597 node_onshelf=(int)iomodel->gridoniceshelf[i];598 node_onsheet=(int)iomodel->gridonicesheet[i];599 600 if (strcmp(iomodel->meshtype,"3d")==0){601 if (isnan(iomodel->uppernodes[i])){602 node_upper_node_id=node_id; //nodes on surface do not have upper nodes, only themselves.603 }604 else{605 node_upper_node_id=(int)iomodel->uppernodes[i];606 }607 }608 else{609 /*If we are running 2d, upper_node does not mean much. Just point towards itself!:*/610 node_upper_node_id=node_id;611 }612 613 /*Create node using its constructor: */614 node=new Node(node_id,node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);615 616 /*set single point constraints.: */617 if (strcmp(iomodel->meshtype,"3d")==0){618 /*On a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */619 if (iomodel->deadgrids[i]){620 for(k=1;k<=node_numdofs;k++){621 node->FreezeDof(k);622 }623 }624 }625 if (iomodel->gridonhutter[i]){626 for(k=1;k<=node_numdofs;k++){627 node->FreezeDof(k);628 }629 }630 /*Add node to nodes dataset: */631 nodes->AddObject(node);632 633 #ifdef _PARALLEL_634 } //if((my_grids[i]==1))635 #endif636 182 } 637 638 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these639 * datasets, it will not be redone: */640 elements->Presort();641 nodes->Presort();642 materials->Presort();643 183 644 184 /*Clean fetched data: */ … … 655 195 xfree((void**)&iomodel->gridonicesheet); 656 196 xfree((void**)&iomodel->gridoniceshelf); 657 658 659 /*Keep partitioning information into iomodel*/ 660 iomodel->epart=epart; 661 iomodel->my_grids=my_grids; 662 iomodel->my_bordergrids=my_bordergrids; 663 664 /*Free ressources:*/ 665 #ifdef _PARALLEL_ 666 xfree((void**)&all_numgrids); 667 xfree((void**)&npart); 668 VecFree(&gridborder); 669 #endif 670 671 cleanup_and_return: 672 197 198 /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these 199 * datasets, it will not be redone: */ 200 elements->Presort(); 201 nodes->Presort(); 202 vertices->Presort(); 203 materials->Presort(); 204 673 205 /*Assign output pointer: */ 674 206 *pelements=elements; 675 207 *pnodes=nodes; 208 *pvertices=vertices; 676 209 *pmaterials=materials; 677 210 -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp
r3383 r3417 13 13 #include "../IoModel.h" 14 14 15 void CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){15 void CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 16 16 17 17 … … 26 26 DataSet* elements = NULL; 27 27 DataSet* nodes = NULL; 28 DataSet* vertices = NULL; 28 29 DataSet* materials = NULL; 29 30 30 31 /*Objects: */ 31 32 Node* node = NULL; 33 Vertex* vertex = NULL; 32 34 Penta* penta = NULL; 33 35 Matice* matice = NULL; … … 88 90 /* node constructor input: */ 89 91 int node_id; 92 int vertex_id; 90 93 int node_partitionborder=0; 91 double node_x[3];92 double node_sigma;93 94 int node_onbed; 94 95 int node_onsurface; … … 113 114 elements = new DataSet(ElementsEnum()); 114 115 nodes = new DataSet(NodesEnum()); 116 vertices = new DataSet(VerticesEnum()); 115 117 materials = new DataSet(MaterialsEnum()); 116 118 … … 400 402 #endif 401 403 404 /*create vertex: */ 405 vertex_id=i+1; 406 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i])); 407 408 vertices->AddObject(vertex); 409 402 410 node_id=i+1; //matlab indexing 403 404 405 411 406 412 #ifdef _PARALLEL_ … … 415 421 #endif 416 422 417 node_x[0]=iomodel->x[i]; 418 node_x[1]=iomodel->y[i]; 419 node_x[2]=iomodel->z[i]; 420 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]); 421 422 node_onbed=(int)iomodel->gridonbed[i]; 423 node_onsurface=(int)iomodel->gridonsurface[i]; 424 node_onshelf=(int)iomodel->gridoniceshelf[i]; 425 node_onsheet=(int)iomodel->gridonicesheet[i]; 426 423 node_properties.SetProperties( 424 (int)iomodel->gridonbed[i], 425 (int)iomodel->gridonsurface[i], 426 (int)iomodel->gridoniceshelf[i], 427 (int)iomodel->gridonicesheet[i]); 428 429 427 430 if (strcmp(iomodel->meshtype,"3d")==0){ 428 431 if (isnan(iomodel->uppernodes[i])){ … … 439 442 440 443 /*Create node using its constructor: */ 441 node=new Node(node_id, node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);444 node=new Node(node_id,vertex_id, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 442 445 443 446 /*set single point constraints.: */ … … 468 471 elements->Presort(); 469 472 nodes->Presort(); 473 vertices->Presort(); 470 474 materials->Presort(); 471 475 … … 503 507 *pelements=elements; 504 508 *pnodes=nodes; 509 *pvertices=vertices; 505 510 *pmaterials=materials; 506 511 -
issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp
r3383 r3417 14 14 15 15 16 void CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){16 void CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 17 17 18 18 … … 27 27 DataSet* elements = NULL; 28 28 DataSet* nodes = NULL; 29 DataSet* vertices = NULL; 29 30 DataSet* materials = NULL; 30 31 31 32 /*Objects: */ 32 33 Node* node = NULL; 34 Vertex* vertex = NULL; 33 35 Penta* penta = NULL; 34 36 Matice* matice = NULL; … … 88 90 /* node constructor input: */ 89 91 int node_id; 92 int vertex_id; 90 93 int node_partitionborder=0; 91 double node_x[3];92 double node_sigma;93 94 int node_onbed; 94 95 int node_onsurface; … … 123 124 elements = new DataSet(ElementsEnum()); 124 125 nodes = new DataSet(NodesEnum()); 126 vertices = new DataSet(VerticesEnum()); 125 127 materials = new DataSet(MaterialsEnum()); 126 128 … … 329 331 #endif 330 332 333 /*create vertex: */ 334 vertex_id=i+1; 335 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i])); 336 337 vertices->AddObject(vertex); 338 339 331 340 node_id=i+1; //matlab indexing 332 333 334 341 335 342 #ifdef _PARALLEL_ … … 344 351 #endif 345 352 346 node_x[0]=iomodel->x[i]; 347 node_x[1]=iomodel->y[i]; 348 node_x[2]=iomodel->z[i]; 349 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]); 350 351 node_onbed=(int)iomodel->gridonbed[i]; 352 node_onsurface=(int)iomodel->gridonsurface[i]; 353 node_onshelf=(int)iomodel->gridoniceshelf[i]; 354 node_onsheet=(int)iomodel->gridonicesheet[i]; 355 353 node_properties.SetProperties( 354 (int)iomodel->gridonbed[i], 355 (int)iomodel->gridonsurface[i], 356 (int)iomodel->gridoniceshelf[i], 357 (int)iomodel->gridonicesheet[i]); 358 356 359 if (isnan(iomodel->uppernodes[i])){ 357 360 node_upper_node_id=node_id; //nodes on surface do not have upper nodes, only themselves. … … 362 365 363 366 /*Create node using its constructor: */ 364 node=new Node(node_id, node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);367 node=new Node(node_id,vertex_id, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 365 368 366 369 /*Add node to nodes dataset: */ … … 376 379 elements->Presort(); 377 380 nodes->Presort(); 381 vertices->Presort(); 378 382 materials->Presort(); 379 383 … … 409 413 *pelements=elements; 410 414 *pnodes=nodes; 415 *pvertices=vertices; 411 416 *pmaterials=materials; 412 417 -
issm/trunk/src/c/ModelProcessorx/IoModel.cpp
r3359 r3417 46 46 iomodel->qmu_npart=0; 47 47 iomodel->numberofelements=0; 48 iomodel->numberof nodes=0;48 iomodel->numberofvertices=0; 49 49 iomodel->x=NULL; 50 50 iomodel->y=NULL; … … 52 52 iomodel->elements=NULL; 53 53 iomodel->elements_type=NULL; 54 iomodel->numberof nodes2d=0;54 iomodel->numberofvertices2d=0; 55 55 iomodel->elements2d=NULL; 56 56 iomodel->deadgrids=NULL; … … 180 180 iomodel->isstokes=0; 181 181 182 183 iomodel->epart=NULL; 184 iomodel->npart=NULL; 185 iomodel->my_grids=NULL; 186 iomodel->my_bordergrids=NULL; 182 /*exterior data: */ 183 iomodel->my_elements=NULL; 184 iomodel->my_vertices=NULL; 185 iomodel->my_nodes=NULL; 186 iomodel->my_bordervertices=NULL; 187 iomodel->penaltypartitioning=NULL; 187 188 188 189 return iomodel; … … 276 277 xfree((void**)&iomodel->control_type); 277 278 278 xfree((void**)&iomodel->epart); 279 xfree((void**)&iomodel->npart); 280 xfree((void**)&iomodel->my_grids); 281 xfree((void**)&iomodel->my_bordergrids); 282 279 /*exterior data: */ 280 xfree((void**)&iomodel->my_elements); 281 xfree((void**)&iomodel->my_vertices); 282 xfree((void**)&iomodel->my_nodes); 283 xfree((void**)&iomodel->my_bordervertices); 284 xfree((void**)&iomodel->penaltypartitioning); 285 283 286 /*!Delete entire structure: */ 284 287 xfree((void**)piomodel); … … 309 312 IoModelFetchData(&iomodel->control_analysis,iomodel_handle,"control_analysis"); 310 313 IoModelFetchData(&iomodel->meshtype,iomodel_handle,"type"); 311 /*!Get numberofelements and numberof nodes: */312 IoModelFetchData(&iomodel->numberof nodes,iomodel_handle,"numberofgrids");314 /*!Get numberofelements and numberofvertices: */ 315 IoModelFetchData(&iomodel->numberofvertices,iomodel_handle,"numberofgrids"); 313 316 IoModelFetchData(&iomodel->numberofelements,iomodel_handle,"numberofelements"); 314 317 /*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */ … … 317 320 /*!Deal with 2d mesh: */ 318 321 IoModelFetchData(&iomodel->numberofelements2d,iomodel_handle,"numberofelements2d"); 319 IoModelFetchData(&iomodel->numberof nodes2d,iomodel_handle,"numberofgrids2d");322 IoModelFetchData(&iomodel->numberofvertices2d,iomodel_handle,"numberofgrids2d"); 320 323 IoModelFetchData(&iomodel->numlayers,iomodel_handle,"numlayers"); 321 324 } -
issm/trunk/src/c/ModelProcessorx/IoModel.h
r3359 r3417 28 28 /*2d mesh: */ 29 29 int numberofelements; 30 int numberof nodes;30 int numberofvertices; 31 31 double* x; 32 32 double* y; … … 36 36 37 37 /*3d mesh: */ 38 int numberof nodes2d;38 int numberofvertices2d; 39 39 int numberofelements2d; 40 40 double* elements2d; … … 176 176 int numoutput; 177 177 178 /*exterior data: */179 int* epart; /*!element partitioning.*/180 int* npart; /*!node partitioning.*/181 int* my_grids; /*! grids that belong to this cpu*/182 double* my_border grids; /*! grids that belong to this cpu, and some other cpu also*/178 /*exterior partitioning data, to be carried around: */ 179 bool* my_elements; 180 bool* my_vertices; 181 bool* my_nodes; 182 double* my_bordervertices; 183 183 int* penaltypartitioning; 184 184 … … 197 197 198 198 /*Creation of fem datasets: general drivers*/ 199 void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** p materials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);199 void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 200 200 void CreateParameters(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 201 201 … … 204 204 205 205 /*diagnostic horizontal*/ 206 void CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);206 void CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 207 207 void CreateConstraintsDiagnosticHoriz(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 208 208 void CreateLoadsDiagnosticHoriz(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); … … 210 210 211 211 /*diagnostic vertical*/ 212 void CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);212 void CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 213 213 void CreateConstraintsDiagnosticVert(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 214 214 void CreateLoadsDiagnosticVert(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 215 215 216 216 /*diagnostic hutter*/ 217 void CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);217 void CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 218 218 void CreateConstraintsDiagnosticHutter(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 219 219 void CreateLoadsDiagnosticHutter(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 220 220 221 221 /*diagnostic stokes*/ 222 void CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);222 void CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 223 223 void CreateConstraintsDiagnosticStokes(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 224 224 void CreateLoadsDiagnosticStokes(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 225 225 226 226 /*slope compute*/ 227 void CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);227 void CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 228 228 void CreateConstraintsSlopeCompute(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 229 229 void CreateLoadsSlopeCompute(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); … … 233 233 234 234 /*thermal:*/ 235 void CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);235 void CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 236 236 void CreateConstraintsThermal(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 237 237 void CreateLoadsThermal(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); … … 239 239 240 240 /*melting:*/ 241 void CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);241 void CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 242 242 void CreateConstraintsMelting(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 243 243 void CreateLoadsMelting(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); … … 245 245 246 246 /*prognostic:*/ 247 void CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);247 void CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 248 248 void CreateConstraintsPrognostic(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 249 249 void CreateLoadsPrognostic(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); … … 251 251 252 252 /*prognostic2:*/ 253 void CreateElementsNodesAndMaterialsPrognostic2(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);253 void CreateElementsNodesAndMaterialsPrognostic2(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 254 254 void CreateConstraintsPrognostic2(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 255 255 void CreateLoadsPrognostic2(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); … … 257 257 258 258 /*balancedthickness:*/ 259 void CreateElementsNodesAndMaterialsBalancedthickness(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);259 void CreateElementsNodesAndMaterialsBalancedthickness(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 260 260 void CreateConstraintsBalancedthickness(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 261 261 void CreateLoadsBalancedthickness(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); … … 263 263 264 264 /*balancedvelocities:*/ 265 void CreateElementsNodesAndMaterialsBalancedvelocities(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle);265 void CreateElementsNodesAndMaterialsBalancedvelocities(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 266 266 void CreateConstraintsBalancedvelocities(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 267 267 void CreateLoadsBalancedvelocities(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); … … 271 271 void CreateParametersQmu(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 272 272 273 274 /*partitioning: */ 275 void Partitioning(bool** pmy_elements, bool** pmy_vertices, bool** pmy_nodes, double** pmy_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle); 276 273 277 #endif /* _IOMODEL_H */ -
issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp
r3383 r3417 13 13 14 14 15 void CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){15 void CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 16 16 17 17 … … 26 26 DataSet* elements = NULL; 27 27 DataSet* nodes = NULL; 28 DataSet* vertices = NULL; 28 29 DataSet* materials = NULL; 29 30 30 31 /*Objects: */ 31 32 Node* node = NULL; 33 Vertex* vertex = NULL; 32 34 Penta* penta = NULL; 33 35 Matice* matice = NULL; … … 88 90 /* node constructor input: */ 89 91 int node_id; 92 int vertex_id; 90 93 int node_partitionborder=0; 91 double node_x[3];92 double node_sigma;93 94 int node_onbed; 94 95 int node_onsurface; … … 113 114 elements = new DataSet(ElementsEnum()); 114 115 nodes = new DataSet(NodesEnum()); 116 vertices = new DataSet(VerticesEnum()); 115 117 materials = new DataSet(MaterialsEnum()); 116 118 … … 371 373 #endif 372 374 375 /*create vertex: */ 376 vertex_id=i+1; 377 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i])); 378 vertices->AddObject(vertex); 379 380 373 381 node_id=i+1; //matlab indexing 374 375 376 382 377 383 #ifdef _PARALLEL_ … … 386 392 #endif 387 393 388 node_x[0]=iomodel->x[i]; 389 node_x[1]=iomodel->y[i]; 390 node_x[2]=iomodel->z[i]; 391 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]); 392 393 node_onbed=(int)iomodel->gridonbed[i]; 394 node_onsurface=(int)iomodel->gridonsurface[i]; 395 node_onshelf=(int)iomodel->gridoniceshelf[i]; 396 node_onsheet=(int)iomodel->gridonicesheet[i]; 394 node_properties.SetProperties( 395 (int)iomodel->gridonbed[i], 396 (int)iomodel->gridonsurface[i], 397 (int)iomodel->gridoniceshelf[i], 398 (int)iomodel->gridonicesheet[i]); 397 399 398 400 if (strcmp(iomodel->meshtype,"3d")==0){ … … 410 412 411 413 /*Create node using its constructor: */ 412 node=new Node(node_id, node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);414 node=new Node(node_id,vertex_id, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 413 415 414 416 /*set single point constraints.: */ … … 430 432 elements->Presort(); 431 433 nodes->Presort(); 434 vertices->Presort(); 432 435 materials->Presort(); 433 436 … … 462 465 *pelements=elements; 463 466 *pnodes=nodes; 467 *pvertices=vertices; 464 468 *pmaterials=materials; 465 469 } -
issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp
r3383 r3417 14 14 15 15 16 void CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){16 void CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 17 17 18 18 … … 27 27 DataSet* elements = NULL; 28 28 DataSet* nodes = NULL; 29 DataSet* vertices = NULL; 29 30 DataSet* materials = NULL; 30 31 31 32 /*Objects: */ 32 33 Node* node = NULL; 34 Vertex* vertex = NULL; 33 35 Tria* tria = NULL; 34 36 Penta* penta = NULL; … … 97 99 /* node constructor input: */ 98 100 int node_id; 101 int vertex_id; 99 102 int node_partitionborder=0; 100 double node_x[3];101 double node_sigma;102 103 int node_onbed; 103 104 int node_onsurface; … … 122 123 elements = new DataSet(ElementsEnum()); 123 124 nodes = new DataSet(NodesEnum()); 125 vertices = new DataSet(VerticesEnum()); 124 126 materials = new DataSet(MaterialsEnum()); 125 127 … … 436 438 #endif 437 439 440 /*create vertex: */ 441 vertex_id=i+1; 442 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i])); 443 vertices->AddObject(vertex); 444 445 438 446 node_id=i+1; //matlab indexing 439 440 441 447 442 448 #ifdef _PARALLEL_ … … 451 457 #endif 452 458 453 node_x[0]=iomodel->x[i]; 454 node_x[1]=iomodel->y[i]; 455 node_x[2]=iomodel->z[i]; 456 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]); 457 458 node_onbed=(int)iomodel->gridonbed[i]; 459 node_onsurface=(int)iomodel->gridonsurface[i]; 460 node_onshelf=(int)iomodel->gridoniceshelf[i]; 461 node_onsheet=(int)iomodel->gridonicesheet[i]; 462 459 node_properties.SetProperties( 460 (int)iomodel->gridonbed[i], 461 (int)iomodel->gridonsurface[i], 462 (int)iomodel->gridoniceshelf[i], 463 (int)iomodel->gridonicesheet[i]); 464 465 463 466 if (strcmp(iomodel->meshtype,"3d")==0){ 464 467 if (isnan(iomodel->uppernodes[i])){ … … 475 478 476 479 /*Create node using its constructor: */ 477 node=new Node(node_id, node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);480 node=new Node(node_id,vertex_id, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 478 481 479 482 /*set single point constraints.: */ … … 498 501 elements->Presort(); 499 502 nodes->Presort(); 503 vertices->Presort(); 500 504 materials->Presort(); 501 505 … … 531 535 *pelements=elements; 532 536 *pnodes=nodes; 537 *pvertices=vertices; 533 538 *pmaterials=materials; 534 539 -
issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateElementsNodesAndMaterialsPrognostic2.cpp
r3383 r3417 13 13 #include "../IoModel.h" 14 14 15 void CreateElementsNodesAndMaterialsPrognostic2(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){15 void CreateElementsNodesAndMaterialsPrognostic2(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 16 16 17 17 int i,j,k,n; … … 22 22 DataSet* elements = NULL; 23 23 DataSet* nodes = NULL; 24 DataSet* vertices = NULL; 24 25 DataSet* materials = NULL; 25 26 26 27 /*Objects: */ 27 28 Node* node = NULL; 29 Vertex* vertex = NULL; 28 30 Tria* tria = NULL; 29 31 Penta* penta = NULL; … … 96 98 /* node constructor input: */ 97 99 int node_id; 100 int vertex_id; 101 int vertex_partitionborder=0; 98 102 int node_partitionborder=0; 99 double node_x[3];100 double node_sigma;101 103 int node_onbed; 102 104 int node_onsurface; … … 125 127 elements = new DataSet(ElementsEnum()); 126 128 nodes = new DataSet(NodesEnum()); 129 vertices = new DataSet(VerticesEnum()); 127 130 materials = new DataSet(MaterialsEnum()); 128 131 … … 349 352 DistributeNumDofs(&node_numdofs,iomodel->analysis_type,iomodel->sub_analysis_type); 350 353 354 /*Create vertices: */ 355 for (i=0;i<iomodel->numberofnodes;i++){ 356 #ifdef _PARALLEL_ 357 /*keep only this partition's nodes:*/ 358 if((my_grids[i]==1)){ 359 #endif 360 361 /*create vertex: */ 362 vertex_id=i+1; 363 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i])); 364 365 vertices->AddObject(vertex); 366 367 #ifdef _PARALLEL_ 368 } //if((my_grids[i]==1)) 369 #endif 370 } 371 351 372 /*Build Nodes dataset -> 3 for each element*/ 352 373 for (i=0;i<iomodel->numberofelements;i++){ … … 374 395 node_partitionborder=0; 375 396 #endif 376 node_x[0]=iomodel->x[k]; 377 node_x[1]=iomodel->y[k]; 378 node_x[2]=iomodel->z[k]; 379 node_sigma=(iomodel->z[k]-iomodel->bed[k])/(iomodel->thickness[k]); 380 node_onbed=(int)iomodel->gridonbed[k]; 381 node_onsurface=(int)iomodel->gridonsurface[k]; 382 node_onshelf=(int)iomodel->gridoniceshelf[k]; 383 node_onsheet=(int)iomodel->gridonicesheet[k]; 397 398 node_properties.SetProperties( 399 (int)iomodel->gridonbed[k], 400 (int)iomodel->gridonsurface[k], 401 (int)iomodel->gridoniceshelf[k], 402 (int)iomodel->gridonicesheet[k]); 403 384 404 if (strcmp(iomodel->meshtype,"3d")==0){ 385 405 if (isnan(iomodel->uppernodes[k])){ … … 396 416 397 417 /*Create node using its constructor: */ 398 node=new Node(node_id, node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);418 node=new Node(node_id, k, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 399 419 400 420 /*Add node to nodes dataset: */ … … 410 430 elements->Presort(); 411 431 nodes->Presort(); 432 vertices->Presort(); 412 433 materials->Presort(); 413 434 … … 443 464 *pelements=elements; 444 465 *pnodes=nodes; 466 *pvertices=vertices; 445 467 *pmaterials=materials; 446 468 } -
issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp
r3383 r3417 13 13 #include "../IoModel.h" 14 14 15 void CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){15 void CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 16 16 17 17 … … 26 26 DataSet* elements = NULL; 27 27 DataSet* nodes = NULL; 28 DataSet* vertices = NULL; 28 29 DataSet* materials = NULL; 29 30 30 31 /*Objects: */ 31 32 Node* node = NULL; 33 Vertex* vertex = NULL; 32 34 Tria* tria = NULL; 33 35 Penta* penta = NULL; … … 68 70 /* node constructor input: */ 69 71 int node_id; 72 int vertex_id; 70 73 int node_partitionborder=0; 71 double node_x[3];72 double node_sigma;73 74 int node_onbed; 74 75 int node_onsurface; … … 93 94 elements = new DataSet(ElementsEnum()); 94 95 nodes = new DataSet(NodesEnum()); 96 vertices = new DataSet(VerticesEnum()); 95 97 materials = new DataSet(MaterialsEnum()); 96 98 … … 372 374 #endif 373 375 376 /*create vertex: */ 377 vertex_id=i+1; 378 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i])); 379 vertices->AddObject(vertex); 380 381 374 382 node_id=i+1; //matlab indexing 375 376 377 383 378 384 #ifdef _PARALLEL_ … … 387 393 #endif 388 394 389 node_x[0]=iomodel->x[i]; 390 node_x[1]=iomodel->y[i]; 391 node_x[2]=iomodel->z[i]; 392 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]); 393 394 node_onbed=(int)iomodel->gridonbed[i]; 395 node_onsurface=(int)iomodel->gridonsurface[i]; 396 node_onshelf=(int)iomodel->gridoniceshelf[i]; 397 node_onsheet=(int)iomodel->gridonicesheet[i]; 395 node_properties.SetProperties( 396 (int)iomodel->gridonbed[i], 397 (int)iomodel->gridonsurface[i], 398 (int)iomodel->gridoniceshelf[i], 399 (int)iomodel->gridonicesheet[i]); 398 400 399 401 if (strcmp(iomodel->meshtype,"3d")==0){ … … 411 413 412 414 /*Create node using its constructor: */ 413 node=new Node(node_id, node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);415 node=new Node(node_id,vertex_id, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 414 416 415 417 /*set single point constraints.: */ … … 434 436 elements->Presort(); 435 437 nodes->Presort(); 438 vertices->Presort(); 436 439 materials->Presort(); 437 440 … … 467 470 *pelements=elements; 468 471 *pnodes=nodes; 472 *pvertices=vertices; 469 473 *pmaterials=materials; 470 474 -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
r3383 r3417 12 12 #include "../IoModel.h" 13 13 14 void CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** p materials, IoModel* iomodel,ConstDataHandle iomodel_handle){14 void CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** pvertices,DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle){ 15 15 16 16 … … 25 25 DataSet* elements = NULL; 26 26 DataSet* nodes = NULL; 27 DataSet* vertices = NULL; 27 28 DataSet* materials = NULL; 28 29 29 30 /*Objects: */ 30 31 Node* node = NULL; 32 Vertex* vertex = NULL; 31 33 Penta* penta = NULL; 32 34 Matice* matice = NULL; … … 86 88 /* node constructor input: */ 87 89 int node_id; 90 int vertex_id; 88 91 int node_partitionborder=0; 89 double node_x[3];90 double node_sigma;91 92 int node_onbed; 92 93 int node_onsurface; … … 111 112 elements = new DataSet(ElementsEnum()); 112 113 nodes = new DataSet(NodesEnum()); 114 vertices = new DataSet(VerticesEnum()); 113 115 materials = new DataSet(MaterialsEnum()); 114 116 … … 369 371 #endif 370 372 373 /*create vertex: */ 374 vertex_id=i+1; 375 vertex=new Vertex(vertex_id, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i])); 376 vertices->AddObject(vertex); 377 378 371 379 node_id=i+1; //matlab indexing 372 380 … … 382 390 #endif 383 391 384 node_x[0]=iomodel->x[i]; 385 node_x[1]=iomodel->y[i]; 386 node_x[2]=iomodel->z[i]; 387 node_sigma=(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]); 388 389 node_onbed=(int)iomodel->gridonbed[i]; 390 node_onsurface=(int)iomodel->gridonsurface[i]; 391 node_onshelf=(int)iomodel->gridoniceshelf[i]; 392 node_onsheet=(int)iomodel->gridonicesheet[i]; 392 node_properties.SetProperties( 393 (int)iomodel->gridonbed[i], 394 (int)iomodel->gridonsurface[i], 395 (int)iomodel->gridoniceshelf[i], 396 (int)iomodel->gridonicesheet[i]); 397 393 398 394 399 if (strcmp(iomodel->meshtype,"3d")==0){ … … 406 411 407 412 /*Create node using its constructor: */ 408 node=new Node(node_id, node_partitionborder,node_numdofs,node_x,node_sigma,node_onbed,node_onsurface,node_upper_node_id,node_onshelf,node_onsheet);413 node=new Node(node_id,vertex_id, node_upper_node_id, node_partitionborder,node_numdofs, &node_properties); 409 414 410 415 /*Add node to nodes dataset: */ … … 420 425 elements->Presort(); 421 426 nodes->Presort(); 427 vertices->Presort(); 422 428 materials->Presort(); 423 429 … … 440 446 *pelements=elements; 441 447 *pnodes=nodes; 448 *pvertices=vertices; 442 449 *pmaterials=materials; 443 450 -
issm/trunk/src/c/objects/ElementProperties.cpp
r3396 r3417 96 96 } 97 97 /*}}}*/ 98 /*FUNCTION ElementProperties copy constructor{{{1*/ 99 ElementProperties::ElementProperties(ElementProperties* prop){ //copy constructor 100 98 /*FUNCTION ElementProperties constructor {{{1*/ 99 100 ElementProperties::ElementProperties(int elementproperties_numnodes, double* elementproperties_h,double* elementproperties_s,double* elementproperties_b, 101 double* elementproperties_k,double* elementproperties_melting,double* elementproperties_accumulation, 102 double* elementproperties_geothermalflux, int elementproperties_friction_type,double elementproperties_p, 103 double elementproperties_q, int elementproperties_shelf, int elementproperties_onbed, bool elementproperties_onwater, 104 int elementproperties_onsurface, int elementproperties_collapse, int elementproperties_thermal_steadystate){ 105 106 this->Init(elementproperties_numnodes, elementproperties_h,elementproperties_s,elementproperties_b, 107 elementproperties_k,elementproperties_melting,elementproperties_accumulation, 108 elementproperties_geothermalflux, elementproperties_friction_type,elementproperties_p, 109 elementproperties_q, elementproperties_shelf, elementproperties_onbed, elementproperties_onwater, 110 elementproperties_onsurface, elementproperties_collapse, elementproperties_thermal_steadystate); 111 } 112 /*}}}*/ 113 /*FUNCTION ElementProperties Initialize propreties, used by constructor{{{1*/ 114 ElementProperties::Init(int elementproperties_numnodes, double* elementproperties_h,double* elementproperties_s,double* elementproperties_b, 115 double* elementproperties_k,double* elementproperties_melting,double* elementproperties_accumulation, 116 double* elementproperties_geothermalflux, int elementproperties_friction_type,double elementproperties_p, 117 double elementproperties_q, int elementproperties_shelf, int elementproperties_onbed, bool elementproperties_onwater, 118 int elementproperties_onsurface, int elementproperties_collapse, int elementproperties_thermal_steadystate){ 119 101 120 int i; 102 121 -
issm/trunk/src/c/objects/ElementProperties.h
r3390 r3417 33 33 ElementProperties(); 34 34 ElementProperties(int numnodes, double* h, double* s, double* b, double* k, double* melting, double* accumulation, double* geothermalflux, int friction_type, double p, double q, int shelf, int onbed, bool onwater, int onsurface, int collapse, int thermal_steadystate); 35 Init(int numnodes, double* h, double* s, double* b, double* k, double* melting, double* accumulation, double* geothermalflux, int friction_type, double p, double q, int shelf, int onbed, bool onwater, int onsurface, int collapse, int thermal_steadystate); 35 36 ElementProperties(ElementProperties* properties); 36 37 ~ElementProperties(); -
issm/trunk/src/c/objects/FemModel.cpp
r3332 r3417 9 9 #endif 10 10 11 #include "./FemModel.h"12 11 #include "stdio.h" 13 12 #include "../shared/shared.h" 14 13 #include "../include/macros.h" 15 14 #include "./FemModel.h" 15 16 /*Object constructors, destructors: {{{1:*/ 16 17 FemModel::FemModel(){ 17 18 18 19 elements=NULL; 19 20 nodes=NULL; 21 vertices=NULL; 20 22 constraints=NULL; 21 23 loads=NULL; … … 34 36 } 35 37 36 FemModel::FemModel(DataSet* femmodel_elements,DataSet* femmodel_nodes,DataSet* femmodel_ constraints,DataSet* femmodel_loads,38 FemModel::FemModel(DataSet* femmodel_elements,DataSet* femmodel_nodes,DataSet* femmodel_vertices, DataSet* femmodel_constraints,DataSet* femmodel_loads, 37 39 DataSet* femmodel_materials,DataSet* femmodel_parameters, DofVec* femmodel_partition,DofVec* femmodel_tpartition,DofVec* femmodel_yg, 38 40 Mat femmodel_Rmg,Mat femmodel_Gmn,NodeSets* femmodel_nodesets,Vec femmodel_ys,Vec femmodel_ys0){ … … 41 43 elements=femmodel_elements; 42 44 nodes=femmodel_nodes; 45 vertices=femmodel_vertices; 43 46 constraints=femmodel_constraints; 44 47 loads=femmodel_loads; … … 61 64 delete elements; 62 65 delete nodes; 66 delete vertices; 63 67 delete loads; 64 68 delete constraints; … … 76 80 77 81 } 78 79 82 /*}}}*/ 83 /* Object management: {{{1*/ 80 84 void FemModel::Echo(void){ 81 85 … … 83 87 printf(" elements: %p\n",elements); 84 88 printf(" nodes: %p\n",nodes); 89 printf(" vertices: %p\n",vertices); 85 90 printf(" loads: %p\n",loads); 86 91 printf(" materials: %p\n",materials); … … 105 110 printf(" nodes: \n"); 106 111 nodes->Echo(); 112 printf(" vertices: \n"); 113 vertices->Echo(); 107 114 printf(" loads: \n"); 108 115 nodes->Echo(); … … 204 211 DataSet* FemModel::get_elements(void){return elements;} 205 212 DataSet* FemModel::get_nodes(void){return nodes ;} 213 DataSet* FemModel::get_vertices(void){return vertices ;} 206 214 DataSet* FemModel::get_constraints(void){return constraints ;} 207 215 DataSet* FemModel::get_loads(void){return loads;} … … 216 224 Vec FemModel::get_ys0(void){return ys0;} 217 225 Mat FemModel::get_Gmn(void){return Gmn;} 226 /*}}}*/ -
issm/trunk/src/c/objects/FemModel.h
r2333 r3417 6 6 #define FEMMODEL_H_ 7 7 8 #include "./Object.h" 9 #include "../DataSet/DataSet.h" 10 #include "./DofVec.h" 8 11 #include "../toolkits/toolkits.h" 9 #include "../DataSet/DataSet.h"10 12 #include "../parallel/parallel.h" 11 #include "./DofVec.h"12 13 class DataSet;14 struct OptArgs;15 13 16 14 class FemModel: public Object{ … … 22 20 DataSet* elements; 23 21 DataSet* nodes; 22 DataSet* vertices; 24 23 DataSet* constraints; 25 24 DataSet* loads; … … 27 26 DataSet* parameters; 28 27 29 DofVec* partition; 30 DofVec* tpartition; 31 DofVec* yg; 28 DofVec* partition; 29 DofVec* tpartition; 30 DofVec* yg; 31 32 32 Mat Rmg; 33 33 NodeSets* nodesets; … … 38 38 FemModel(); 39 39 ~FemModel(); 40 FemModel(DataSet* elements,DataSet* nodes,DataSet* constraints,DataSet* loads,DataSet* materials,DataSet* parameters,40 FemModel(DataSet* elements,DataSet* nodes,DataSet* vertices, DataSet* constraints,DataSet* loads,DataSet* materials,DataSet* parameters, 41 41 DofVec* partition,DofVec* tpartition,DofVec* yg,Mat Rmg,Mat Gmn,NodeSets* nodesets,Vec ys,Vec ys0); 42 42 … … 62 62 DataSet* get_elements(void); 63 63 DataSet* get_nodes(void); 64 DataSet* get_vertices(void){return vertices ;} 64 65 DataSet* get_constraints(void); 65 66 DataSet* get_loads(void); … … 75 76 Mat get_Gmn(void); 76 77 77 78 79 80 78 }; 81 79 -
issm/trunk/src/c/objects/Hook.cpp
r3399 r3417 12 12 #include "stdio.h" 13 13 #include <string.h> 14 #include "./Object.h" 15 #include "../DataSet/DataSet.h" 16 #include "./Hook.h" 14 17 #include "../EnumDefinitions/EnumDefinitions.h" 15 18 #include "./ParameterInputs.h" … … 17 20 #include "../include/typedefs.h" 18 21 #include "../include/macros.h" 19 #include "./Hook.h"20 22 21 23 … … 31 33 /*}}}*/ 32 34 /*FUNCTION Hook::Hook(int* ids, int num){{{1*/ 33 Hook::Hook(int* ids, int num){ 34 35 int i; 36 this->num=num; 35 Hook::Hook(int* in_ids, int in_num){ 36 this->Init(in_ids,in_num); 37 } 38 /*}}}*/ 39 /*FUNCTION Hook::Init(int* ids, int num){{{1*/ 40 Hook::Init(int* in_ids, int in_num){ 41 42 int i; 43 this->num=in_num; 37 44 38 45 /*Allocate: */ … … 43 50 /*Copy ids: */ 44 51 for (i=0;i<this->num;i++){ 45 this->ids[i]=i ds[i];52 this->ids[i]=in_ids[i]; 46 53 this->objects[i]=NULL; 47 54 this->offsets[i]=0; -
issm/trunk/src/c/objects/Hook.h
r3383 r3417 10 10 11 11 #include "./Object.h" 12 #include ". /../DataSet/DataSet.h"12 #include "../DataSet/DataSet.h" 13 13 #include "../toolkits/toolkits.h" 14 14 15 15 class DataSet; 16 class Object;17 18 16 class Hook{ 19 17 … … 29 27 Hook(); 30 28 Hook(int* ids, int num); 29 Init(int* ids, int num); 31 30 Hook(Object** objects, int* ids, int* offsets,int num); 32 31 Hook(Hook* hook); -
issm/trunk/src/c/objects/Matice.cpp
r3332 r3417 17 17 18 18 /*Object constructors and destructor*/ 19 /*FUNCTION Matice::default constructor {{{1*/ 20 Matice::Matice(){ 21 return; 22 } 23 /*}}}*/ 19 24 /*FUNCTION Matice::constructor {{{1*/ 20 Matice::Matice(){ 21 return; 22 } 23 /*}}}*/ 24 /*FUNCTION Matice::creation {{{1*/ 25 Matice::Matice(int matice_mid,double matice_B,double matice_n){ 26 mid=matice_mid; 27 B=matice_B; 28 n=matice_n; 29 return; 25 Matice::Matice(int in_mid,double in_B,double in_n){ 26 this->Init(in_mid,in_B,in_n); 27 } 28 /*}}}*/ 29 /*FUNCTION Matice::init {{{1*/ 30 Matice::Init(int in_mid,double in_B,double in_n){ 31 this->mid=in_mid; 32 this->B=in_B; 33 this->n=in_n; 34 } 35 /*}}}*/ 36 /*FUNCTION Matice::constructor from iomodel {{{1*/ 37 Matice::Matice(int i, IoModel* iomodel, int num_vertices){ 38 39 int j; 40 41 /*needed for Init routine:*/ 42 int matice_mid; 43 double matice_B; 44 double matice_n; 45 46 /*intermediary: */ 47 double B_avg; 48 49 /*id: */ 50 matice_mid=i+1; //same as element it is created for 51 52 /*B and n: */ 53 B_avg=0; 54 for(j=0;j<num_vertices;j++){ 55 B_avg+=*(iomodel->B+((int)*(iomodel->elements+num_vertices*i+j)-1)); 56 } 57 B_avg=B_avg/num_vertices; 58 59 matice_B=B_avg; 60 matice_n=(double)*(iomodel->n+i); 61 62 this->Init(matice_mid,matice_B,matice_n); 30 63 } 31 64 /*}}}*/ -
issm/trunk/src/c/objects/Matice.h
r1051 r3417 19 19 Matice(); 20 20 Matice(int mid,double B,double n); 21 Matice(int i, IoModel* iomodel, int num_vertices); 22 Init(int mid,double B,double n); 21 23 ~Matice(); 22 24 -
issm/trunk/src/c/objects/Matpar.cpp
r3332 r3417 18 18 19 19 /*Object constructors and destructor*/ 20 /*FUNCTION Matpar:: constructor {{{1*/20 /*FUNCTION Matpar::default constructor {{{1*/ 21 21 Matpar::Matpar(){ 22 22 return; 23 23 } 24 24 /*}}}1*/ 25 /*FUNCTION Matpar::c reation{{{1*/25 /*FUNCTION Matpar::constructorr {{{1*/ 26 26 Matpar::Matpar(int matpar_mid, double matpar_rho_ice, double matpar_rho_water, double matpar_heatcapacity, double matpar_thermalconductivity, double matpar_latentheat, double matpar_beta, double matpar_meltingpoint, double matpar_mixed_layer_capacity, double matpar_thermal_exchange_velocity, double matpar_g){ 27 27 28 29 mid=matpar_mid; 30 rho_ice=matpar_rho_ice; 31 rho_water=matpar_rho_water; 32 heatcapacity=matpar_heatcapacity; 33 thermalconductivity=matpar_thermalconductivity; 34 latentheat=matpar_latentheat; 35 beta=matpar_beta; 36 meltingpoint=matpar_meltingpoint; 37 mixed_layer_capacity=matpar_mixed_layer_capacity; 38 thermal_exchange_velocity=matpar_thermal_exchange_velocity; 39 g=matpar_g; 28 this->Init(matpar_mid, matpar_rho_ice, matpar_rho_water, matpar_heatcapacity, matpar_thermalconductivity, matpar_latentheat, matpar_beta, matpar_meltingpoint, matpar_mixed_layer_capacity, matpar_thermal_exchange_velocity, matpar_g); 29 30 } 31 /*}}}1*/ 32 /*FUNCTION Matpar::constructor from iomodel{{{1*/ 33 Matpar::Matpar(IoModel* iomodel){ 34 35 int matpar_mid; 36 double matpar_rho_ice; 37 double matpar_rho_water; 38 double matpar_heatcapacity; 39 double matpar_thermalconductivity; 40 double matpar_latentheat; 41 double matpar_beta; 42 double matpar_meltingpoint; 43 double matpar_mixed_layer_capacity; 44 double matpar_thermal_exchange_velocity; 45 double matpar_g; 46 47 matpar_mid=iomodel->numberofelements+1; //put it at the end of the materials 48 matpar_g=iomodel->g; 49 matpar_rho_ice=iomodel->rho_ice; 50 matpar_rho_water=iomodel->rho_water; 51 matpar_thermalconductivity=iomodel->thermalconductivity; 52 matpar_heatcapacity=iomodel->heatcapacity; 53 matpar_latentheat=iomodel->latentheat; 54 matpar_beta=iomodel->beta; 55 matpar_meltingpoint=iomodel->meltingpoint; 56 matpar_mixed_layer_capacity=iomodel->mixed_layer_capacity; 57 matpar_thermal_exchange_velocity=iomodel->thermal_exchange_velocity; 58 59 this->Init(matpar_mid, matpar_rho_ice, matpar_rho_water, matpar_heatcapacity, matpar_thermalconductivity, matpar_latentheat, matpar_beta, matpar_meltingpoint, matpar_mixed_layer_capacity, matpar_thermal_exchange_velocity, matpar_g); 60 61 } 62 /*}}}1*/ 63 /*FUNCTION Matpar::Init {{{1*/ 64 Matpar::Init(int matpar_mid, double matpar_rho_ice, double matpar_rho_water, double matpar_heatcapacity, double matpar_thermalconductivity, double matpar_latentheat, double matpar_beta, double matpar_meltingpoint, double matpar_mixed_layer_capacity, double matpar_thermal_exchange_velocity, double matpar_g){ 65 66 this->mid=matpar_mid; 67 this->rho_ice=matpar_rho_ice; 68 this->rho_water=matpar_rho_water; 69 this->heatcapacity=matpar_heatcapacity; 70 this->thermalconductivity=matpar_thermalconductivity; 71 this->latentheat=matpar_latentheat; 72 this->beta=matpar_beta; 73 this->meltingpoint=matpar_meltingpoint; 74 this->mixed_layer_capacity=matpar_mixed_layer_capacity; 75 this->thermal_exchange_velocity=matpar_thermal_exchange_velocity; 76 this->g=matpar_g; 40 77 41 78 return; -
issm/trunk/src/c/objects/Matpar.h
r803 r3417 28 28 29 29 Matpar(int mid, double rho_ice, double rho_water, double heatcapacity, double thermalconductivity, double latentheat, double beta, double meltingpoint, double mixed_layer_capacity, double thermal_exchange_velocity, double g); 30 Init(int mid, double rho_ice, double rho_water, double heatcapacity, double thermalconductivity, double latentheat, double beta, double meltingpoint, double mixed_layer_capacity, double thermal_exchange_velocity, double g); 31 Matpar(IoModel* iomodel); 30 32 31 33 ~Matpar(); -
issm/trunk/src/c/objects/Model.cpp
r3332 r3417 43 43 DataSet* elements=NULL; 44 44 DataSet* nodes=NULL; 45 DataSet* vertices=NULL; 45 46 DataSet* constraints=NULL; 46 47 DataSet* loads=NULL; … … 71 72 72 73 _printf_(" create datasets:\n"); 73 CreateDataSets(&elements,&nodes,& materials,&constraints,&loads,¶meters,iomodel,MODEL);74 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,¶meters,iomodel,MODEL); 74 75 75 76 _printf_(" create degrees of freedom: \n"); 76 Dofx( &partition,&tpartition,elements,nodes, parameters);77 Dofx( &partition,&tpartition,elements,nodes, vertices,parameters); 77 78 78 79 _printf_(" create single point constraints: \n"); … … 92 93 93 94 _printf_(" configuring element and loads:\n"); 94 ConfigureObjectsx(elements, loads, nodes, materials,parameters);95 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 95 96 96 97 _printf_(" process parameters:\n"); … … 101 102 102 103 /*Use all the data created to create an femmodel: */ 103 femmodel=new FemModel(elements, nodes,constraints,loads,materials,parameters,104 femmodel=new FemModel(elements, nodes, vertices, constraints,loads,materials,parameters, 104 105 partition,tpartition,yg,Rmg,Gmn,nodesets,ys,ys0); 105 106 … … 116 117 DataSet* elements=NULL; 117 118 DataSet* nodes=NULL; 119 DataSet* vertices=NULL; 118 120 DataSet* constraints=NULL; 119 121 DataSet* loads=NULL; … … 148 150 149 151 _printf_(" create datasets:\n"); 150 CreateDataSets(&elements,&nodes,& materials,&constraints,&loads,¶meters,iomodel,MODEL);152 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,¶meters,iomodel,MODEL); 151 153 152 154 _printf_(" create degrees of freedom: \n"); 153 Dofx( &partition,&tpartition,elements,nodes, parameters);155 Dofx( &partition,&tpartition,elements,nodes, vertices,parameters); 154 156 155 157 _printf_(" create single point constraints: \n"); … … 169 171 170 172 _printf_(" configuring element and loads:\n"); 171 ConfigureObjectsx(elements, loads, nodes, materials,parameters);173 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 172 174 173 175 _printf_(" process parameters:\n"); … … 178 180 179 181 /*Use all the data created to create an femmodel: */ 180 femmodel=new FemModel(elements,nodes, constraints,loads,materials,parameters,182 femmodel=new FemModel(elements,nodes,vertices, constraints,loads,materials,parameters, 181 183 partition,tpartition,yg,Rmg,Gmn,nodesets,ys,ys0); 182 184 -
issm/trunk/src/c/objects/Node.cpp
r3392 r3417 3 3 */ 4 4 5 5 /*Include files: {{{1*/ 6 6 #ifdef HAVE_CONFIG_H 7 7 #include "config.h" … … 11 11 12 12 #include "stdio.h" 13 #include "./Vertex.h" 13 14 #include "./Node.h" 15 #include "./Hook.h" 16 #include "./DofIndexing.h" 14 17 #include <string.h> 15 18 #include "../EnumDefinitions/EnumDefinitions.h" … … 18 21 #include "../include/typedefs.h" 19 22 #include "../include/macros.h" 20 21 /*Object constructors and destructor */22 /*FUNCTION Node constructor {{{1*/23 /*}}}*/ 24 /*Object constructors and destructors: {{{1*/ 25 /*FUNCTION Node default constructor {{{2*/ 23 26 Node::Node(){ 24 27 return; 25 28 } 26 29 /*}}}*/ 27 /*FUNCTION Node constructor {{{1*/ 28 Node::Node(int node_id,int node_partitionborder,int node_numdofs, double node_x[3],double node_sigma,int node_onbed,int node_onsurface,int node_upper_node_id,int node_onshelf,int node_onsheet){ 29 30 int i; 31 32 id=node_id; 33 partitionborder=node_partitionborder; 34 numberofdofs=node_numdofs; 35 x[0]=node_x[0]; 36 x[1]=node_x[1]; 37 x[2]=node_x[2]; 38 sigma=node_sigma; 39 onbed=node_onbed; 40 onsurface=node_onsurface; 41 onshelf=node_onshelf; 42 onsheet=node_onsheet; 43 44 /*Initialize sets: */ 45 for(i=0;i<numberofdofs;i++){ 46 mset[i]=0; 47 nset[i]=1; 48 fset[i]=1; //we assume new nodes are not constrained in rigid body mode, or single point constraint mode. 49 sset[i]=0; 50 } 51 52 /*Initialize upper node:*/ 53 upper_node_id=node_upper_node_id; 54 upper_node=NULL; 55 upper_node_offset=UNDEF; 30 /*FUNCTION Node constructor {{{2*/ 31 Node::Node(int node_id,int node_vertex_id, int node_upper_node_id, int node_partitionborder,int node_numdofs, NodeProperties* node_properties): 32 indexing(node_numdofs,node_partitionborder), 33 properties(node_properties), 34 hvertex(&node_vertex_id,1), 35 hupper_node(&node_upper_node_id,1){ 36 37 this->id=node_id; 56 38 57 39 return; 58 40 } 59 41 /*}}}*/ 60 /*FUNCTION Node destructor{{{1*/ 42 /*FUNCTION Node other constructor {{{2*/ 43 Node::Node(int node_id,DofIndexing* node_indexing, NodeProperties* node_properties, Hook* node_vertex, Hook* node_upper_node): 44 indexing(node_indexing), 45 properties(node_properties), 46 hvertex(node_vertex), 47 hupper_node(node_upper_node) { 48 49 /*all the initialization has been done by the initializer, just fill in the id: */ 50 this->id=node_id; 51 52 } 53 /*}}}*/ 54 /*FUNCTION Node constructor from iomodel{{{2*/ 55 Node::Node(int i, IoModel* iomodel){ //i is the node index 56 57 int k; 58 59 int numdofs; 60 int partitionborder; 61 int vertex_id; 62 63 64 /*id: */ 65 this->id=i+1; //matlab indexing 66 67 /*indexing:*/ 68 DistributeNumDofs(&numdofs,iomodel->analysis_type,iomodel->sub_analysis_type); //number of dofs per node 69 if(my_bordervertices[i])partitionborder=1; else partitionborder=0;//is this node on a partition border? 70 71 this->indexing.Init(numdofs,partitionborder); 72 73 /*properties: */ 74 this->properties.Init( 75 (int)iomodel->gridonbed[i], 76 (int)iomodel->gridonsurface[i], 77 (int)iomodel->gridoniceshelf[i], 78 (int)iomodel->gridonicesheet[i]); 79 80 /*hooks: */ 81 vertex_id=this->id; //node and vertex have the same id, as we are running galerkin continuous, with same number of nodes and vertices. 82 83 if (strcmp(iomodel->meshtype,"3d")==0){ 84 if (isnan(iomodel->uppernodes[i])){ 85 upper_node_id=this->id; //nodes on surface do not have upper nodes, only themselves. 86 } 87 else{ 88 upper_node_id=(int)iomodel->uppernodes[i]; 89 } 90 } 91 else{ 92 /*If we are running 2d, upper_node does not mean much. Just point towards itself!:*/ 93 upper_node_id=this->id; 94 } 95 96 this->hvertex->Init(vertex_id,1); //node id is the same as the vertex id, continuous galerkin! 97 this->hupper_node->Init(upper_node_id,1); 98 99 100 /*set single point constraints.: */ 101 if (strcmp(iomodel->meshtype,"3d")==0){ 102 /*We have a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */ 103 if (iomodel->deadgrids[i]){ 104 for(k=1;k<=numdofs;k++){ 105 node->FreezeDof(k); 106 } 107 } 108 } 109 if (iomodel->gridonhutter[i]){ 110 for(k=1;k<=numdofs;k++){ 111 node->FreezeDof(k); 112 } 113 } 114 } 115 /*}}}*/ 116 /*FUNCTION Node destructor{{{2*/ 61 117 Node::~Node(){ 62 118 return; 63 119 } 64 120 /*}}}*/ 65 66 /*Object management*/ 67 /*FUNCTION Node Marshall{{{1*/ 68 void Node::Marshall(char** pmarshalled_dataset){ 121 /*}}}*/ 122 /*Object management: {{{1*/ 123 /*FUNCTION Node Configure {{{2*/ 124 void Node::Configure(void* pnodes, void* pvertices){ 125 126 int i; 127 128 DataSet* nodesin=NULL; 129 DataSet* verticesin=NULL; 130 131 /*Recover pointers :*/ 132 nodesin=(DataSet*)pnodes; 133 verticesin=(DataSet*)pvertices; 134 135 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 136 * datasets, using internal ids and ofthis->indexing.f_sets hidden in hooks: */ 137 hvertex.configure(verticesin); 138 hupper_node.configure(nodesin); 139 140 } 141 /*}}}*/ 142 /*FUNCTION Node copy {{{2*/ 143 Object* Node::copy() { 144 145 return new Node(this->id,&this->indexing, &this->properties, &this->hvertex,&this->hupper_node); 146 147 } 148 149 /*}}}*/ 150 /*FUNCTION Node DeepEcho{{{2*/ 151 void Node::DeepEcho(void){ 152 153 printf("Node:\n"); 154 printf(" id: %i\n",id); 155 indexing.DeepEcho(); 156 properties.DeepEcho(); 157 hvertex.DeepEcho(); 158 hupper_node.DeepEcho(); 159 160 } 161 /*}}}*/ 162 /*FUNCTION Node Demarshall{{{2*/ 163 void Node::Demarshall(char** pmarshalled_dataset){ 69 164 70 165 char* marshalled_dataset=NULL; 71 int enum_type=0;72 166 73 167 /*recover marshalled_dataset: */ 74 168 marshalled_dataset=*pmarshalled_dataset; 75 169 76 /*get enum type of Node: */77 enum_type=NodeEnum();78 79 /*marshall enum: */80 memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);81 82 /*marshall Node data: */83 memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);84 memcpy(marshalled_dataset,&partitionborder,sizeof(partitionborder));marshalled_dataset+=sizeof(partitionborder);85 memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);86 memcpy(marshalled_dataset,&numberofdofs,sizeof(numberofdofs));marshalled_dataset+=sizeof(numberofdofs);87 memcpy(marshalled_dataset,&x,sizeof(x));marshalled_dataset+=sizeof(x);88 memcpy(marshalled_dataset,&sigma,sizeof(sigma));marshalled_dataset+=sizeof(sigma);89 memcpy(marshalled_dataset,&onbed,sizeof(onbed));marshalled_dataset+=sizeof(onbed);90 memcpy(marshalled_dataset,&onsurface,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface);91 memcpy(marshalled_dataset,&onshelf,sizeof(onshelf));marshalled_dataset+=sizeof(onshelf);92 memcpy(marshalled_dataset,&onsheet,sizeof(onsheet));marshalled_dataset+=sizeof(onsheet);93 memcpy(marshalled_dataset,&doflist,sizeof(doflist));marshalled_dataset+=sizeof(doflist);94 memcpy(marshalled_dataset,&doflist1,sizeof(doflist1));marshalled_dataset+=sizeof(doflist1);95 memcpy(marshalled_dataset,&mset,sizeof(mset));marshalled_dataset+=sizeof(mset);96 memcpy(marshalled_dataset,&nset,sizeof(nset));marshalled_dataset+=sizeof(nset);97 memcpy(marshalled_dataset,&fset,sizeof(fset));marshalled_dataset+=sizeof(fset);98 memcpy(marshalled_dataset,&sset,sizeof(sset));marshalled_dataset+=sizeof(sset);99 memcpy(marshalled_dataset,&upper_node_id,sizeof(upper_node_id));marshalled_dataset+=sizeof(upper_node_id);100 memcpy(marshalled_dataset,&upper_node,sizeof(upper_node));marshalled_dataset+=sizeof(upper_node);101 memcpy(marshalled_dataset,&upper_node_offset,sizeof(upper_node_offset));marshalled_dataset+=sizeof(upper_node_offset);102 103 *pmarshalled_dataset=marshalled_dataset;104 return;105 }106 /*}}}*/107 /*FUNCTION Node MarshallSize{{{1*/108 int Node::MarshallSize(){109 110 return sizeof(id)+111 sizeof(partitionborder)+112 sizeof(clone)+113 sizeof(numberofdofs)+114 sizeof(x)+115 sizeof(sigma)+116 sizeof(onbed)+117 sizeof(onsurface)+118 sizeof(onshelf)+119 sizeof(onsheet)+120 sizeof(doflist)+121 sizeof(doflist1)+122 sizeof(mset)+123 sizeof(nset)+124 sizeof(fset)+125 sizeof(sset)+126 sizeof(upper_node_id)+127 sizeof(upper_node)+128 sizeof(upper_node_offset)+129 sizeof(int); //sizeof(int) for enum type130 }131 /*}}}*/132 /*FUNCTION Node Demarshall{{{1*/133 void Node::Demarshall(char** pmarshalled_dataset){134 135 char* marshalled_dataset=NULL;136 137 /*recover marshalled_dataset: */138 marshalled_dataset=*pmarshalled_dataset;139 140 170 /*this time, no need to get enum type, the pointer directly points to the beginning of the 141 171 *object data (thanks to DataSet::Demarshall):*/ 142 172 143 173 memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id); 144 memcpy(&partitionborder,marshalled_dataset,sizeof(partitionborder));marshalled_dataset+=sizeof(partitionborder); 145 memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone); 146 memcpy(&numberofdofs,marshalled_dataset,sizeof(numberofdofs));marshalled_dataset+=sizeof(numberofdofs); 147 memcpy(&x,marshalled_dataset,sizeof(x));marshalled_dataset+=sizeof(x); 148 memcpy(&sigma,marshalled_dataset,sizeof(sigma));marshalled_dataset+=sizeof(sigma); 149 memcpy(&onbed,marshalled_dataset,sizeof(onbed));marshalled_dataset+=sizeof(onbed); 150 memcpy(&onsurface,marshalled_dataset,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface); 151 memcpy(&onshelf,marshalled_dataset,sizeof(onshelf));marshalled_dataset+=sizeof(onshelf); 152 memcpy(&onsheet,marshalled_dataset,sizeof(onsheet));marshalled_dataset+=sizeof(onsheet); 153 memcpy(&doflist,marshalled_dataset,sizeof(doflist));marshalled_dataset+=sizeof(doflist); 154 memcpy(&doflist1,marshalled_dataset,sizeof(doflist1));marshalled_dataset+=sizeof(doflist1); 155 memcpy(&mset,marshalled_dataset,sizeof(mset));marshalled_dataset+=sizeof(mset); 156 memcpy(&nset,marshalled_dataset,sizeof(nset));marshalled_dataset+=sizeof(nset); 157 memcpy(&fset,marshalled_dataset,sizeof(fset));marshalled_dataset+=sizeof(fset); 158 memcpy(&sset,marshalled_dataset,sizeof(sset));marshalled_dataset+=sizeof(sset); 159 memcpy(&upper_node_id,marshalled_dataset,sizeof(upper_node_id));marshalled_dataset+=sizeof(upper_node_id); 160 memcpy(&upper_node,marshalled_dataset,sizeof(upper_node));marshalled_dataset+=sizeof(upper_node); 161 memcpy(&upper_node_offset,marshalled_dataset,sizeof(upper_node_offset));marshalled_dataset+=sizeof(upper_node_offset); 162 163 /*upper node is not pointing to correct object anymore: */ 164 upper_node=NULL; 165 174 175 /*demarshall objects: */ 176 indexing.Demarshall(&marshalled_dataset); 177 properties.Demarshall(&marshalled_dataset); 178 hvertex.Demarshall(&marshalled_dataset); 179 hupper_node.Demarshall(&marshalled_dataset); 180 166 181 /*return: */ 167 182 *pmarshalled_dataset=marshalled_dataset; … … 169 184 } 170 185 /*}}}*/ 171 /*FUNCTION Node GetId{{{1*/ 186 /*FUNCTION Node Echo{{{2*/ 187 void Node::Echo(void){ 188 189 printf("Node:\n"); 190 printf(" id: %i\n",id); 191 indexing.Echo(); 192 properties.Echo(); 193 hvertex.Echo(); 194 hupper_node.Echo(); 195 196 } 197 /*}}}*/ 198 /*FUNCTION Node Enum{{{2*/ 199 int Node::Enum(void){ 200 201 return NodeEnum(); 202 203 } 204 /*}}}*/ 205 /*FUNCTION Node GetId{{{2*/ 172 206 int Node::GetId(void){ return id; } 173 207 /*}}}*/ 174 /*FUNCTION Node GetName{{{ 1*/208 /*FUNCTION Node GetName{{{2*/ 175 209 char* Node::GetName(void){ 176 210 return "node"; 177 211 } 178 212 /*}}}*/ 179 180 /*Object functions*/ 181 /*FUNCTION Node ApplyConstraints{{{1*/ 213 /*FUNCTION Node GetVertexDof {{{2*/ 214 int Node::GetVertexDof(void){ 215 216 Vertex* vertex=NULL; 217 218 vertex=(Vertex*)hvertex.delivers(); 219 return vertex->dof; 220 } 221 /*}}}*/ 222 /*FUNCTION Node Marshall{{{2*/ 223 void Node::Marshall(char** pmarshalled_dataset){ 224 225 char* marshalled_dataset=NULL; 226 int enum_type=0; 227 228 /*recover marshalled_dataset: */ 229 marshalled_dataset=*pmarshalled_dataset; 230 231 /*get enum type of Node: */ 232 enum_type=NodeEnum(); 233 234 /*marshall enum: */ 235 memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type); 236 237 /*marshall Node data: */ 238 memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id); 239 240 /*marshall objects: */ 241 indexing.Marshall(&marshalled_dataset); 242 properties.Marshall(&marshalled_dataset); 243 hvertex.Marshall(&marshalled_dataset); 244 hupper_node.Marshall(&marshalled_dataset); 245 246 *pmarshalled_dataset=marshalled_dataset; 247 return; 248 } 249 /*}}}*/ 250 /*FUNCTION Node MarshallSize{{{2*/ 251 int Node::MarshallSize(){ 252 253 return sizeof(id)+ 254 +indexing.MarshallSize()+ 255 +properties.MarshallSize()+ 256 +hvertex.MarshallSize()+ 257 +hupper_node.MarshallSize()+ 258 sizeof(int); //sizeof(int) for enum type 259 } 260 /*}}}*/ 261 /*FUNCTION Node SetVertexDof {{{2*/ 262 void Node::SetVertexDof(int in_dof){ 263 264 Vertex* vertex=NULL; 265 266 vertex=(Vertex*)hvertex.delivers(); 267 vertex->dof=in_dof; 268 269 } 270 /*}}}*/ 271 /*}}}*/ 272 /*Object numerics: {{{1*/ 273 /*FUNCTION Node ApplyConstraints{{{2*/ 182 274 void Node::ApplyConstraint(Vec yg,int dof,double value){ 183 275 … … 192 284 * we are a clone!*/ 193 285 194 if(! clone){195 196 index= doflist[dof-1]; //matlab indexing286 if(!indexing.clone){ 287 288 index=indexing.doflist[dof-1]; //matlab indexing 197 289 198 290 VecSetValues(yg,1,&index,&value,INSERT_VALUES); … … 202 294 } 203 295 /*}}}*/ 204 /*FUNCTION Node Configure {{{1*/ 205 void Node::Configure(void* pnodes){ 206 207 DataSet* nodes=NULL; 208 209 /*Recover pointers :*/ 210 nodes=(DataSet*)pnodes; 211 212 /*Link this node with its upper node: */ 213 ResolvePointers((Object**)&upper_node,&upper_node_id,&upper_node_offset,1,nodes); 214 215 } 216 /*}}}*/ 217 /*FUNCTION Node copy {{{1*/ 218 Object* Node::copy() { 219 return new Node(*this); 220 } 221 /*}}}*/ 222 /*FUNCTION Node CreatePartition{{{1*/ 296 /*FUNCTION Node CreatePartition{{{2*/ 223 297 void Node::CreatePartition(Vec partition){ 224 298 … … 227 301 228 302 idxm=(id-1); 229 value=(double) doflist1[0];303 value=(double)this->GetVertexDof(); 230 304 ISSMASSERT(value>=0); 231 305 … … 235 309 } 236 310 /*}}}*/ 237 /*FUNCTION Node CreateVecSets {{{ 1*/311 /*FUNCTION Node CreateVecSets {{{2*/ 238 312 void Node::CreateVecSets(Vec pv_g,Vec pv_m,Vec pv_n,Vec pv_f,Vec pv_s){ 239 313 … … 243 317 int i; 244 318 245 for(i=0;i< numberofdofs;i++){319 for(i=0;i<this->indexing.numberofdofs;i++){ 246 320 247 321 /*g set: */ 248 VecSetValues(pv_g,1,& doflist[i],&gvalue,INSERT_VALUES);322 VecSetValues(pv_g,1,&indexing.doflist[i],&gvalue,INSERT_VALUES); 249 323 250 324 /*m set: */ 251 value=(double) mset[i];252 VecSetValues(pv_m,1,& doflist[i],&value,INSERT_VALUES);325 value=(double)this->indexing.m_set[i]; 326 VecSetValues(pv_m,1,&indexing.doflist[i],&value,INSERT_VALUES); 253 327 254 328 /*n set: */ 255 value=(double) nset[i];256 VecSetValues(pv_n,1,& doflist[i],&value,INSERT_VALUES);329 value=(double)this->indexing.n_set[i]; 330 VecSetValues(pv_n,1,&indexing.doflist[i],&value,INSERT_VALUES); 257 331 258 332 /*f set: */ 259 value=(double) fset[i];260 VecSetValues(pv_f,1,& doflist[i],&value,INSERT_VALUES);333 value=(double)this->indexing.f_set[i]; 334 VecSetValues(pv_f,1,&indexing.doflist[i],&value,INSERT_VALUES); 261 335 262 336 /*s set: */ 263 value=(double)sset[i]; 264 VecSetValues(pv_s,1,&doflist[i],&value,INSERT_VALUES); 265 266 } 267 268 269 } 270 /*}}}*/ 271 /*FUNCTION Node DeepEcho{{{1*/ 272 void Node::DeepEcho(void){ 273 274 int i; 275 276 printf("Node:\n"); 277 printf(" id: %i\n",id); 278 printf(" partitionborder: %i\n",partitionborder); 279 printf(" clone: %i\n",clone); 280 printf(" numberofdofs: %i\n",numberofdofs); 281 printf(" x=[%g,%g,%g]\n",x[0],x[1],x[2]); 282 printf(" sigma=%g\n",sigma); 283 printf(" onbed: %i\n",onbed); 284 printf(" onsurface: %i\n",onsurface); 285 printf(" onshelf: %i\n",onshelf); 286 printf(" onsheet: %i\n",onsheet); 287 printf(" upper_node_id=%i\n",upper_node_id); 288 printf(" upper_node_offset=%i\n",upper_node_offset); 289 printf(" doflist:|"); 290 for(i=0;i<numberofdofs;i++){ 291 if(i>MAXDOFSPERNODE)break; 292 printf("%i|",doflist[i]); 293 } 294 printf(" doflist1:|"); 295 printf("%i|",doflist1[0]); 296 printf("\n"); 297 298 printf(" set membership: m,n,f,s sets \n"); 299 for(i=0;i<numberofdofs;i++){ 300 if(i>MAXDOFSPERNODE)break; 301 printf(" dof %i: %i %i %i %i\n",i,mset[i],nset[i],fset[i],sset[i]); 302 } 303 printf("\n"); 304 if(upper_node)printf(" upper_node pointer: %p\n",upper_node); 305 306 return; 307 } 308 /*}}}*/ 309 /*FUNCTION Node DistributeDofs{{{1*/ 337 value=(double)this->indexing.s_set[i]; 338 VecSetValues(pv_s,1,&indexing.doflist[i],&value,INSERT_VALUES); 339 340 } 341 342 343 } 344 /*}}}*/ 345 /*FUNCTION Node DistributeDofs{{{2*/ 310 346 void Node::DistributeDofs(int* pdofcount,int* pdofcount1){ 311 347 … … 318 354 dofcount1=*pdofcount1; 319 355 320 if( clone){356 if(indexing.clone){ 321 357 /*This node is a clone! Don't distribute dofs, it will get them from another cpu!*/ 322 358 return; … … 324 360 325 361 /*This node should distribute dofs, go ahead: */ 326 for(i=0;i< numberofdofs;i++){327 doflist[i]=dofcount+i;328 } 329 dofcount+= numberofdofs;330 331 doflist1[0]=dofcount1;362 for(i=0;i<this->indexing.numberofdofs;i++){ 363 indexing.doflist[i]=dofcount+i; 364 } 365 dofcount+=this->indexing.numberofdofs; 366 367 SetVertexDof(dofcount1); 332 368 dofcount1+=1; 333 369 … … 339 375 } 340 376 /*}}}*/ 341 /*FUNCTION Node DofInMSet{{{ 1*/377 /*FUNCTION Node DofInMSet{{{2*/ 342 378 void Node::DofInMSet(int dof){ 343 379 344 380 /*Put dof for this node into the m set (m set is for rigid body modes)*/ 345 381 346 mset[dof]=1; //m and n are mutually exclusive (m for rigid body modes)347 nset[dof]=0;348 fset[dof]=0; //n splits into f (for which we solve) and s (single point constraints)349 sset[dof]=0;350 } 351 /*}}}*/ 352 /*FUNCTION Node DofInSSet {{{ 1*/382 this->indexing.m_set[dof]=1; //m and n are mutually exclusive (m for rigid body modes) 383 this->indexing.n_set[dof]=0; 384 this->indexing.f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints) 385 this->indexing.s_set[dof]=0; 386 } 387 /*}}}*/ 388 /*FUNCTION Node DofInSSet {{{2*/ 353 389 void Node::DofInSSet(int dof){ 354 390 … … 356 392 * to a fixed value during computations. */ 357 393 358 mset[dof]=0; //m and n are mutually exclusive (m for rigid body modes)359 nset[dof]=1;360 fset[dof]=0; //n splits into f (for which we solve) and s (single point constraints)361 sset[dof]=1;362 } 363 /*}}}*/ 364 /*FUNCTION Node DofIsInMSet{{{ 1*/394 this->indexing.m_set[dof]=0; //m and n are mutually exclusive (m for rigid body modes) 395 this->indexing.n_set[dof]=1; 396 this->indexing.f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints) 397 this->indexing.s_set[dof]=1; 398 } 399 /*}}}*/ 400 /*FUNCTION Node DofIsInMSet{{{2*/ 365 401 int Node::DofIsInMSet(int dof){ 366 402 367 if ( mset[dof])return 1;403 if (this->indexing.m_set[dof])return 1; 368 404 else return 0; 369 405 370 406 } 371 407 /*}}}*/ 372 /*FUNCTION Node Echo{{{1*/ 373 void Node::Echo(void){ 374 375 int i; 376 377 printf("Node:\n"); 378 printf(" id: %i\n",id); 379 printf(" partitionborder: %i\n",partitionborder); 380 printf(" clone: %i\n",clone); 381 printf(" numberofdofs: %i\n",numberofdofs); 382 printf(" x=[%g,%g,%g]\n",x[0],x[1],x[2]); 383 printf(" sigma=%g\n",sigma); 384 printf(" onbed: %i\n",onbed); 385 printf(" onsurface: %i\n",onsurface); 386 printf(" onshelf: %i\n",onshelf); 387 printf(" onsheet: %i\n",onsheet); 388 printf(" upper_node_id=%i\n",upper_node_id); 389 printf(" upper_node_offset=%i\n",upper_node_offset); 390 printf(" doflist:|"); 391 for(i=0;i<numberofdofs;i++){ 392 if(i>MAXDOFSPERNODE)break; 393 printf("%i|",doflist[i]); 394 } 395 printf(" doflist1:|"); 396 printf("%i|",doflist1[0]); 397 printf("\n"); 398 399 printf(" set membership: m,n,f,s sets \n"); 400 for(i=0;i<numberofdofs;i++){ 401 if(i>MAXDOFSPERNODE)break; 402 printf(" dof %i: %i %i %i %i\n",i,mset[i],nset[i],fset[i],sset[i]); 403 } 404 printf("\n"); 405 if(upper_node)printf(" upper_node pointer: %p\n",upper_node); 406 407 return; 408 } 409 /*}}}*/ 410 /*FUNCTION Node Enum{{{1*/ 411 int Node::Enum(void){ 412 413 return NodeEnum(); 414 415 } 416 /*}}}*/ 417 /*FUNCTION Node FieldAverageOntoVertices{{{1*/ 408 /*FUNCTION Node FieldAverageOntoVertices{{{2*/ 418 409 void Node::FieldAverageOntoVertices(Vec field,double* field_serial,char* fieldname){ 419 410 … … 421 412 } 422 413 /*}}}*/ 423 /*FUNCTION Node FieldDepthAverageAtBase{{{ 1*/414 /*FUNCTION Node FieldDepthAverageAtBase{{{2*/ 424 415 void Node::FieldDepthAverageAtBase(Vec field,double* field_serial,char* fieldname){ 425 416 426 417 /* node data: */ 427 int doflist1;418 int vertexdof; 428 419 int dofx,dofy; 429 420 int isnodeonsurface; … … 436 427 /*Are we on the base, not on the surface, and not on a clone node?:*/ 437 428 438 if( onbed==1 & clone==0 &onsurface==0){429 if(properties.onbed==1 & indexing.clone==0 &properties.onsurface==0){ 439 430 440 doflist1=GetDofList1();431 vertexdof=this->GetVertexDof(); 441 432 442 433 /*this node is on the bed. We are going to, follow the upper nodes until we reach the surface. At each upper node, … … 456 447 457 448 /*get dofs for this base node velocity: we know there are two dofs in field_serial */ 458 dofx=2* doflist1;459 dofy=2* doflist1+1;449 dofx=2*vertexdof; 450 dofy=2*vertexdof+1; 460 451 461 452 node=this; … … 464 455 if (node->IsOnSurface())break; 465 456 466 doflist1=node->GetDofList1();457 vertexdof=node->GetVertexDof(); 467 458 468 velocity1[0]=field_serial[2* doflist1];469 velocity1[1]=field_serial[2* doflist1+1];459 velocity1[0]=field_serial[2*vertexdof]; 460 velocity1[1]=field_serial[2*vertexdof+1]; 470 461 z1=node->GetZ(); 471 462 472 463 upper_node=node->GetUpperNode(); 473 doflist1=upper_node->GetDofList1();464 vertexdof=upper_node->GetVertexDof(); 474 465 475 velocity2[0]=field_serial[2* doflist1];476 velocity2[1]=field_serial[2* doflist1+1];466 velocity2[0]=field_serial[2*vertexdof]; 467 velocity2[1]=field_serial[2*vertexdof+1]; 477 468 z2=upper_node->GetZ(); 478 469 … … 507 498 508 499 /*get dofs for this base node velocity: we know there are two dofs in field_serial */ 509 dofx= doflist1;500 dofx=vertexdof; 510 501 511 502 node=this; … … 514 505 if (node->IsOnSurface())break; 515 506 516 doflist1=node->GetDofList1();507 vertexdof=node->GetVertexDof(); 517 508 518 field1=field_serial[ doflist1];509 field1=field_serial[vertexdof]; 519 510 z1=node->GetZ(); 520 511 521 512 upper_node=node->GetUpperNode(); 522 doflist1=upper_node->GetDofList1();513 vertexdof=upper_node->GetVertexDof(); 523 514 524 field2=field_serial[ doflist1];515 field2=field_serial[vertexdof]; 525 516 z2=upper_node->GetZ(); 526 517 … … 543 534 } 544 535 /*}}}*/ 545 /*FUNCTION Node FieldExtrude {{{ 1*/536 /*FUNCTION Node FieldExtrude {{{2*/ 546 537 void Node::FieldExtrude(Vec field,double* field_serial,char* field_name){ 547 538 … … 552 543 553 544 /*Is this node on bed? :*/ 554 if ( onbed){545 if (properties.onbed){ 555 546 556 547 if (strcmp(field_name,"velocity")==0){ 557 548 558 549 /* node data: */ 559 int doflist1;550 int vertexdof; 560 551 int doflist[2]; 561 552 double fieldnode[2]; 562 553 563 doflist1=GetDofList1();554 vertexdof=GetVertexDof(); 564 555 565 556 /*get dofs for this base node velocity: we know there are two dofs in field_serial */ 566 doflist[0]=2* doflist1;567 doflist[1]=2* doflist1+1;557 doflist[0]=2*vertexdof; 558 doflist[1]=2*vertexdof+1; 568 559 569 560 //initilaize node … … 578 569 for(;;){ 579 570 580 doflist1=node->GetDofList1();581 doflist[0]=2* doflist1;582 doflist[1]=2* doflist1+1;571 vertexdof=node->GetVertexDof(); 572 doflist[0]=2*vertexdof; 573 doflist[1]=2*vertexdof+1; 583 574 VecSetValues(field,1,&doflist[0],&fieldnode[0],INSERT_VALUES); 584 575 VecSetValues(field,1,&doflist[1],&fieldnode[1],INSERT_VALUES); … … 597 588 //initilaize node and get dof1 598 589 node=this; 599 dof1=node->Get DofList1();590 dof1=node->GetVertexDof(); 600 591 601 592 /*get field for this base node: */ … … 606 597 for(;;){ 607 598 608 dof1=node->Get DofList1();599 dof1=node->GetVertexDof(); 609 600 VecSetValues(field,1,&dof1,&fieldel,INSERT_VALUES); 610 601 … … 655 646 } 656 647 /*}}}*/ 657 /*FUNCTION Node FreezeDof{{{ 1*/648 /*FUNCTION Node FreezeDof{{{2*/ 658 649 void Node::FreezeDof(int dof){ 659 650 … … 662 653 } 663 654 /*}}}*/ 664 /*FUNCTION Node GetDof {{{ 1*/655 /*FUNCTION Node GetDof {{{2*/ 665 656 int Node::GetDof(int dofindex){ 666 657 667 return doflist[dofindex];668 669 } 670 /*}}}*/ 671 /*FUNCTION Node GetDofList{{{ 1*/658 return indexing.doflist[dofindex]; 659 660 } 661 /*}}}*/ 662 /*FUNCTION Node GetDofList{{{2*/ 672 663 void Node::GetDofList(int* outdoflist,int* pnumberofdofspernode){ 673 664 674 665 int i; 675 for(i=0;i< numberofdofs;i++){676 outdoflist[i]= doflist[i];666 for(i=0;i<this->indexing.numberofdofs;i++){ 667 outdoflist[i]=indexing.doflist[i]; 677 668 } 678 669 /*Assign output pointers:*/ 679 *pnumberofdofspernode=numberofdofs; 680 } 681 /*}}}*/ 682 /*FUNCTION Node GetDOfList1{{{1*/ 683 int Node::GetDofList1(void){ 684 return doflist1[0]; 685 } 686 /*}}}*/ 687 /*FUNCTION Node GetNumberOfDofs{{{1*/ 670 *pnumberofdofspernode=this->indexing.numberofdofs; 671 } 672 /*}}}*/ 673 /*FUNCTION Node GetNumberOfDofs{{{2*/ 688 674 int Node::GetNumberOfDofs(){ 689 675 690 return numberofdofs; 691 692 } 693 /*}}}*/ 694 /*FUNCTION Node GetSigma {{{1*/ 695 double Node::GetSigma(){return sigma;} 696 /*}}}*/ 697 /*FUNCTION Node GetUpperNode {{{1*/ 676 return this->indexing.numberofdofs; 677 678 } 679 /*}}}*/ 680 /*FUNCTION Node GetSigma {{{2*/ 681 double Node::GetSigma(){ 682 Vertex* vertex=NULL; 683 684 vertex=(Vertex*)hvertex.delivers(); 685 return vertex->sigma; 686 } 687 /*}}}*/ 688 /*FUNCTION Node GetUpperNode {{{2*/ 698 689 Node* Node::GetUpperNode(){ 690 Node* upper_node=NULL; 691 upper_node=(Node*)hupper_node.delivers(); 699 692 return upper_node; 700 693 } 701 694 /*}}}*/ 702 /*FUNCTION Node GetX {{{1*/ 703 double Node::GetX(){return x[0];} 704 /*}}}*/ 705 /*FUNCTION Node GetY {{{1*/ 706 double Node::GetY(){return x[1];} 707 /*}}}*/ 708 /*FUNCTION Node GetZ {{{1*/ 709 double Node::GetZ(){return x[2];} 710 /*}}}*/ 711 /*FUNCTION Node IsClone {{{1*/ 695 /*FUNCTION Node GetX {{{2*/ 696 double Node::GetX(){ 697 Vertex* vertex=NULL; 698 699 vertex=(Vertex*)hvertex.delivers(); 700 return vertex->x; 701 } 702 /*}}}*/ 703 /*FUNCTION Node GetY {{{2*/ 704 double Node::GetY(){ 705 Vertex* vertex=NULL; 706 707 vertex=(Vertex*)hvertex.delivers(); 708 return vertex->y; 709 } 710 /*}}}*/ 711 /*FUNCTION Node GetZ {{{2*/ 712 double Node::GetZ(){ 713 Vertex* vertex=NULL; 714 715 vertex=(Vertex*)hvertex.delivers(); 716 return vertex->z; 717 } 718 /*}}}*/ 719 /*FUNCTION Node IsClone {{{2*/ 712 720 int Node::IsClone(){ 713 721 714 return clone;715 716 } 717 /*}}}*/ 718 /*FUNCTION Node IsOnBed {{{ 1*/722 return indexing.clone; 723 724 } 725 /*}}}*/ 726 /*FUNCTION Node IsOnBed {{{2*/ 719 727 int Node::IsOnBed(){ 720 return onbed;721 } 722 /*}}}*/ 723 /*FUNCTION Node IsOnSheet {{{ 1*/728 return properties.onbed; 729 } 730 /*}}}*/ 731 /*FUNCTION Node IsOnSheet {{{2*/ 724 732 int Node::IsOnSheet(){ 725 return onsheet;733 return properties.onsheet; 726 734 } 727 735 /*}}}*/ 728 /*FUNCTION Node IsOnShelf {{{ 1*/736 /*FUNCTION Node IsOnShelf {{{2*/ 729 737 int Node::IsOnShelf(){ 730 return onshelf;731 } 732 /*}}}*/ 733 /*FUNCTION Node IsOnSurface {{{ 1*/738 return properties.onshelf; 739 } 740 /*}}}*/ 741 /*FUNCTION Node IsOnSurface {{{2*/ 734 742 int Node::IsOnSurface(){ 735 return onsurface;736 } 737 /*}}}*/ 738 /*FUNCTION Node MyRank{{{ 1*/743 return properties.onsurface; 744 } 745 /*}}}*/ 746 /*FUNCTION Node MyRank{{{2*/ 739 747 int Node::MyRank(void){ 740 748 extern int my_rank; … … 743 751 } 744 752 /*}}}*/ 745 /*FUNCTION Node SetClone {{{ 1*/753 /*FUNCTION Node SetClone {{{2*/ 746 754 void Node::SetClone(int* minranks){ 747 755 … … 749 757 750 758 if (minranks[id-1]==my_rank){ 751 clone=0;759 indexing.clone=0; 752 760 } 753 761 else{ 754 762 /*!there is a cpu with lower rank that has the same node, 755 763 therefore, I am a clone*/ 756 clone=1;757 } 758 759 } 760 /*}}}*/ 761 /*FUNCTION Node ShowBorderDofs{{{ 1*/764 indexing.clone=1; 765 } 766 767 } 768 /*}}}*/ 769 /*FUNCTION Node ShowBorderDofs{{{2*/ 762 770 void Node::ShowBorderDofs(int* borderdofs,int* borderdofs1){ 763 771 … … 766 774 767 775 /*Is this node on the partition border? */ 768 if(! partitionborder)return;776 if(!indexing.partitionborder)return; 769 777 770 778 /*Are we the cpu that created this node's dof list? */ 771 if( clone)return;779 if(indexing.clone)return; 772 780 773 781 /*Ok, we are on the partition border, and we did create the 774 782 * dofs for this node, plug the doflist into borderdofs: */ 775 for(j=0;j< numberofdofs;j++){776 *(borderdofs+ numberofdofs*(id-1)+j)=doflist[j];777 } 778 *(borderdofs1+(id-1)+0)= doflist1[0];783 for(j=0;j<this->indexing.numberofdofs;j++){ 784 *(borderdofs+this->indexing.numberofdofs*(id-1)+j)=indexing.doflist[j]; 785 } 786 *(borderdofs1+(id-1)+0)=this->GetVertexDof(); 779 787 780 788 return; 781 789 } 782 790 /*}}}*/ 783 /*FUNCTION Node UpdateBorderDofs{{{ 1*/791 /*FUNCTION Node UpdateBorderDofs{{{2*/ 784 792 void Node::UpdateBorderDofs(int* allborderdofs,int* allborderdofs1){ 785 793 … … 788 796 789 797 /*Is this node on the partition border? */ 790 if(! partitionborder)return;798 if(!indexing.partitionborder)return; 791 799 792 800 /*Are we the cpu that created this node's dof list? */ 793 if( clone==0)return;801 if(indexing.clone==0)return; 794 802 795 803 /*Ok, we are on the partition border, but we did not create 796 804 * the dofs for this node. Therefore, our doflist is garbage right 797 805 * now. Go pick it up in the allborderdofs: */ 798 for(j=0;j< numberofdofs;j++){799 doflist[j]=*(allborderdofs+numberofdofs*(id-1)+j);800 } 801 doflist1[0]=*(allborderdofs1+(id-1)+0);806 for(j=0;j<this->indexing.numberofdofs;j++){ 807 indexing.doflist[j]=*(allborderdofs+this->indexing.numberofdofs*(id-1)+j); 808 } 809 this->SetVertexDof(*(allborderdofs1+(id-1)+0)); 802 810 return; 803 811 } 804 812 /*}}}*/ 805 /*FUNCTION Node UpdateDofs{{{ 1*/813 /*FUNCTION Node UpdateDofs{{{2*/ 806 814 void Node::UpdateDofs(int dofcount,int dofcount1){ 807 815 … … 809 817 extern int my_rank; 810 818 811 if( clone){819 if(indexing.clone){ 812 820 /*This node is a clone, don't update the dofs!: */ 813 821 return; … … 815 823 816 824 /*This node should update the dofs, go ahead: */ 817 for(i=0;i< numberofdofs;i++){818 doflist[i]+=dofcount;819 } 820 doflist1[0]+=dofcount1;825 for(i=0;i<this->indexing.numberofdofs;i++){ 826 indexing.doflist[i]+=dofcount; 827 } 828 this->SetVertexDof(this->GetVertexDof()+dofcount1); 821 829 822 830 return; 823 831 } 824 832 /*}}}*/ 825 /*FUNCTION Node UpdateFromInputs {{{ 1*/833 /*FUNCTION Node UpdateFromInputs {{{2*/ 826 834 void Node::UpdateFromInputs(void* vinputs){ 827 828 ParameterInputs* inputs=NULL; 829 Node* node=this; 830 int dof[1]={0}; 831 832 /*Recover parameter inputs: */ 833 inputs=(ParameterInputs*)vinputs; 834 835 /*Update internal data if inputs holds new values: */ 836 inputs->Recover("x",&x[0],1,dof,1,(void**)&node); 837 inputs->Recover("y",&x[1],1,dof,1,(void**)&node); 838 inputs->Recover("z",&x[2],1,dof,1,(void**)&node); 839 840 841 } 842 /*}}}*/ 843 /*FUNCTION Node UpdateNodePosition {{{1*/ 844 void Node::UpdateNodePosition(double* thickness,double* bed){ 845 846 int dof; 847 848 dof=this->GetDofList1(); 849 850 /*sigma remains constant. z=bed+sigma*thickness*/ 851 this->x[2]=bed[dof]+sigma*thickness[dof]; 852 853 } 854 /*}}}*/ 835 836 ISSMERROR("not used yet!"); 837 838 } 839 /*}}}*/ 840 /*}}}*/ -
issm/trunk/src/c/objects/Node.h
r3390 r3417 6 6 #define _NODE_H_ 7 7 8 /*indefinitions: */ 9 class Object; 10 class Vertex; 11 class Hook; 12 8 13 #include "./Object.h" 14 #include "../DataSet/DataSet.h" 15 #include "./Hook.h" 16 #include "./Vertex.h" 17 #include "./DofIndexing.h" 18 #include "./NodeProperties.h" 9 19 #include "../toolkits/toolkits.h" 10 11 #define MAXDOFSPERNODE 412 #define PSSTRINGLENGTH 2013 20 14 21 class Node: public Object{ 15 22 16 23 private: 17 /*raw data coming from the model processor: */ 18 int id; /*! id, to track it*/ 19 int partitionborder; /*! during parallel partitioning, does this grid belong to a partition border?*/ 20 int numberofdofs; //real number of dofs, between 0 and MAXDOFSPERNODE 21 int clone; /*!this nodes is one the partition border, and is cloned*/ 22 double x[3]; /*! coordinates*/ 23 double sigma; /*! sigma = (z-bed)/thickness*/ 24 25 int id; 26 27 DofIndexing indexing; 28 NodeProperties properties; 29 Hook hvertex; 30 Hook hupper_node; 31 24 32 25 int onbed; /*! for 3d, on bedrock*/26 int onsurface; /*! for 3d, on surface*/27 int onshelf;28 int onsheet;29 30 /*for dof constraining: */31 int mset[MAXDOFSPERNODE];32 int nset[MAXDOFSPERNODE];33 int fset[MAXDOFSPERNODE];34 int sset[MAXDOFSPERNODE];35 36 int upper_node_id;37 Node* upper_node;38 int upper_node_offset;39 40 /*data that is post processed : */41 int doflist[MAXDOFSPERNODE]; //dof list on which we solve42 int doflist1[1]; //1d dof list to recover input parameters43 44 33 public: 45 34 35 /*FUNCTION constructors, destructors {{{1*/ 46 36 Node(); 47 Node(int node_id,int node_partitionborder,int node_numdofs, double node_x[3],double sigma,int node_onbed,int node_onsurface,int upper_node_id,int onshelf,int onsheet); 37 Node(int id,int vertex_id, int upper_node_id, int partitionborder,int numberofdofs, NodeProperties* node_properties); 38 Node(int id,DofIndexing* indexing, NodeProperties* properties, Hook* vertex, Hook* upper_node); 39 Node(int i, IoModel* iomodel); 48 40 ~Node(); 49 41 /*}}}*/ 42 /*FUNCTION object management {{{1*/ 43 void Configure(void* pnodes, void* pvertices); 44 void DeepEcho(); 45 void Demarshall(char** pmarshalled_dataset); 50 46 void Echo(); 51 void DeepEcho(); 47 int Enum(); 48 int GetId(void); 49 char* GetName(); 50 int GetVertexDof(void); 52 51 void Marshall(char** pmarshalled_dataset); 53 52 int MarshallSize(); 54 char* GetName();55 void Demarshall(char** pmarshalled_dataset);56 int Enum();57 int GetId(void);58 53 int MyRank(void); 54 void SetVertexDof(int in_dof); 55 /*}}}*/ 56 /*FUNCTION numerical routines {{{1*/ 59 57 void DistributeDofs(int* pdofcount,int* pdofcount1); 60 58 void UpdateDofs(int dofcount,int dofcount1); … … 79 77 Object* copy(); 80 78 void UpdateFromInputs(void* inputs); 81 void Configure(void* pnodes);82 79 Node* GetUpperNode(); 83 80 int IsOnBed(); … … 90 87 void FieldExtrude(Vec field,double* field_serial,char* field_name); 91 88 void UpdateNodePosition(double* thickness,double* bed); 89 /*}}}*/ 92 90 }; 93 91 94 92 #endif /* _NODE_H_ */ 95 -
issm/trunk/src/c/objects/Penta.cpp
r3401 r3417 51 51 52 52 return; 53 } 54 /*}}}*/ 55 /*FUNCTION Penta other constructor {{{1*/ 56 Penta::Penta(int i, IoModel* iomodel){ //i is the element index 57 58 int j; 59 int offset; 60 int penta_node_ids[6]; 61 double penta_h[6]; 62 double penta_s[6]; 63 double penta_b[6]; 64 double penta_k[6]; 65 double penta_melting[6]; 66 double penta_accumulation[6]; 67 68 /*id: */ 69 this->id=i+1; 70 71 /*hooks: */ 72 for(j=0;j<6;j++){ //go recover node ids, needed to initialize the node hook. 73 penta_node_ids[j]=(int)*(iomodel->elements+6*i+j); //ids for vertices are in the elements array from Matlab 74 } 75 penta_matice_id=i+1; //refers to the corresponding ice material object 76 penta_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object 77 penta_numpar_id=1; //refers to numerical parameters object 78 79 this->hnodes->Init(penta_node_ids,6); 80 this->hmatice->Init(penta_matice_id,1); 81 this->hmatpar->Init(penta_matpar_id,1); 82 this->hnumpar->Init(penta_numpar_id,1); 83 84 /*properties: */ 85 for(j=0;j<6;j++){ 86 87 offset=(int)*(iomodel->elements+6*i+j)-1; //get index of this vertex, in C numbering. 88 penta_h[j]= *(iomodel->thickness+offset); 89 penta_s[j]= *(iomodel->surface+offset); 90 penta_b[j]=*(iomodel->bed+offset); 91 penta_k[j]=*(iomodel->drag+offset); 92 penta_melting[j]=*(iomodel->melting+offset); 93 penta_accumulation[j]=*(iomodel->accumulation+offset); 94 } 95 penta_friction_type=(int)iomodel->drag_type; 96 penta_p=iomodel->p[i]; 97 penta_q=iomodel->q[i]; 98 penta_shelf=(int)*(iomodel->elementoniceshelf+i); 99 penta_onwater=(bool)*(iomodel->elementonwater+i); 100 penta_onsurface=(int)*(iomodel->elementonsurface+i); 101 penta_onwater=(bool)*(iomodel->elementonwater+i); 102 103 if (*(iomodel->elements_type+2*i+0)==macayealformulationenum()){ //elements of type 3 are macayeal type penta. we collapse the formulation on their base. 104 penta_collapse=1; 105 } 106 else{ 107 penta_collapse=0; 108 } 109 110 this->properties->Init(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); 111 112 53 113 } 54 114 /*}}}*/ -
issm/trunk/src/c/objects/Penta.h
r3389 r3417 11 11 #include "./Numpar.h" 12 12 #include "./Matice.h" 13 #include "./Node.h"14 13 #include "./Tria.h" 15 14 #include "./Hook.h" 16 15 #include "./ElementProperties.h" 17 16 #include "./ParameterInputs.h" 17 #include "./Node.h" 18 18 19 class Numpar;19 class Object; 20 20 class Node; 21 class Matice;22 class Matpar;23 class ElementProperties;21 class Hook; 22 class ElementProperties; 23 class DataSet; 24 24 25 25 class Penta: public Element{ … … 41 41 Penta(int penta_id,int* penta_node_ids, int penta_matice_id, int penta_matpar_id, int penta_numpar_id, ElementProperties* properties); 42 42 Penta(int penta_id,Hook* penta_hnodes, Hook* penta_hmatice, Hook* penta_hmatpar, Hook* penta_hnumpar, ElementProperties* penta_properties); 43 Penta(int i, IoModel* iomodel); 43 44 ~Penta(); 44 45 /*}}}*/ -
issm/trunk/src/c/objects/Tria.cpp
r3399 r3417 59 59 60 60 return; 61 } 62 /*}}}*/ 63 /*FUNCTION Tria constructor from iomodel{{{1*/ 64 Tria::Tria(int i, IoModel* iomodel){ //i is the element index 65 66 int j; 67 int offset; 68 int tria_node_ids[3]; 69 double tria_h[3]; 70 double tria_s[3]; 71 double tria_b[3]; 72 double tria_k[3]; 73 double tria_melting[3]; 74 double tria_accumulation[3]; 75 76 /*id: */ 77 this->id=i+1; 78 79 /*hooks: */ 80 for(j=0;j<3;j++){ //go recover node ids, needed to initialize the node hook. 81 tria_node_ids[j]=(int)*(iomodel->elements+3*i+j); //ids for vertices are in the elements array from Matlab 82 } 83 tria_matice_id=i+1; //refers to the corresponding ice material object 84 tria_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object 85 tria_numpar_id=1; //refers to numerical parameters object 86 87 this->hnodes->Init(tria_node_ids,3); 88 this->hmatice->Init(tria_matice_id,1); 89 this->hmatpar->Init(tria_matpar_id,1); 90 this->hnumpar->Init(tria_numpar_id,1); 91 92 /*properties: */ 93 for(j=0;j<3;j++){ 94 95 offset=(int)*(iomodel->elements+3*i+j)-1; //get index of this vertex, in C numbering. 96 tria_h[j]= *(iomodel->thickness+offset); 97 tria_s[j]= *(iomodel->surface+offset); 98 tria_b[j]=*(iomodel->bed+offset); 99 tria_k[j]=*(iomodel->drag+offset); 100 tria_melting[j]=*(iomodel->melting+offset); 101 tria_accumulation[j]=*(iomodel->accumulation+offset); 102 } 103 tria_friction_type=(int)iomodel->drag_type; 104 tria_p=iomodel->p[i]; 105 tria_q=iomodel->q[i]; 106 tria_shelf=(int)*(iomodel->elementoniceshelf+i); 107 tria_onwater=(bool)*(iomodel->elementonwater+i); 108 109 this->properties->Init(3,tria_h, tria_s, tria_b, tria_k, tria_melting, tria_accumulation, NULL, 110 tria_friction_type, tria_p, tria_q, tria_shelf, UNDEF,tria_onwater, UNDEF,UNDEF,UNDEF); 111 112 61 113 } 62 114 /*}}}*/ -
issm/trunk/src/c/objects/Tria.h
r3402 r3417 7 7 8 8 9 #include "./Object.h" 9 10 #include "./Element.h" 11 #include "./Hook.h" 12 #include "./Node.h" 13 #include "./ElementProperties.h" 10 14 #include "../DataSet/DataSet.h" 11 #include "./Object.h"12 #include "./Node.h"13 #include "./Matice.h"14 #include "./Matpar.h"15 #include "./Numpar.h"16 #include "./ParameterInputs.h"17 #include "./ElementProperties.h"18 #include "./Hook.h"19 15 20 16 class Object; 17 class Element; 18 class Hook; 19 class ElementProperties; 20 class DataSet; 21 class Node; 21 22 22 23 class Tria: public Element{ … … 39 40 Tria(int tria_id,int* tria_node_ids, int tria_matice_id, int tria_matpar_id, int tria_numpar_id, ElementProperties* tria_properties); 40 41 Tria(int tria_id,Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Hook* tria_hnumpar, ElementProperties* tria_properties); 42 Tria(int i, IoModel* iomodel); 41 43 ~Tria(); 42 44 /*}}}*/ -
issm/trunk/src/c/objects/Vertex.cpp
r3390 r3417 3 3 */ 4 4 5 /*Include files: {{{1*/ 5 6 #ifdef HAVE_CONFIG_H 6 7 #include "config.h" … … 16 17 #include "../include/typedefs.h" 17 18 #include "../include/macros.h" 19 /*}}}*/ 18 20 19 21 /*Object constructors and destructor*/ … … 24 26 /*}}}*/ 25 27 /*FUNCTION Vertex constructor {{{1*/ 26 Vertex::Vertex(int tria_id, double tria_x, double tria_y, double tria_z){ 28 Vertex::Vertex(int tria_id, double tria_x, double tria_y, double tria_z, double tria_sigma, int partitionborder){ 29 this->Init(tria_id, tria_x, tria_y, tria_z, tria_sigma, partitionborder); 30 } 31 /*}}}*/ 32 /*FUNCTION Vertex init, used by constructor {{{1*/ 33 Vertex::Init(int tria_id, double tria_x, double tria_y, double tria_z, double tria_sigma, int partitionborder){ 27 34 28 35 /*all the initialization has been done by the initializer, just fill in the id: */ … … 31 38 this->y=tria_y; 32 39 this->z=tria_z; 33 34 return; 40 this->sigma=tria_sigma; 41 this->dof=UNDEF; 42 43 return; 44 } 45 /*}}}*/ 46 /*FUNCTION Vertex constructor from iomodel{{{1*/ 47 Vertex::Vertex(int i, IoModel* iomodel){ 48 49 int partitionborder; 50 51 /*is this vertex on a partition border? */ 52 if(my_bordervertices[i])partitionborder=1; 53 else partitionborder=0; 54 55 this->Init(i+1, iomodel->x[i],iomodel->y[i],iomodel->z[i],(iomodel->z[i]-iomodel->bed[i])/(iomodel->thickness[i]),partitionborder); 56 35 57 } 36 58 /*}}}*/ … … 71 93 memcpy(&y,marshalled_dataset,sizeof(y));marshalled_dataset+=sizeof(y); 72 94 memcpy(&z,marshalled_dataset,sizeof(z));marshalled_dataset+=sizeof(z); 95 memcpy(&sigma,marshalled_dataset,sizeof(sigma));marshalled_dataset+=sizeof(sigma); 96 memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof); 97 memcpy(&partitionborder,marshalled_dataset,sizeof(partitionborder));marshalled_dataset+=sizeof(partitionborder); 98 memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone); 73 99 74 100 /*return: */ … … 86 112 printf(" y: %g\n",y); 87 113 printf(" z: %g\n",z); 114 printf(" sigma: %g\n",sigma); 115 printf(" dof: %g\n",dof); 116 printf(" partitionborder: %g\n",partitionborder); 117 printf(" clone: %g\n",clone); 88 118 89 119 return; … … 125 155 memcpy(marshalled_dataset,&y,sizeof(y));marshalled_dataset+=sizeof(y); 126 156 memcpy(marshalled_dataset,&z,sizeof(z));marshalled_dataset+=sizeof(z); 157 memcpy(marshalled_dataset,&sigma,sizeof(sigma));marshalled_dataset+=sizeof(sigma); 158 memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof); 159 memcpy(marshalled_dataset,&partitionborder,sizeof(partitionborder));marshalled_dataset+=sizeof(partitionborder); 160 memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone); 127 161 128 162 *pmarshalled_dataset=marshalled_dataset; … … 137 171 sizeof(y)+ 138 172 sizeof(z)+ 173 sizeof(sigma)+ 174 sizeof(dof)+ 175 sizeof(partitionborder)+ 176 sizeof(clone)+ 139 177 +sizeof(int); //sizeof(int) for enum type 140 178 } … … 155 193 /*FUNCTION UpdateFromInputs {{{1*/ 156 194 void Vertex::UpdateFromInputs(void* vinputs){ 157 195 196 ParameterInputs* inputs=NULL; 197 Vertex* vertex=NULL; 198 int dof[1]={0}; 199 double coord[3]; 200 201 vertex=this; 202 203 coord[0]=this->x; coord[1]=this->y; coord[2]=this->z; 204 205 /*Recover parameter inputs: */ 206 inputs=(ParameterInputs*)vinputs; 207 208 /*Update internal data if inputs holds new values: */ 209 inputs->Recover("x",&coord[0],1,dof,1,(void**)&vertex); 210 inputs->Recover("y",&coord[1],1,dof,1,(void**)&vertex); 211 inputs->Recover("z",&coord[2],1,dof,1,(void**)&vertex); 212 158 213 ISSMERROR("not supported yet!"); 159 214 160 215 } 161 216 /*}}}*/ 217 /*FUNCTION UpdateVertexPosition {{{1*/ 218 void Vertex::UpdatePosition(double* thickness,double* bed){ 219 220 /*sigma remains constant. z=bed+sigma*thickness*/ 221 this->z=bed[dof]+sigma*thickness[this->dof]; 222 223 } 224 /*}}}*/ -
issm/trunk/src/c/objects/Vertex.h
r3390 r3417 10 10 class Vertex: public Object{ 11 11 12 p rivate:12 public: 13 13 14 14 int id; … … 16 16 double y; 17 17 double z; 18 double sigma; //sigma coordinate: (z-bed)/thickness 18 19 19 public: 20 /*dof management: */ 21 int partitionborder; 22 int clone; 23 int dof; //dof to recover values in a vertex indexed vector 20 24 21 25 /*FUNCTION constructors, destructors {{{1*/ 22 26 Vertex(); 23 Vertex(int id, double x, double y, double z); 27 Vertex(int id, double x, double y, double z, double sigma,int partitionborder); 28 Init(int id, double x, double y, double z, double sigma,int partitionborder); 29 Vertex(int i, IoModel* iomodel); 24 30 ~Vertex(); 25 31 /*}}}*/ … … 37 43 void UpdateFromDakota(void* vinputs); 38 44 void UpdateFromInputs(void* vinputs); 45 void UpdatePosition(double* thickness,double* bed); 46 47 39 48 /*}}}*/ 40 49 -
issm/trunk/src/m/enum/BeamEnum.m
r1714 r3417 7 7 % macro=BeamEnum() 8 8 9 macro=41 5;9 macro=416; -
issm/trunk/src/m/enum/NodeEnum.m
r1714 r3417 7 7 % macro=NodeEnum() 8 8 9 macro=42 0;9 macro=421; -
issm/trunk/src/m/enum/PentaEnum.m
r3383 r3417 7 7 % macro=PentaEnum() 8 8 9 macro=41 3;9 macro=414; -
issm/trunk/src/m/enum/SingEnum.m
r1714 r3417 7 7 % macro=SingEnum() 8 8 9 macro=41 4;9 macro=415; -
issm/trunk/src/m/solutions/jpl/CreateFemModel.m
r2333 r3417 9 9 10 10 displaystring(md.verbose,'\n reading data from model %s...',md.name); 11 [m.elements,m.nodes,m. constraints,m.loads,m.materials,m.parameters]=ModelProcessor(md);11 [m.elements,m.nodes,m.vertices,m.constraints,m.loads,m.materials,m.parameters]=ModelProcessor(md); 12 12 13 13 displaystring(md.verbose,'%s',' generating degrees of freedom...'); 14 [m.nodes,m. part,m.tpart]=Dof(m.elements,m.nodes,m.parameters);14 [m.nodes,m.vertices,m.part,m.tpart]=Dof(m.elements,m.nodes,m.vertices, m.parameters); 15 15 16 16 displaystring(md.verbose,'%s',' generating single point constraints...'); … … 30 30 31 31 displaystring(md.verbose,'%s',' configuring element and loads...'); 32 [m.elements,m.loads,m.nodes,m. parameters] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials,m.parameters);32 [m.elements,m.loads,m.nodes,m.vertices,m.parameters] = ConfigureObjects( m.elements, m.loads, m.nodes, m.materials,m.parameters); 33 33 34 34 displaystring(md.verbose,'%s',' processing parameters...'); -
issm/trunk/src/mex/Dof/Dof.cpp
r2333 r3417 12 12 /*input datasets: */ 13 13 DataSet* nodes=NULL; 14 DataSet* vertices=NULL; 14 15 DataSet* elements=NULL; 15 16 DataSet* params=NULL; … … 28 29 FetchData(&elements,ELEMENTS); 29 30 FetchData(&nodes,NODESIN); 31 FetchData(&vertices,VERTICESIN); 30 32 FetchData(¶ms,PARAMS); 31 33 32 34 /*!Generate internal degree of freedom numbers: */ 33 Dofx(&partition, &tpartition,elements,nodes, params);35 Dofx(&partition, &tpartition,elements,nodes, vertices, params); 34 36 35 37 /*partition and tpartition should be incremented by 1: */ … … 39 41 /*write output datasets: */ 40 42 WriteData(NODES,nodes); 43 WriteData(VERTICES,vertices); 41 44 WriteData(PARTITION,partition); 42 45 WriteData(TPARTITION,tpartition); … … 44 47 /*Free ressources: */ 45 48 delete nodes; 49 delete vertices; 46 50 delete elements; 47 51 delete params; -
issm/trunk/src/mex/Dof/Dof.h
r1 r3417 19 19 #define ELEMENTS (mxArray*)prhs[0] 20 20 #define NODESIN (mxArray*)prhs[1] 21 #define PARAMS (mxArray*)prhs[2] 21 #define VERTICESIN (mxArray*)prhs[2] 22 #define PARAMS (mxArray*)prhs[3] 22 23 23 24 /* serial output macros: */ 24 25 #define NODES (mxArray**)&plhs[0] 25 #define PARTITION (mxArray**)&plhs[1] 26 #define TPARTITION (mxArray**)&plhs[2] 26 #define VERTICES (mxArray**)&plhs[1] 27 #define PARTITION (mxArray**)&plhs[2] 28 #define TPARTITION (mxArray**)&plhs[3] 27 29 28 30 /* serial arg counts: */ 29 31 #undef NLHS 30 #define NLHS 332 #define NLHS 4 31 33 #undef NRHS 32 #define NRHS 334 #define NRHS 4 33 35 34 36 -
issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp
r2316 r3417 14 14 DataSet* elements=NULL; 15 15 DataSet* nodes=NULL; 16 DataSet* vertices=NULL; 16 17 DataSet* constraints=NULL; 17 18 DataSet* loads=NULL; … … 32 33 33 34 /*Create elements, nodes and materials: */ 34 CreateDataSets(&elements,&nodes,& materials,&constraints, &loads, ¶meters, iomodel,MODEL);35 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints, &loads, ¶meters, iomodel,MODEL); 35 36 36 37 /*Write output data: */ 37 38 WriteData(ELEMENTS,elements); 38 39 WriteData(NODES,nodes); 40 WriteData(VERTICES,vertices); 39 41 WriteData(CONSTRAINTS,constraints); 40 42 WriteData(LOADS,loads); … … 47 49 delete elements; 48 50 delete nodes; 51 delete vertices; 49 52 delete constraints; 50 53 delete loads; -
issm/trunk/src/mex/ModelProcessor/ModelProcessor.h
r1 r3417 26 26 #define ELEMENTS (mxArray**)&plhs[0] 27 27 #define NODES (mxArray**)&plhs[1] 28 #define CONSTRAINTS (mxArray**)&plhs[2] 29 #define LOADS (mxArray**)&plhs[3] 30 #define MATERIALS (mxArray**)&plhs[4] 31 #define PARAMETERS (mxArray**)&plhs[5] 28 #define VERTICES (mxArray**)&plhs[2] 29 #define CONSTRAINTS (mxArray**)&plhs[3] 30 #define LOADS (mxArray**)&plhs[4] 31 #define MATERIALS (mxArray**)&plhs[5] 32 #define PARAMETERS (mxArray**)&plhs[6] 32 33 33 34 /* serial arg counts: */ 34 35 #undef NLHS 35 #define NLHS 636 #define NLHS 7 36 37 #undef NRHS 37 38 #define NRHS 1
Note:
See TracChangeset
for help on using the changeset viewer.