Changeset 4117
- Timestamp:
- 06/22/10 11:00:15 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/CreateNodesBalancedthickness.cpp
r4057 r4117 46 46 47 47 /*Add node to nodes dataset: */ 48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,BalancedthicknessAnalysisEnum));48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,BalancedthicknessAnalysisEnum)); 49 49 50 50 } -
issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/CreateNodesBalancedthickness2.cpp
r4057 r4117 18 18 int i,j; 19 19 bool continuous_galerkin=false; 20 int vertex_index; 21 int node_index; 20 int node_id; 21 int vertex_id; 22 int io_index; 22 23 23 24 /*DataSets: */ … … 53 54 54 55 //Get index of the vertex on which the current node is located 55 vertex_index=(int)*(iomodel->elements+3*i+j)-1; //(Matlab to C indexing) 56 ISSMASSERT(vertex_index>=0 && vertex_index<iomodel->numberofvertices); 56 vertex_id=(int)*(iomodel->elements+3*i+j); //(Matlab indexing) 57 io_index=vertex_id-1; //(C indexing) 58 ISSMASSERT(vertex_id>0 && vertex_id<=iomodel->numberofvertices); 57 59 58 //Compute Node i ndex (id-1)59 node_i ndex=3*i+j;60 //Compute Node id 61 node_id=iomodel->nodecounter+3*i+j+1; 60 62 61 63 /*Add node to nodes dataset: */ 62 nodes->AddObject(new Node( iomodel->nodecounter+i+1,vertex_index,node_index,iomodel,Balancedthickness2AnalysisEnum));64 nodes->AddObject(new Node(node_id,vertex_id,io_index,iomodel,Balancedthickness2AnalysisEnum)); 63 65 64 66 } -
issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/CreateNodesBalancedvelocities.cpp
r4057 r4117 46 46 47 47 /*Add node to nodes dataset: */ 48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,BalancedvelocitiesAnalysisEnum));48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,BalancedvelocitiesAnalysisEnum)); 49 49 50 50 } -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
r4025 r4117 51 51 52 52 /*Add node to nodes dataset: */ 53 nodes->AddObject(new Node(totalnodes+i+1,i ,iomodel,DiagnosticHorizAnalysisEnum));53 nodes->AddObject(new Node(totalnodes+i+1,i+1,i,iomodel,DiagnosticHorizAnalysisEnum)); 54 54 } 55 55 } -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
r4057 r4117 52 52 53 53 /*Add node to nodes dataset: */ 54 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,DiagnosticHutterAnalysisEnum));54 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,DiagnosticHutterAnalysisEnum)); 55 55 56 56 } -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/CreateNodesDiagnosticStokes.cpp
r4057 r4117 50 50 51 51 /*Add node to nodes dataset: */ 52 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,DiagnosticStokesAnalysisEnum));52 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,DiagnosticStokesAnalysisEnum)); 53 53 54 54 } -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp
r4057 r4117 47 47 48 48 /*Add node to nodes dataset: */ 49 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,DiagnosticVertAnalysisEnum));49 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,DiagnosticVertAnalysisEnum)); 50 50 51 51 } -
issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp
r4057 r4117 46 46 47 47 /*Add node to nodes dataset: */ 48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,MeltingAnalysisEnum));48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,MeltingAnalysisEnum)); 49 49 50 50 } -
issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
r4092 r4117 41 41 analysis_type=analysis_type_list[i]; 42 42 43 _printf_(" create datasets for this analysis type:\n");43 _printf_(" create datasets for analysis %s\n",EnumAsString(analysis_type)); 44 44 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,¶meters,iomodel,IOMODEL,solution_type,analysis_type,nummodels,i); 45 45 } -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp
r4057 r4117 46 46 47 47 /*Add node to nodes dataset: */ 48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,PrognosticAnalysisEnum));48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,PrognosticAnalysisEnum)); 49 49 50 50 } -
issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/CreateNodesPrognostic2.cpp
r4057 r4117 17 17 /*Intermediary*/ 18 18 int i,j; 19 int vertex_index;20 int node_index;21 19 bool continuous_galerkin=false; 20 int node_id; 21 int vertex_id; 22 int io_index; 22 23 23 24 /*DataSets: */ … … 52 53 53 54 //Get index of the vertex on which the current node is located 54 vertex_index=(int)*(iomodel->elements+3*i+j)-1; //(Matlab to C indexing) 55 ISSMASSERT(vertex_index>=0 && vertex_index<iomodel->numberofvertices); 55 vertex_id=(int)*(iomodel->elements+3*i+j); //(Matlab indexing) 56 io_index=vertex_id-1; //(C indexing) 57 ISSMASSERT(vertex_id>0 && vertex_id<=iomodel->numberofvertices); 56 58 57 //Compute Node i ndex (id-1)58 node_i ndex=3*i+j;59 //Compute Node id 60 node_id=iomodel->nodecounter+3*i+j+1; 59 61 60 62 /*Add node to nodes dataset: */ 61 nodes->AddObject(new Node( iomodel->nodecounter+node_index+1,vertex_index,node_index,iomodel,Prognostic2AnalysisEnum));63 nodes->AddObject(new Node(node_id,vertex_id,io_index,iomodel,Balancedthickness2AnalysisEnum)); 62 64 63 65 } -
issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/CreateNodesSlopeCompute.cpp
r4057 r4117 46 46 47 47 /*Add node to nodes dataset: */ 48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,SlopeAnalysisEnum));48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,SlopeAnalysisEnum)); 49 49 50 50 } -
issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp
r4057 r4117 46 46 47 47 /*Add node to nodes dataset: */ 48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i ,iomodel,ThermalAnalysisEnum));48 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i+1,i,iomodel,ThermalAnalysisEnum)); 49 49 50 50 } -
issm/trunk/src/c/objects/FemModel.cpp
r4063 r4117 56 56 57 57 analysis_type=analysis_type_list[i]; 58 _printf_(" processing finite element model of analysis %s:\n",EnumAsString(analysis_type)); 58 59 59 _printf_(" create degrees of freedom:\n");60 _printf_(" create degrees of freedom\n"); 60 61 VerticesDofx( &partition,&tpartition,vertices,parameters); 61 62 NodesDofx(nodes,parameters); 62 63 63 _printf_(" create single point constraints:\n");64 _printf_(" create single point constraints\n"); 64 65 SpcNodesx( &m_yg[i], nodes,constraints,analysis_type); 65 66 66 _printf_(" create rigid body constraints:\n");67 _printf_(" create rigid body constraints\n"); 67 68 MpcNodesx( &m_Rmg[i], nodes,constraints,analysis_type); 68 69 69 _printf_(" create node sets:\n");70 _printf_(" create node sets\n"); 70 71 BuildNodeSetsx(&m_nodesets[i], nodes,analysis_type); 71 72 72 _printf_(" reducing single point constraints vector:\n");73 _printf_(" reducing single point constraints vector\n"); 73 74 Reducevectorgtosx(&m_ys[i], m_yg[i],m_nodesets[i]); 74 75 75 _printf_(" normalizing rigid body constraints matrix:\n");76 _printf_(" normalizing rigid body constraints matrix\n"); 76 77 NormalizeConstraintsx(&m_Gmn[i], m_Rmg[i],m_nodesets[i]); 77 78 78 _printf_(" configuring element and loads:\n");79 _printf_(" configuring element and loads\n"); 79 80 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 80 81 } -
issm/trunk/src/c/objects/Node.cpp
r4091 r4117 54 54 } 55 55 /*}}}*/ 56 /*FUNCTION Node::Node(int id, int i, IoModel* iomodel,int analysis_type) -> Continuous Galerkin{{{2*/ 57 Node::Node(int node_id, int i, IoModel* iomodel,int analysis_type){ //i is the node index 58 56 /*FUNCTION Node::Node(int node_id,int vertex_id,int io_index, IoModel* iomodel,int analysis_type) {{{2*/ 57 Node::Node(int node_id,int vertex_id,int io_index, IoModel* iomodel,int analysis_type){ 58 59 /*Intermediary*/ 59 60 int k; 60 61 int numdofs; 61 int vertex_id;62 62 int upper_node_id; 63 63 … … 68 68 /*indexing:*/ 69 69 DistributeNumDofs(&numdofs,analysis_type); //number of dofs per node 70 71 70 this->indexing.Init(numdofs); 72 71 73 72 /*hooks: */ 74 vertex_id=this->id; //node and vertex have the same id, as we are running galerkin continuous, with same number of nodes and vertices.75 76 73 if (iomodel->dim==3){ 77 if (isnan(iomodel->uppernodes[i ])){74 if (isnan(iomodel->uppernodes[io_index])){ 78 75 upper_node_id=this->id; //nodes on surface do not have upper nodes, only themselves. 79 76 } 80 77 else{ 81 upper_node_id=(int)iomodel->uppernodes[i ];78 upper_node_id=(int)iomodel->uppernodes[io_index]; 82 79 } 83 80 } … … 89 86 this->hvertex.Init(&vertex_id,1); //node id is the same as the vertex id, continuous galerkin! 90 87 this->hupper_node.Init(&upper_node_id,1); 88 89 //intialize inputs, and add as many inputs per element as requested: 90 this->inputs=new Inputs(); 91 if (iomodel->gridonbed) this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->gridonbed[io_index])); 92 if (iomodel->gridonsurface) this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->gridonsurface[io_index])); 93 if (iomodel->gridoniceshelf) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->gridoniceshelf[io_index])); 94 if (iomodel->gridonicesheet) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->gridonicesheet[io_index])); 95 if (iomodel->numbernodetoelementconnectivity) this->inputs->AddInput(new IntInput(NumberNodeToElementConnectivityEnum,iomodel->numbernodetoelementconnectivity[io_index])); 91 96 92 97 /*set single point constraints: */ … … 97 102 /*We have a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */ 98 103 if (!iomodel->deadgrids) ISSMERROR("iomodel->deadgrids is NULL"); 99 if (iomodel->deadgrids[i ]){104 if (iomodel->deadgrids[io_index]){ 100 105 for(k=1;k<=numdofs;k++){ 101 106 this->FreezeDof(k); … … 105 110 /*spc all nodes on hutter*/ 106 111 if (!iomodel->gridonhutter) ISSMERROR("iomodel->gridonhutter is NULL"); 107 if (iomodel->gridonhutter[i ]){112 if (iomodel->gridonhutter[io_index]){ 108 113 for(k=1;k<=numdofs;k++){ 109 114 this->FreezeDof(k); … … 116 121 /*On a 3d mesh, in stokes formualtions, only stokes grids are free, the others are frozen: */ 117 122 if (!iomodel->borderstokes) ISSMERROR("iomodel->borderstokes is NULL"); 118 if (iomodel->borderstokes[i ]){123 if (iomodel->borderstokes[io_index]){ 119 124 //freeze everything except pressure 120 125 this->FreezeDof(1); … … 122 127 this->FreezeDof(3); 123 128 } 124 else if (iomodel->gridonstokes[i ]==0){129 else if (iomodel->gridonstokes[io_index]==0){ 125 130 for(k=1;k<=numdofs;k++){ 126 131 this->FreezeDof(k); … … 133 138 /*Spc all nodes that are not Hutter*/ 134 139 if (!iomodel->gridonhutter) ISSMERROR("iomodel->gridonhutter is NULL"); 135 if (!iomodel->gridonhutter[i ]){140 if (!iomodel->gridonhutter[io_index]){ 136 141 for(k=1;k<=numdofs;k++){ 137 142 this->FreezeDof(k); … … 151 156 /*On a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */ 152 157 if (!iomodel->gridonbed) ISSMERROR("iomodel->gridonbed is NULL"); 153 if (!iomodel->gridonbed[i ]){158 if (!iomodel->gridonbed[io_index]){ 154 159 for(k=1;k<=numdofs;k++){ 155 160 this->FreezeDof(k); … … 158 163 } 159 164 } 160 161 //intialize inputs, and add as many inputs per element as requested:162 this->inputs=new Inputs();163 if (iomodel->gridonbed) this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->gridonbed[i]));164 if (iomodel->gridonsurface) this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->gridonsurface[i]));165 if (iomodel->gridoniceshelf) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->gridoniceshelf[i]));166 if (iomodel->gridonicesheet) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->gridonicesheet[i]));167 if (iomodel->numbernodetoelementconnectivity) this->inputs->AddInput(new IntInput(NumberNodeToElementConnectivityEnum,iomodel->numbernodetoelementconnectivity[i]));168 169 }170 /*}}}*/171 /*FUNCTION Node::Node(int id, int i, int j, IoModel* iomodel,int analysis_type) -> Discontinuous Galerkin{{{2*/172 Node::Node(int node_id,int i,int j,IoModel* iomodel,int analysis_type){173 /* i -> index of the vertex in C indexing174 * j -> index of the node in C indexing*/175 176 int numdofs;177 int vertex_id;178 int upper_node_id;179 180 /*id: */181 this->id=node_id; //matlab indexing182 this->analysis_type=analysis_type;183 184 /*indexing:*/185 DistributeNumDofs(&numdofs,analysis_type); //number of dofs per node186 187 this->indexing.Init(numdofs);188 189 190 /*hooks: */191 vertex_id=i+1; //matlab indexing192 193 if (iomodel->dim==3){194 if (isnan(iomodel->uppernodes[i])){195 upper_node_id=this->id; //nodes on surface do not have upper nodes, only themselves.196 }197 else{198 upper_node_id=(int)iomodel->uppernodes[i];199 }200 }201 else{202 /*If we are running 2d, upper_node does not mean much. Just point towards itself!:*/203 upper_node_id=this->id;204 }205 206 this->hvertex.Init(&vertex_id,1);207 this->hupper_node.Init(&upper_node_id,1);208 209 //intialize inputs, and add as many inputs per element as requested:210 this->inputs=new Inputs();211 if (iomodel->gridonbed) this->inputs->AddInput(new BoolInput(NodeOnBedEnum,(IssmBool)iomodel->gridonbed[i]));212 if (iomodel->gridonsurface) this->inputs->AddInput(new BoolInput(NodeOnSurfaceEnum,(IssmBool)iomodel->gridonsurface[i]));213 if (iomodel->gridoniceshelf) this->inputs->AddInput(new BoolInput(NodeOnIceShelfEnum,(IssmBool)iomodel->gridoniceshelf[i]));214 if (iomodel->gridonicesheet) this->inputs->AddInput(new BoolInput(NodeOnIceSheetEnum,(IssmBool)iomodel->gridonicesheet[i]));215 216 165 217 166 } … … 420 369 } 421 370 /*}}}*/ 422 /*FUNCTION Node::InAnalysis(int analysis_type){{{ 1*/371 /*FUNCTION Node::InAnalysis(int analysis_type){{{2*/ 423 372 bool Node::InAnalysis(int in_analysis_type){ 424 373 if (in_analysis_type=this->analysis_type)return true; 425 374 else return false; 426 375 } 376 /*}}}*/ 427 377 /*}}}*/ 428 378 /*Object numerics: {{{1*/ -
issm/trunk/src/c/objects/Node.h
r4091 r4117 36 36 Node(int id,int vertex_id, int upper_node_id, int numberofdofs); 37 37 Node(int id,DofIndexing* indexing, Hook* vertex, Hook* upper_node, Inputs* inputs,int analysis_type); 38 Node(int id, int i, IoModel* iomodel,int analysis_type); 39 Node(int id, int i,int j,IoModel* iomodel,int analysis_type); 38 Node(int node_id,int vertex_id,int io_index, IoModel* iomodel,int analysis_type); 40 39 ~Node(); 41 40 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.