Changeset 15461
- Timestamp:
- 07/08/13 14:47:31 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 1 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r15435 r15461 243 243 ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\ 244 244 ./modules/ModelProcessorx/NodesPartitioning.cpp\ 245 ./modules/ModelProcessorx/EdgesPartitioning.cpp\ 245 246 ./modules/ModelProcessorx/SortDataSets.cpp\ 246 247 ./modules/ModelProcessorx/UpdateCounters.cpp\ -
issm/trunk-jpl/src/c/classes/IoModel.cpp
r15435 r15461 28 28 29 29 this->my_elements=NULL; 30 this->my_nodes=NULL;31 30 this->my_vertices=NULL; 32 31 … … 70 69 /*Initialize permanent data: */ 71 70 this->my_elements = NULL; 72 this->my_nodes = NULL;73 71 this->my_vertices = NULL; 74 72 … … 108 106 109 107 xDelete<bool>(this->my_elements); 110 xDelete<bool>(this->my_nodes);111 108 xDelete<int>(this->my_vertices); 112 109 -
issm/trunk-jpl/src/c/classes/IoModel.h
r15435 r15461 28 28 /*Partitioning*/ 29 29 bool *my_elements; 30 bool *my_nodes;31 30 int *my_vertices; 32 31 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp
r15428 r15461 16 16 int vertex_id; 17 17 int io_index; 18 bool continuous_galerkin=true;19 18 int stabilization; 19 bool *my_nodes=NULL; 20 20 21 21 /*Fetch parameters: */ … … 28 28 if(!nodes) nodes = new Nodes(); 29 29 30 /*Continuous Galerkin partition of nodes: */31 if(stabilization==3) continuous_galerkin=false;32 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);33 34 30 /*Check in 3d*/ 35 31 if(stabilization==3 && iomodel->dim==3) _error_("DG 3d not implemented yet"); … … 38 34 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 39 35 40 if( continuous_galerkin){36 if(stabilization!=3){ 41 37 42 38 /*Build Nodes dataset (Continuous Galerkin)*/ … … 53 49 54 50 /*Build Nodes dataset -> 3 for each element (Discontinuous Galerkin)*/ 51 NodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,false); 55 52 for (i=0;i<iomodel->numberofelements;i++){ 56 53 for (j=0;j<3;j++){ 57 54 58 if( iomodel->my_nodes[3*i+j]){55 if(my_nodes[3*i+j]){ 59 56 60 57 //Get index of the vertex on which the current node is located … … 76 73 /*Clean fetched data: */ 77 74 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 75 xDelete<bool>(my_nodes); 78 76 79 77 /*Assign output pointer: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp
r15428 r15461 11 11 void CreateNodesBedSlope(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/14 bool continuous_galerkin=true;15 16 13 /*Recover pointer: */ 17 14 Nodes* nodes=*pnodes; … … 19 16 /*Create nodes if they do not exist yet*/ 20 17 if(!nodes) nodes = new Nodes(); 21 22 /*Continuous Galerkin partition of nodes: */23 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);24 18 25 19 /*First fetch data: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r15451 r15461 317 317 if(ismacayealpattyn&& fe_ssa==1){ 318 318 319 int v1,v2,el1,el2;320 bool my_edge;319 int v1,v2; 320 bool *my_edges = NULL; 321 321 322 322 if(Mx!=iomodel->numberofvertices) _error_("transient spc not supported yet"); 323 CreateEdges(iomodel);323 EdgesPartitioning(&my_edges,iomodel); 324 324 325 325 for(i=0;i<iomodel->numberofedges;i++){ 326 326 327 v1 = iomodel->edges[4*i+0]-1; 328 v2 = iomodel->edges[4*i+1]-1; 329 el1= iomodel->edges[4*i+2]-1; 330 el2= iomodel->edges[4*i+3]-1; 331 332 my_edge = iomodel->my_elements[el1]; 333 if(!my_edge && el2>=0){ 334 my_edge = iomodel->my_elements[el2]; 335 } 336 337 if(my_edge){ 327 if(my_edges[i]){ 328 329 v1 = iomodel->edges[4*i+0]-1; 330 v2 = iomodel->edges[4*i+1]-1; 331 338 332 if(!xIsNan<IssmDouble>(spcvx[v1]) && !xIsNan<IssmDouble>(spcvx[v2])){ 339 333 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+iomodel->numberofvertices+i+1, … … 355 349 } 356 350 } 351 352 /*Clean up*/ 353 xDelete<bool>(my_edges); 357 354 } 358 355 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
r15439 r15461 12 12 13 13 /*Intermediary*/ 14 bool continuous_galerkin=true;15 14 bool isstokes,isl1l2,ismacayealpattyn; 16 15 int finiteelementssa; … … 34 33 } 35 34 36 /*Continuous Galerkin partition of nodes: */37 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);38 39 35 /*Create nodes: */ 40 36 iomodel->FetchData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBordermacayealEnum,FlowequationBorderstokesEnum, … … 53 49 54 50 /*Quadratic element*/ 55 CreateEdges(iomodel); 51 bool *my_edges = NULL; 52 EdgesPartitioning(&my_edges,iomodel); 56 53 CreateElementToEdgeConnectivity(iomodel); 57 int element1,element2;58 bool my_edge;59 54 60 55 for(int i=0;i<iomodel->numberofedges;i++){ 61 62 /*Get left and right elements*/ 63 element1=iomodel->edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2] 64 element2=iomodel->edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2] 65 66 /*Check whether we should include this edge (element2 is -2 for boundary edges)*/ 67 my_edge = iomodel->my_elements[element1]; 68 if(!my_edge && element2>=0){ 69 my_edge = iomodel->my_elements[element2]; 70 } 71 72 /*Add node on edge*/ 73 if(my_edge){ 56 if(my_edges[i]){ 74 57 nodes->AddObject(new Node(iomodel->nodecounter+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,0,0,iomodel,DiagnosticHorizAnalysisEnum)); 75 58 } 76 59 } 60 /*Clean up*/ 61 xDelete<bool>(my_edges); 77 62 } 78 63 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
r15428 r15461 12 12 13 13 /*Intermediary*/ 14 bool continuous_galerkin = true;15 14 bool ishutter; 16 15 … … 29 28 return; 30 29 } 31 32 /*Continuous Galerkin partition of nodes: */33 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);34 30 35 31 /*First fetch data: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
r15428 r15461 11 11 void CreateNodesDiagnosticVert(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/14 bool continuous_galerkin=true;15 16 13 /*Recover pointer: */ 17 14 Nodes* nodes=*pnodes; … … 25 22 return; 26 23 } 27 28 /*Continuous Galerkin partition of nodes: */29 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);30 24 31 25 /*First fetch data: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp
r15428 r15461 11 11 void CreateNodesEnthalpy(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/14 bool continuous_galerkin=true;15 16 13 /*Recover pointer: */ 17 14 Nodes* nodes=*pnodes; … … 19 16 /*Create nodes if they do not exist yet*/ 20 17 if(!nodes) nodes = new Nodes(); 21 22 /*Continuous Galerkin partition of nodes: */23 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);24 18 25 19 /*Create nodes and vertices: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Gia/CreateNodesGia.cpp
r15428 r15461 11 11 void CreateNodesGia(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/14 bool continuous_galerkin=true;15 16 13 /*Recover pointer: */ 17 14 Nodes* nodes=*pnodes; … … 19 16 /*Create nodes if they do not exist yet*/ 20 17 if(!nodes) nodes = new Nodes(); 21 22 /*Continuous Galerkin partition of nodes: */23 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);24 18 25 19 /*First fetch data: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyDCEfficient/CreateNodesHydrologyDCEfficient.cpp
r15428 r15461 13 13 /*Intermediary*/ 14 14 bool isefficientlayer; 15 bool continuous_galerkin=true;16 15 int hydrology_model; 17 16 … … 36 35 } 37 36 38 /*Continuous Galerkin partition of nodes: */39 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);40 41 37 /*Create nodes and vertices: */ 42 38 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyDCInefficient/CreateNodesHydrologyDCInefficient.cpp
r15428 r15461 12 12 13 13 /*Intermediary*/ 14 bool continuous_galerkin=true;15 14 int hydrology_model; 16 15 … … 30 29 } 31 30 32 /*Continuous Galerkin partition of nodes: */33 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);34 35 31 /*Create nodes and vertices: */ 36 32 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/HydrologyShreve/CreateNodesHydrologyShreve.cpp
r15428 r15461 13 13 /*Intermediary*/ 14 14 int hydrology_model; 15 bool continuous_galerkin=true;16 15 17 16 /*Fetch parameters: */ … … 30 29 } 31 30 32 /*Continuous Galerkin partition of nodes: */33 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);34 35 31 /*Create nodes and vertices: */ 36 32 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
r15428 r15461 11 11 void CreateNodesMelting(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/14 bool continuous_galerkin=true;15 16 13 /*Recover pointer: */ 17 14 Nodes* nodes=*pnodes; … … 19 16 /*Create nodes if they do not exist yet*/ 20 17 if(!nodes) nodes = new Nodes(); 21 22 /*Continuous Galerkin partition of nodes: */23 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);24 18 25 19 /*First fetch data: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
r15435 r15461 116 116 void ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel); 117 117 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, bool continuous); 118 void EdgesPartitioning(bool** pmy_nodes,IoModel* iomodel); 118 119 119 120 /*Connectivity*/ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp
r15435 r15461 20 20 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, bool continuous){ 21 21 22 /*First thing, this is a new partition for a new analysis_type, therefore,23 * to avoid a leak, erase the nodes partition that might come through24 * pmy_nodes: */25 xDelete<bool>(*pmy_nodes);26 27 /*Now, depending on whether we are running galerkin discontinous or continuous elements, carry out a different partition of the nodes: */28 22 if(continuous==true) 29 23 ContinuousGalerkinNodesPartitioning(pmy_nodes,my_elements, my_vertices, iomodel); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
r15428 r15461 16 16 int vertex_id; 17 17 int io_index; 18 bool continuous_galerkin=true;19 18 int stabilization; 19 bool *my_nodes = NULL; 20 20 21 21 /*Fetch parameters: */ … … 28 28 if(!nodes) nodes = new Nodes(); 29 29 30 /*Create partition of nodes: */31 if(stabilization==3) continuous_galerkin=false;32 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);33 34 30 /*Check in 3d*/ 35 31 if(stabilization==3 && iomodel->dim==3) _error_("DG 3d not implemented yet"); … … 37 33 /*First fetch data: */ 38 34 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 39 if( continuous_galerkin){35 if(stabilization!=3){ 40 36 41 37 /*Build Nodes dataset (Continuous Galerkin)*/ … … 53 49 54 50 /*Build Nodes dataset -> 3 for each element (Discontinuous Galerkin)*/ 51 NodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,false); 55 52 for (i=0;i<iomodel->numberofelements;i++){ 56 53 for (j=0;j<3;j++){ 57 54 58 if( iomodel->my_nodes[3*i+j]){55 if(my_nodes[3*i+j]){ 59 56 60 57 //Get index of the vertex on which the current node is located … … 76 73 /*Clean fetched data: */ 77 74 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 75 xDelete<bool>(my_nodes); 78 76 79 77 /*Assign output pointer: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp
r15428 r15461 11 11 void CreateNodesSurfaceSlope(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/14 bool continuous_galerkin=true;15 16 13 /*Recover pointer: */ 17 14 Nodes* nodes=*pnodes; … … 19 16 /*Create nodes if they do not exist yet*/ 20 17 if(!nodes) nodes = new Nodes(); 21 22 /*Continuous Galerkin partition of nodes: */23 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);24 18 25 19 /*First fetch data: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
r15428 r15461 11 11 void CreateNodesThermal(Nodes** pnodes, IoModel* iomodel){ 12 12 13 /*Intermediary*/14 bool continuous_galerkin=true;15 16 13 /*Recover pointer: */ 17 14 Nodes* nodes=*pnodes; … … 19 16 /*Create nodes if they do not exist yet*/ 20 17 if(!nodes) nodes = new Nodes(); 21 22 /*Continuous Galerkin partition of nodes: */23 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);24 18 25 19 /*Create nodes and vertices: */
Note:
See TracChangeset
for help on using the changeset viewer.