Changeset 15464
- Timestamp:
- 07/08/13 16:10:26 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 1 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r15461 r15464 254 254 ./modules/ModelProcessorx/CreateNumberNodeToElementConnectivity.cpp\ 255 255 ./modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp\ 256 ./modules/ModelProcessorx/CreateNodes.cpp\ 256 257 ./modules/ParseToolkitsOptionsx/ParseToolkitsOptionsx.h\ 257 258 ./modules/ParseToolkitsOptionsx/ParseToolkitsOptionsx.cpp\ -
issm/trunk-jpl/src/c/classes/Node.cpp
r15439 r15464 22 22 } 23 23 /*}}}*/ 24 /*FUNCTION Node::Node(int node_id,int node_sid,int vertex_id,intio_index, IoModel* iomodel,int analysis_type) {{{*/25 Node::Node(int node_id,int node_sid,int vertex_id,intio_index, IoModel* iomodel,int analysis_type){24 /*FUNCTION Node::Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type) {{{*/ 25 Node::Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type){ 26 26 27 27 /*Intermediary*/ -
issm/trunk-jpl/src/c/classes/Node.h
r15439 r15464 40 40 /*Node constructors, destructors {{{*/ 41 41 Node(); 42 Node(int node_id,int node_sid, int vertex_id,int io_index, IoModel* iomodel,int analysis_type);42 Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type); 43 43 ~Node(); 44 44 /*}}}*/ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
r15461 r15464 11 11 void CreateNodesBalancethickness(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/ 14 int i,j; 15 int node_id; 16 int vertex_id; 17 int io_index; 13 /*Fetch parameters: */ 18 14 int stabilization; 19 bool *my_nodes=NULL;20 21 /*Fetch parameters: */22 15 iomodel->Constant(&stabilization,BalancethicknessStabilizationEnum); 23 24 /*Recover pointer: */25 Nodes* nodes=*pnodes;26 27 /*Create nodes if they do not exist yet*/28 if(!nodes) nodes = new Nodes();29 16 30 17 /*Check in 3d*/ … … 33 20 /*First fetch data: */ 34 21 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 35 36 22 if(stabilization!=3){ 37 38 /*Build Nodes dataset (Continuous Galerkin)*/ 39 for (i=0;i<iomodel->numberofvertices;i++){ 40 if(iomodel->my_vertices[i]){ 41 42 /*Add node to nodes dataset: */ 43 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,BalancethicknessAnalysisEnum)); 44 45 } 46 } 23 CreateNodes(pnodes,iomodel,BalancethicknessAnalysisEnum,P1Enum); 47 24 } 48 25 else{ 49 50 /*Build Nodes dataset -> 3 for each element (Discontinuous Galerkin)*/ 51 NodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,false); 52 for (i=0;i<iomodel->numberofelements;i++){ 53 for (j=0;j<3;j++){ 54 55 if(my_nodes[3*i+j]){ 56 57 //Get index of the vertex on which the current node is located 58 vertex_id=iomodel->elements[3*i+j]; //(Matlab indexing) 59 io_index=vertex_id-1; //(C indexing) 60 _assert_(vertex_id>0 && vertex_id<=iomodel->numberofvertices); 61 62 //Compute Node id 63 node_id=iomodel->nodecounter+3*i+j+1; 64 65 /*Add node to nodes dataset: */ 66 nodes->AddObject(new Node(node_id,node_id-1,vertex_id,io_index,iomodel,BalancethicknessAnalysisEnum)); 67 68 } 69 } 70 } 26 CreateNodes(pnodes,iomodel,BalancethicknessAnalysisEnum,P1DGEnum); 71 27 } 72 73 /*Clean fetched data: */74 28 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 75 xDelete<bool>(my_nodes);76 77 /*Assign output pointer: */78 *pnodes=nodes;79 29 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp
r15461 r15464 11 11 void CreateNodesBedSlope(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Recover pointer: */14 Nodes* nodes=*pnodes;15 16 /*Create nodes if they do not exist yet*/17 if(!nodes) nodes = new Nodes();18 19 /*First fetch data: */20 13 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 21 22 for(int i=0;i<iomodel->numberofvertices;i++){ 23 if(iomodel->my_vertices[i]){ 24 25 /*Add node to nodes dataset: */ 26 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,BedSlopeAnalysisEnum)); 27 28 } 29 } 30 31 /*Clean fetched data: */ 14 CreateNodes(pnodes,iomodel,BedSlopeAnalysisEnum,P1Enum); 32 15 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 33 34 /*Assign output pointer: */35 *pnodes=nodes;36 16 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp
r15421 r15464 16 16 void CreateDataSets(Elements** pelements,Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads,Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,const int analysis_type,const int nummodels,int analysis_counter){ 17 17 18 bool continuous = true;19 18 Elements *elements = NULL; 20 19 Materials *materials = NULL; … … 30 29 31 30 /*Recover elements and materials, for future update: */ 32 elements=*pelements; 33 materials=*pmaterials; 31 elements = *pelements; 32 materials = *pmaterials; 33 34 /*Creates Nodes dataset if empty*/ 35 if(!*pnodes) *pnodes = new Nodes(); 34 36 35 37 /*Now, branch onto analysis dependent model generation: */ … … 169 171 SortDataSets(pelements,pnodes,pvertices, ploads, pmaterials, pconstraints, pparameters); 170 172 171 /*Update counters, because we have created more nodes, loads and constraints, and ids for objects created in next call to CreateDataSets 173 /* Update counters, because we have created more nodes, loads and 174 * constraints, and ids for objects created in next call to CreateDataSets 172 175 * will need to start at the end of the updated counters: */ 173 176 UpdateCounters(iomodel,pnodes,ploads,pconstraints); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
r15461 r15464 21 21 iomodel->Constant(&finiteelementssa,FlowequationFeSsaEnum); 22 22 23 /*Recover pointer: */24 Nodes* nodes=*pnodes;25 26 /*First create nodes*/27 if(!nodes) nodes = new Nodes();28 29 23 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */ 30 if(!ismacayealpattyn & !isstokes & !isl1l2){ 31 *pnodes=nodes; 32 return; 33 } 24 if(!ismacayealpattyn & !isstokes & !isl1l2) return; 34 25 35 26 /*Create nodes: */ 36 27 iomodel->FetchData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBordermacayealEnum,FlowequationBorderstokesEnum, 37 28 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 38 39 for(int i=0;i<iomodel->numberofvertices;i++){ 40 41 if(iomodel->my_vertices[i]){ 42 43 /*Add node to nodes dataset: */ 44 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,DiagnosticHorizAnalysisEnum)); 45 } 29 if(finiteelementssa==0){ 30 CreateNodes(pnodes,iomodel,DiagnosticHorizAnalysisEnum,P1Enum); 46 31 } 47 48 if(finiteelementssa==1){ 49 50 /*Quadratic element*/ 51 bool *my_edges = NULL; 52 EdgesPartitioning(&my_edges,iomodel); 53 CreateElementToEdgeConnectivity(iomodel); 54 55 for(int i=0;i<iomodel->numberofedges;i++){ 56 if(my_edges[i]){ 57 nodes->AddObject(new Node(iomodel->nodecounter+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,0,0,iomodel,DiagnosticHorizAnalysisEnum)); 58 } 59 } 60 /*Clean up*/ 61 xDelete<bool>(my_edges); 32 else if(finiteelementssa==1){ 33 CreateNodes(pnodes,iomodel,DiagnosticHorizAnalysisEnum,P2Enum); 62 34 } 63 64 /*Clean fetched data: */ 35 else{ 36 _error_("finite element not supported yet"); 37 } 65 38 iomodel->DeleteData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBordermacayealEnum,FlowequationBorderstokesEnum, 66 39 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 67 68 /*Assign output pointer: */69 *pnodes=nodes;70 40 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
r15461 r15464 11 11 void CreateNodesDiagnosticHutter(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /* Intermediary*/13 /*Fetch parameters: */ 14 14 bool ishutter; 15 16 /*Fetch parameters: */17 15 iomodel->Constant(&ishutter,FlowequationIshutterEnum); 18 16 19 /* Recover pointer: */20 Nodes* nodes=*pnodes;17 /*Now, is the flag ishutter on? otherwise, do nothing: */ 18 if(!ishutter) return; 21 19 22 /*Create nodes if they do not exist yet*/23 if(!nodes) nodes = new Nodes();24 25 /*Now, is the flag ishutter on? otherwise, do nothing: */26 if(!ishutter){27 *pnodes=nodes;28 return;29 }30 31 /*First fetch data: */32 20 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 33 34 for(int i=0;i<iomodel->numberofvertices;i++){ 35 if(iomodel->my_vertices[i]){ 36 37 /*Add node to nodes dataset: */ 38 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,DiagnosticHutterAnalysisEnum)); 39 40 } 41 } 42 43 /*Clean fetched data: */ 21 CreateNodes(pnodes,iomodel,DiagnosticHutterAnalysisEnum,P1Enum); 44 22 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 45 46 /*Assign output pointer: */47 *pnodes=nodes;48 23 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
r15461 r15464 11 11 void CreateNodesDiagnosticVert(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /* Recover pointer: */14 Nodes* nodes=*pnodes;13 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */ 14 if(iomodel->dim==2) return; 15 15 16 /*Create nodes if they do not exist yet*/17 if(!nodes) nodes = new Nodes();18 19 /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */20 if(iomodel->dim==2){21 *pnodes=nodes;22 return;23 }24 25 /*First fetch data: */26 16 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 27 28 for(int i=0;i<iomodel->numberofvertices;i++){ 29 if(iomodel->my_vertices[i]){ 30 31 /*Add node to nodes dataset: */ 32 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,DiagnosticVertAnalysisEnum)); 33 34 } 35 } 36 37 /*Clean fetched data: */ 17 CreateNodes(pnodes,iomodel,DiagnosticVertAnalysisEnum,P1Enum); 38 18 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 39 40 /*Assign output pointer: */41 *pnodes=nodes;42 19 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r15428 r15464 21 21 int my_rank; 22 22 int num_procs; 23 int 24 int 25 int 26 int 27 int 23 int numberofelements2d; 24 int numberofvertices2d; 25 int numlayers; 26 int numrifts; 27 int numvertex_pairing; 28 28 29 29 /*output: */ 30 bool * my_elements=NULL;31 int * my_vertices=NULL;30 bool *my_elements = NULL; 31 int *my_vertices = NULL; 32 32 33 33 /*intermediary: */ 34 int * epart=NULL; //element partitioning.35 int * npart=NULL; //node partitioning.36 int elements_width;//number of columns in elements (2d->3, 3d->6)37 int el1,el2;38 int * elements2d=NULL;39 int * vertex_pairing=NULL;40 IssmDouble * riftinfo=NULL;34 int *epart = NULL; //element partitioning. 35 int *npart = NULL; //node partitioning. 36 int elements_width; //number of columns in elements (2d->3, 3d->6) 37 int el1,el2; 38 int *elements2d = NULL; 39 int *vertex_pairing = NULL; 40 IssmDouble *riftinfo = NULL; 41 41 42 42 /*Get my_rank:*/ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp
r15461 r15464 11 11 void CreateNodesEnthalpy(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Recover pointer: */14 Nodes* nodes=*pnodes;15 16 /*Create nodes if they do not exist yet*/17 if(!nodes) nodes = new Nodes();18 19 /*Create nodes and vertices: */20 13 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 21 22 for(int i=0;i<iomodel->numberofvertices;i++){ 23 if(iomodel->my_vertices[i]){ 24 25 /*Add node to nodes dataset: */ 26 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,EnthalpyAnalysisEnum)); 27 28 } 29 } 30 31 /*Clean fetched data: */ 14 CreateNodes(pnodes,iomodel,EnthalpyAnalysisEnum,P1Enum); 32 15 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 33 34 /*Assign output pointer: */35 *pnodes=nodes;36 16 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Gia/CreateNodesGia.cpp
r15461 r15464 11 11 void CreateNodesGia(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Recover pointer: */14 Nodes* nodes=*pnodes;15 16 /*Create nodes if they do not exist yet*/17 if(!nodes) nodes = new Nodes();18 19 /*First fetch data: */20 13 iomodel->FetchData(1,MaskVertexonwaterEnum); 21 22 /*First fetch data: */ 23 for(int i=0;i<iomodel->numberofvertices;i++){ 24 if(iomodel->my_vertices[i]){ 25 26 /*Add node to nodes dataset: */ 27 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,GiaAnalysisEnum)); 28 29 } 30 } 31 32 /*Clean fetched data: */ 14 CreateNodes(pnodes,iomodel,GiaAnalysisEnum,P1Enum); 33 15 iomodel->DeleteData(1,MaskVertexonwaterEnum); 34 35 /*Assign output pointer: */36 *pnodes=nodes;37 16 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyDCEfficient/CreateNodesHydrologyDCEfficient.cpp
r15461 r15464 11 11 void CreateNodesHydrologyDCEfficient(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/ 14 bool isefficientlayer; 13 /*Now, do we really want DC?*/ 15 14 int hydrology_model; 16 17 /*Recover pointer: */18 Nodes* nodes=*pnodes;19 20 /*Create nodes if they do not exist yet*/21 if(!nodes) nodes = new Nodes();22 23 /*Now, do we really want DC?*/24 15 iomodel->Constant(&hydrology_model,HydrologyModelEnum); 25 if(hydrology_model!=HydrologydcEnum){ 26 *pnodes=nodes; 27 return; 28 } 16 if(hydrology_model!=HydrologydcEnum) return; 29 17 30 18 /*Do we want an efficient layer*/ 19 bool isefficientlayer; 31 20 iomodel->Constant(&isefficientlayer,HydrologydcIsefficientlayerEnum); 32 if(!isefficientlayer){ 33 *pnodes=nodes; 34 return; 35 } 21 if(!isefficientlayer) return; 36 22 37 /*Create nodes and vertices: */38 23 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 39 for(int i=0;i<iomodel->numberofvertices;i++){ 40 41 if(iomodel->my_vertices[i]){ 42 /*Add node to nodes dataset: */ 43 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,HydrologyDCEfficientAnalysisEnum)); 44 45 } 46 } 24 CreateNodes(pnodes,iomodel,HydrologyDCEfficientAnalysisEnum,P1Enum); 47 25 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 48 49 /*Assign output pointer: */50 *pnodes=nodes;51 26 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyDCInefficient/CreateNodesHydrologyDCInefficient.cpp
r15461 r15464 11 11 void CreateNodesHydrologyDCInefficient(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /* Intermediary*/13 /*Fetch parameters: */ 14 14 int hydrology_model; 15 16 /*Fetch parameters: */17 15 iomodel->Constant(&hydrology_model,HydrologyModelEnum); 18 16 19 /* Recover pointer:*/20 Nodes* nodes=*pnodes;17 /*Now, do we really want DC?*/ 18 if(hydrology_model!=HydrologydcEnum) return; 21 19 22 /*Create nodes if they do not exist yet*/23 if(!nodes) nodes = new Nodes();24 25 /*Now, do we really want DC?*/26 if(hydrology_model!=HydrologydcEnum){27 *pnodes=nodes;28 return;29 }30 31 /*Create nodes and vertices: */32 20 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 33 for(int i=0;i<iomodel->numberofvertices;i++){ 34 35 if(iomodel->my_vertices[i]){ 36 /*Add node to nodes dataset: */ 37 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); 38 39 } 40 } 21 CreateNodes(pnodes,iomodel,HydrologyDCInefficientAnalysisEnum,P1Enum); 41 22 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 42 43 /*Assign output pointer: */44 *pnodes=nodes;45 23 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyShreve/CreateNodesHydrologyShreve.cpp
r15461 r15464 11 11 void CreateNodesHydrologyShreve(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /* Intermediary*/13 /*Fetch parameters: */ 14 14 int hydrology_model; 15 16 /*Fetch parameters: */17 15 iomodel->Constant(&hydrology_model,HydrologyModelEnum); 18 16 19 /* Recover pointer:*/20 Nodes* nodes=*pnodes;17 /*Now, do we really want Shreve?*/ 18 if(hydrology_model!=HydrologyshreveEnum) return; 21 19 22 /*Create nodes if they do not exist yet*/23 if(!nodes) nodes = new Nodes();24 25 /*Now, do we really want Shreve?*/26 if(hydrology_model!=HydrologyshreveEnum){27 *pnodes=nodes;28 return;29 }30 31 /*Create nodes and vertices: */32 20 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 33 for(int i=0;i<iomodel->numberofvertices;i++){ 34 35 if(iomodel->my_vertices[i]){ 36 /*Add node to nodes dataset: */ 37 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,HydrologyShreveAnalysisEnum)); 38 } 39 } 21 CreateNodes(pnodes,iomodel,HydrologyShreveAnalysisEnum,P1Enum); 40 22 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 41 42 /*Assign output pointer: */43 *pnodes=nodes;44 23 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
r15461 r15464 11 11 void CreateNodesMelting(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Recover pointer: */14 Nodes* nodes=*pnodes;15 16 /*Create nodes if they do not exist yet*/17 if(!nodes) nodes = new Nodes();18 19 /*First fetch data: */20 13 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 21 for(int i=0;i<iomodel->numberofvertices;i++){ 22 23 if(iomodel->my_vertices[i]){ 24 25 /*Add node to nodes dataset: */ 26 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,MeltingAnalysisEnum)); 27 28 } 29 } 14 CreateNodes(pnodes,iomodel,MeltingAnalysisEnum,P1Enum); 30 15 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 31 32 /*Assign output pointer: */33 *pnodes=nodes;34 16 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
r15461 r15464 23 23 void CreateParametersHydrologyDCEfficient(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type); 24 24 void UpdateElementsAndMaterialsControl(Elements* elements,Materials* materials, IoModel* iomodel); 25 void CreateNodes(Nodes** pnodes, IoModel* iomodel,int analysis,int finite_element); 25 26 26 27 /*Creation of fem datasets: specialised drivers: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
r15461 r15464 11 11 void CreateNodesPrognostic(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/ 14 int i,j; 15 int node_id; 16 int vertex_id; 17 int io_index; 13 /*Fetch parameters: */ 18 14 int stabilization; 19 bool *my_nodes = NULL;20 21 /*Fetch parameters: */22 15 iomodel->Constant(&stabilization,PrognosticStabilizationEnum); 23 24 /*Recover pointer: */25 Nodes* nodes=*pnodes;26 27 /*Create nodes if they do not exist yet*/28 if(!nodes) nodes = new Nodes();29 16 30 17 /*Check in 3d*/ 31 18 if(stabilization==3 && iomodel->dim==3) _error_("DG 3d not implemented yet"); 32 19 33 /* First fetch data:*/20 /*Create Nodes either DG or CG depending on stabilization*/ 34 21 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 35 22 if(stabilization!=3){ 36 37 /*Build Nodes dataset (Continuous Galerkin)*/ 38 for (i=0;i<iomodel->numberofvertices;i++){ 39 40 if(iomodel->my_vertices[i]){ 41 42 /*Add node to nodes dataset: */ 43 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,PrognosticAnalysisEnum)); 44 45 } 46 } 23 CreateNodes(pnodes,iomodel,PrognosticAnalysisEnum,P1Enum); 47 24 } 48 25 else{ 49 50 /*Build Nodes dataset -> 3 for each element (Discontinuous Galerkin)*/ 51 NodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,false); 52 for (i=0;i<iomodel->numberofelements;i++){ 53 for (j=0;j<3;j++){ 54 55 if(my_nodes[3*i+j]){ 56 57 //Get index of the vertex on which the current node is located 58 vertex_id=iomodel->elements[+3*i+j]; //(Matlab indexing) 59 io_index=vertex_id-1; //(C indexing) 60 _assert_(vertex_id>0 && vertex_id<=iomodel->numberofvertices); 61 62 //Compute Node id 63 node_id=iomodel->nodecounter+3*i+j+1; 64 65 /*Add node to nodes dataset: */ 66 nodes->AddObject(new Node(node_id,node_id-1,vertex_id,io_index,iomodel,PrognosticAnalysisEnum)); 67 68 } 69 } 70 } 26 CreateNodes(pnodes,iomodel,PrognosticAnalysisEnum,P1DGEnum); 71 27 } 72 73 /*Clean fetched data: */74 28 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 75 xDelete<bool>(my_nodes);76 77 /*Assign output pointer: */78 *pnodes=nodes;79 29 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/SortDataSets.cpp
r15000 r15464 15 15 void SortDataSets(Elements** pelements,Nodes** pnodes,Vertices** pvertices, Loads** ploads, Materials** pmaterials, Constraints** pconstraints, Parameters** pparameters){ 16 16 17 Elements * elements=NULL;18 Nodes * nodes=NULL;19 Vertices * vertices=NULL;20 Loads * loads=NULL;21 Materials * materials=NULL;22 Constraints * constraints=NULL;23 Parameters * parameters=NULL;17 Elements *elements = NULL; 18 Nodes *nodes = NULL; 19 Vertices *vertices = NULL; 20 Loads *loads = NULL; 21 Materials *materials = NULL; 22 Constraints *constraints = NULL; 23 Parameters *parameters = NULL; 24 24 25 25 /*Recover pointers: */ 26 elements =*pelements;27 nodes =*pnodes;28 vertices =*pvertices;29 loads =*ploads;30 materials =*pmaterials;31 constraints =*pconstraints;32 parameters =*pparameters;26 elements = *pelements; 27 nodes = *pnodes; 28 vertices = *pvertices; 29 loads = *ploads; 30 materials = *pmaterials; 31 constraints = *pconstraints; 32 parameters = *pparameters; 33 33 34 /*All our datasets are already ordered by ids. Set presort flag so that later on, when sorting is requested on these35 * datasets, it will not be redone: */36 37 if(elements) elements->Presort();38 if(nodes) nodes->Presort();39 if(vertices) vertices->Presort();40 if(loads) loads->Presort();41 if(materials) materials->Presort();42 if(constraints) constraints->Presort();43 if(parameters) parameters->Presort();34 /*All our datasets are already ordered by ids. Set presort flag so that 35 * later on, when sorting is requested on these datasets, it will not be 36 * redone: */ 37 if(elements) elements->Presort(); 38 if(nodes) nodes->Presort(); 39 if(vertices) vertices->Presort(); 40 if(loads) loads->Presort(); 41 if(materials) materials->Presort(); 42 if(constraints) constraints->Presort(); 43 if(parameters) parameters->Presort(); 44 44 45 45 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp
r15461 r15464 11 11 void CreateNodesSurfaceSlope(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Recover pointer: */14 Nodes* nodes=*pnodes;15 16 /*Create nodes if they do not exist yet*/17 if(!nodes) nodes = new Nodes();18 19 /*First fetch data: */20 13 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 21 22 for(int i=0;i<iomodel->numberofvertices;i++){ 23 if(iomodel->my_vertices[i]){ 24 25 /*Add node to nodes dataset: */ 26 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,SurfaceSlopeAnalysisEnum)); 27 28 } 29 } 30 31 /*Clean fetched data: */ 14 CreateNodes(pnodes,iomodel,SurfaceSlopeAnalysisEnum,P1Enum); 32 15 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 33 34 /*Assign output pointer: */35 *pnodes=nodes;36 16 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
r15461 r15464 11 11 void CreateNodesThermal(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Recover pointer: */14 Nodes* nodes=*pnodes;15 16 /*Create nodes if they do not exist yet*/17 if(!nodes) nodes = new Nodes();18 19 /*Create nodes and vertices: */20 13 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 21 22 for(int i=0;i<iomodel->numberofvertices;i++){ 23 if(iomodel->my_vertices[i]){ 24 /*Add node to nodes dataset: */ 25 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,ThermalAnalysisEnum)); 26 27 } 28 } 29 30 /*Clean fetched data: */ 14 CreateNodes(pnodes,iomodel,ThermalAnalysisEnum,P1Enum); 31 15 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 32 33 /*Assign output pointer: */34 *pnodes=nodes;35 16 }
Note:
See TracChangeset
for help on using the changeset viewer.