Changeset 24089
- Timestamp:
- 07/15/19 04:40:13 (6 years ago)
- Location:
- issm/trunk-jpl/src/c/classes
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.cpp ¶
r24049 r24089 1318 1318 1319 1319 }/*}}}*/ 1320 Node* Element::GetNode(int nodeindex){/*{{{*/ 1321 _assert_(nodeindex>=0); 1322 _assert_(nodeindex<this->GetNumberOfNodes(this->element_type)); 1323 return this->nodes[nodeindex]; 1324 }/*}}}*/ 1325 int Element::GetNodeIndex(Node* node){/*{{{*/ 1326 1327 _assert_(this->nodes); 1328 int numnodes = this->GetNumberOfNodes(this->element_type); 1329 1330 for(int i=0;i<numnodes;i++){ 1331 if(node==nodes[i]) return i; 1332 } 1333 _error_("Node provided not found among element nodes"); 1334 1335 } 1336 /*}}}*/ 1320 1337 void Element::GetNodesLidList(int* lidlist){/*{{{*/ 1321 1338 -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.h ¶
r24049 r24089 98 98 void GetInputValue(IssmDouble* pvalue,Gauss* gauss,int enum_type); 99 99 void GetInputsInterpolations(Vector<IssmDouble>* interps); 100 Node* GetNode(int nodeindex); 101 int GetNodeIndex(Node* node); 100 102 void GetNodesLidList(int* lidlist); 101 103 void GetNodesSidList(int* sidlist); … … 233 235 virtual IssmDouble GetIcefrontArea(){_error_("not implemented");}; 234 236 virtual void GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum)=0; 235 virtual void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0; 237 virtual void GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){_error_("not implemented yet");}; 238 virtual void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype){_error_("not implemented yet");}; 236 239 virtual void GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level)=0; 237 240 virtual void GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues)=0; 238 virtual Node* GetNode(int node_number)=0; 239 virtual int GetNodeIndex(Node* node)=0; 241 virtual int GetVertexIndex(Vertex* vertex){_error_("not implemented");};; 240 242 virtual int GetNumberOfNodes(void)=0; 241 243 virtual int GetNumberOfNodes(int enum_type)=0; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp ¶
r24021 r24089 1221 1221 if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria"); 1222 1222 1223 int index = this->GetNodeIndex(node); 1224 1223 1225 GaussPenta* gauss=new GaussPenta(); 1224 gauss->GaussVertex(this->GetNodeIndex(node)); 1226 gauss->GaussNode(this->element_type,index); 1227 1228 input->GetInputValue(pvalue,gauss); 1229 delete gauss; 1230 } 1231 /*}}}*/ 1232 void Penta::GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){/*{{{*/ 1233 1234 Input* input=inputs->GetInput(enumtype); 1235 if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria"); 1236 1237 int index = this->GetVertexIndex(vertex); 1238 1239 GaussPenta* gauss=new GaussPenta(); 1240 gauss->GaussVertex(index); 1225 1241 1226 1242 input->GetInputValue(pvalue,gauss); … … 1313 1329 } 1314 1330 /*}}}*/ 1315 Node* Penta::GetNode(int node_number){/*{{{*/ 1316 _assert_(node_number>=0); 1317 _assert_(node_number<this->NumberofNodes(this->element_type)); 1318 return this->nodes[node_number]; 1319 } 1320 /*}}}*/ 1321 int Penta::GetNodeIndex(Node* node){/*{{{*/ 1322 1323 _assert_(nodes); 1324 int numnodes = this->NumberofNodes(this->element_type); 1325 1326 for(int i=0;i<numnodes;i++){ 1327 if(node==nodes[i]) return i; 1328 } 1329 _error_("Node provided not found among element nodes"); 1330 1331 int Penta::GetVertexIndex(Vertex* vertex){/*{{{*/ 1332 1333 _assert_(vertices); 1334 for(int i=0;i<NUMVERTICES;i++){ 1335 if(vertex==vertices[i]) 1336 return i; 1337 } 1338 _error_("Vertex provided not found among element vertices"); 1331 1339 } 1332 1340 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.h ¶
r24020 r24089 77 77 IssmDouble GetIcefrontArea(); 78 78 void GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum); 79 void GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype); 79 80 void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype); 80 81 void GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level){_error_("not implemented yet");}; 81 82 void GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues){_error_("not implemented yet");}; 82 83 void GetLevelsetIntersectionBase(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level); 83 Node* GetNode(int node_number);84 int GetNodeIndex(Node* node);85 84 int GetNumberOfNodes(void); 86 85 int GetNumberOfNodes(int enum_type); … … 90 89 void GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data); 91 90 void GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data,int offset); 91 int GetVertexIndex(Vertex* vertex); 92 92 void GetVerticesCoordinatesBase(IssmDouble** pxyz_list); 93 93 void GetVerticesCoordinatesTop(IssmDouble** pxyz_list); -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Seg.h ¶
r24020 r24089 63 63 IssmDouble GetGroundedPortion(IssmDouble* xyz_list); 64 64 void GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum); 65 void GetInputValue(IssmDouble* pvalue, Node* node,int enumtype){_error_("not implemented yet");};65 void GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){_error_("not implemented yet");}; 66 66 void GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level){_error_("not implemented");}; 67 67 void GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues){_error_("not implemented yet");}; 68 Node* GetNode(int node_number){_error_("Not implemented");};69 int GetNodeIndex(Node* node){_error_("not implemented yet");};70 68 int GetNumberOfNodes(void); 71 69 int GetNumberOfNodes(int enum_type){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp ¶
r23644 r24089 256 256 input->GetInputValue(pvalue,gauss); 257 257 delete gauss; 258 }259 /*}}}*/260 int Tetra::GetNodeIndex(Node* node){/*{{{*/261 262 _assert_(nodes);263 int numnodes = this->NumberofNodes(this->element_type);264 265 for(int i=0;i<numnodes;i++){266 if(node==nodes[i]) return i;267 }268 _error_("Node provided not found among element nodes");269 270 258 } 271 259 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tetra.h ¶
r24020 r24089 72 72 void GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level){_error_("not implemented yet");}; 73 73 void GetLevelsetPositivePart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlynegative,IssmDouble* levelsetvalues){_error_("not implemented yet");}; 74 Node* GetNode(int node_number){_error_("Not implemented");};75 int GetNodeIndex(Node* node);76 74 int GetNumberOfNodes(void); 77 75 int GetNumberOfNodes(int enum_type){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp ¶
r24088 r24089 1832 1832 if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria"); 1833 1833 1834 int index = this->GetNodeIndex(node); 1835 1834 1836 GaussTria* gauss=new GaussTria(); 1835 gauss->GaussVertex(this->GetNodeIndex(node)); 1837 gauss->GaussNode(this->element_type,index); 1838 1839 input->GetInputValue(pvalue,gauss); 1840 delete gauss; 1841 } 1842 /*}}}*/ 1843 void Tria::GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype){/*{{{*/ 1844 1845 Input* input=inputs->GetInput(enumtype); 1846 if(!input) _error_("No input of type " << EnumToStringx(enumtype) << " found in tria"); 1847 1848 int index = this->GetVertexIndex(vertex); 1849 1850 GaussTria* gauss=new GaussTria(); 1851 gauss->GaussVertex(index); 1836 1852 1837 1853 input->GetInputValue(pvalue,gauss); … … 2007 2023 } 2008 2024 /*}}}*/ 2009 Node* Tria::GetNode(int node_number){/*{{{*/2010 _assert_(node_number>=0);2011 _assert_(node_number<this->NumberofNodes(this->element_type));2012 return this->nodes[node_number];2013 2014 }/*}}}*/2015 int Tria::GetNodeIndex(Node* node){/*{{{*/2016 2017 _assert_(nodes);2018 for(int i=0;i<NUMVERTICES;i++){2019 if(node==nodes[i])2020 return i;2021 }2022 _error_("Node provided not found among element nodes");2023 }2024 /*}}}*/2025 2025 int Tria::GetVertexIndex(Vertex* vertex){/*{{{*/ 2026 2026 … … 2030 2030 return i; 2031 2031 } 2032 _error_("Vertex provided not found among element nodes");2032 _error_("Vertex provided not found among element vertices"); 2033 2033 } 2034 2034 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.h ¶
r24088 r24089 84 84 void GetIcefrontCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum); 85 85 void GetLevelCoordinates(IssmDouble** pxyz_front,IssmDouble* xyz_list,int levelsetenum,IssmDouble level); 86 int GetNodeIndex(Node* node);87 86 int GetVertexIndex(Vertex* vertex); 88 87 int GetNumberOfNodes(void); … … 180 179 int GetElementType(void); 181 180 void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype); 182 void GetLevelsetIntersection(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level); 181 void GetInputValue(IssmDouble* pvalue,Vertex* vertex,int enumtype); 182 void GetLevelsetIntersection(int** pindices, int* pnumiceverts, IssmDouble* fraction, int levelset_enum, IssmDouble level); 183 183 void GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype); 184 Node* GetNode(int node_number);185 184 void InputUpdateFromSolutionOneDof(IssmDouble* solution,int enum_type); 186 185 void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int enum_type){_error_("not implemented yet");}; -
TabularUnified issm/trunk-jpl/src/c/classes/Elements/TriaRef.cpp ¶
r23962 r24089 157 157 case NoneEnum: 158 158 return; 159 case P0Enum: 159 case P0Enum: case P0DGEnum: 160 160 basis[0]=1.; 161 161 return; … … 369 369 370 370 switch(finiteelement){ 371 case P0Enum: 371 case P0Enum: case P0DGEnum: 372 372 /*Nodal function 1*/ 373 373 dbasis[NUMNODESP0*0+0] = 0.; … … 512 512 case NoneEnum: return 0; 513 513 case P0Enum: return NUMNODESP0; 514 case P0DGEnum: return NUMNODESP0; 514 515 case P1Enum: return NUMNODESP1; 515 516 case P1DGEnum: return NUMNODESP1; -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Channel.cpp ¶
r24080 r24089 355 355 if(!tria->IsIceInElement()) return NULL; 356 356 _assert_(tria->FiniteElement()==P1Enum); 357 int index1=tria->Get NodeIndex(nodes[0]);358 int index2=tria->Get NodeIndex(nodes[1]);357 int index1=tria->GetVertexIndex(vertices[0]); 358 int index2=tria->GetVertexIndex(vertices[1]); 359 359 360 360 /*Intermediaries */ … … 488 488 if(!tria->IsIceInElement()) return NULL; 489 489 _assert_(tria->FiniteElement()==P1Enum); 490 int index1=tria->Get NodeIndex(nodes[0]);491 int index2=tria->Get NodeIndex(nodes[1]);490 int index1=tria->GetVertexIndex(vertices[0]); 491 int index2=tria->GetVertexIndex(vertices[1]); 492 492 493 493 /*Intermediaries */ … … 605 605 } 606 606 _assert_(tria->FiniteElement()==P1Enum); 607 int index1=tria->Get NodeIndex(nodes[0]);608 int index2=tria->Get NodeIndex(nodes[1]);607 int index1=tria->GetVertexIndex(vertices[0]); 608 int index2=tria->GetVertexIndex(vertices[1]); 609 609 610 610 /*Intermediaries */ -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp ¶
r24069 r24089 23 23 this->parameters=NULL; 24 24 this->hnode=NULL; 25 this->hvertex=NULL; 25 26 this->node=NULL; 26 27 this->helement=NULL; … … 47 48 48 49 this->hnode=new Hook(&pengrid_node_id,1); 50 this->hvertex=new Hook(&pengrid_node_id,1); 49 51 this->helement=new Hook(&pengrid_element_id,1); 50 52 … … 52 54 this->parameters=NULL; 53 55 this->node=NULL; 56 this->vertex=NULL; 54 57 this->element=NULL; 55 58 } … … 57 60 Moulin::~Moulin(){/*{{{*/ 58 61 delete hnode; 62 delete hvertex; 59 63 delete helement; 60 64 return; … … 77 81 /*now deal with hooks and objects: */ 78 82 pengrid->hnode=(Hook*)this->hnode->copy(); 83 pengrid->hvertex=(Hook*)this->hvertex->copy(); 79 84 pengrid->helement=(Hook*)this->helement->copy(); 80 85 81 86 /*corresponding fields*/ 82 87 pengrid->node =(Node*)pengrid->hnode->delivers(); 88 pengrid->vertex=(Vertex*)pengrid->hvertex->delivers(); 83 89 pengrid->element=(Element*)pengrid->helement->delivers(); 84 90 … … 91 97 _printf_(" id: " << id << "\n"); 92 98 hnode->DeepEcho(); 99 hvertex->DeepEcho(); 93 100 helement->DeepEcho(); 94 101 _printf_(" parameters\n"); … … 112 119 if(marshall_direction==MARSHALLING_BACKWARD){ 113 120 this->hnode = new Hook(); 121 this->hvertex = new Hook(); 114 122 this->helement = new Hook(); 115 123 } 116 124 117 125 this->hnode->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 126 this->hvertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 118 127 this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 119 128 120 129 /*corresponding fields*/ 121 130 node =(Node*)this->hnode->delivers(); 131 vertex =(Vertex*)this->hvertex->delivers(); 122 132 element=(Element*)this->helement->delivers(); 123 133 } … … 135 145 * datasets, using internal ids and offsets hidden in hooks: */ 136 146 hnode->configure(nodesin); 147 hvertex->configure(verticesin); 137 148 helement->configure(elementsin); 138 149 139 150 /*Get corresponding fields*/ 140 151 node=(Node*)hnode->delivers(); 152 vertex=(Vertex*)hvertex->delivers(); 141 153 element=(Element*)helement->delivers(); 142 154 … … 252 264 /*Get Element type*/ 253 265 this->hnode->reset(); 266 this->hvertex->reset(); 254 267 this->helement->reset(); 255 268 -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Moulin.h ¶
r24053 r24089 26 26 27 27 /*Hooks*/ 28 Hook* hnode; //hook to 1 node 28 Hook* hnode; //hook to 1 node 29 Hook* hvertex; //hook to 1 vertex 29 30 Hook* helement; //hook to 1 element 30 31 31 32 /*Corresponding fields*/ 32 33 Node *node; 34 Vertex *vertex; 33 35 Element *element; 34 36 -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp ¶
r23970 r24089 364 364 365 365 /*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/ 366 int index1=tria->Get NodeIndex(nodes[0]);367 int index2=tria->Get NodeIndex(nodes[1]);366 int index1=tria->GetVertexIndex(vertices[0]); 367 int index2=tria->GetVertexIndex(vertices[1]); 368 368 369 369 /* Start looping on the number of gaussian points: */ … … 408 408 409 409 /*Check wether it is an inflow or outflow BC (0 is the middle of the segment)*/ 410 int index1=tria->Get NodeIndex(nodes[0]);411 int index2=tria->Get NodeIndex(nodes[1]);410 int index1=tria->GetVertexIndex(vertices[0]); 411 int index2=tria->GetVertexIndex(vertices[1]); 412 412 413 413 /* Start looping on the number of gaussian points: */ -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp ¶
r24088 r24089 32 32 /* Intermediary */ 33 33 int pos1,pos2,pos3,pos4; 34 int num _nodes;34 int numnodes; 35 35 36 36 /*numericalflux constructor data: */ … … 50 50 if(e2==-1){ 51 51 /* Boundary edge, only one element */ 52 num_nodes=2;53 52 numericalflux_type=BoundaryEnum; 54 53 numericalflux_elem_ids[0]=e1; … … 56 55 else{ 57 56 /* internal edge: connected to 2 elements */ 58 num_nodes=4;59 57 numericalflux_type=InternalEnum; 60 58 numericalflux_elem_ids[0]=e1; … … 64 62 /*FIXME: hardcode element degree for now*/ 65 63 this->flux_degree= P1DGEnum; 64 //printf("-------------- file: Numericalflux.cpp line: %i\n",__LINE__); 65 //this->flux_degree= P0DGEnum; 66 66 67 67 /*1: Get vertices ids*/ … … 103 103 } 104 104 105 switch(this->flux_degree){ 106 case P0DGEnum: 107 if(numericalflux_type==InternalEnum) numnodes = 2; 108 else numnodes = 1; 109 for(int i=0;i<numnodes;i++) numericalflux_node_ids[i] = numericalflux_elem_ids[i]; 110 numericalflux_node_ids[1] = numericalflux_elem_ids[1]; 111 break; 112 case P1DGEnum: 113 if(numericalflux_type==InternalEnum) numnodes = 4; 114 else numnodes = 2; 115 for(int i=0;i<numnodes;i++) numericalflux_node_ids[i] = numericalflux_node_ids[i]; //FIXME: to be improved... 116 break; 117 default: 118 _error_("not supported yet"); 119 120 } 121 105 122 /*Assign object fields: */ 106 123 this->id = numericalflux_id; … … 109 126 110 127 /*Hooks: */ 111 this->hnodes = new Hook(numericalflux_node_ids,num _nodes);128 this->hnodes = new Hook(numericalflux_node_ids,numnodes); 112 129 this->hvertices = new Hook(&numericalflux_vertex_ids[0],2); 113 130 this->helement = new Hook(numericalflux_elem_ids,1); // take only the first element for now … … 363 380 void Numericalflux::ResetHooks(){/*{{{*/ 364 381 365 this->nodes =NULL;366 this->vertices =NULL;367 this->element =NULL;368 this->parameters =NULL;382 this->nodes = NULL; 383 this->vertices = NULL; 384 this->element = NULL; 385 this->parameters = NULL; 369 386 370 387 /*Get Element type*/ … … 376 393 /*}}}*/ 377 394 void Numericalflux::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/ 395 /*Nothing to do :)*/ 378 396 379 397 } -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp ¶
r23959 r24089 23 23 this->parameters=NULL; 24 24 this->hnodes=NULL; 25 this->hvertices=NULL; 25 26 this->helements=NULL; 26 27 this->nodes=NULL; 28 this->vertices=NULL; 27 29 this->elements=NULL; 28 30 } … … 63 65 /*Hooks: */ 64 66 this->hnodes=new Hook(riftfront_node_ids,2); 67 this->hvertices=new Hook(riftfront_node_ids,2); 65 68 this->helements=new Hook(riftfront_elem_ids,2); 66 69 … … 88 91 this->parameters=NULL; 89 92 this->nodes= NULL; 93 this->vertices= NULL; 90 94 this->elements= NULL; 91 95 … … 95 99 this->parameters=NULL; 96 100 delete hnodes; 101 delete hvertices; 97 102 delete helements; 98 103 } … … 119 124 /*now deal with hooks and objects: */ 120 125 riftfront->hnodes=(Hook*)this->hnodes->copy(); 126 riftfront->hvertices=(Hook*)this->hvertices->copy(); 121 127 riftfront->helements=(Hook*)this->helements->copy(); 122 128 123 129 /*corresponding fields*/ 124 130 riftfront->nodes =(Node**)riftfront->hnodes->deliverp(); 131 riftfront->vertices=(Vertex**)riftfront->hvertices->deliverp(); 125 132 riftfront->elements=(Element**)riftfront->helements->deliverp(); 126 133 … … 147 154 _printf_(" id: " << id << "\n"); 148 155 hnodes->DeepEcho(); 156 hvertices->DeepEcho(); 149 157 helements->DeepEcho(); 150 158 _printf_(" parameters\n"); … … 157 165 _printf_(" id: " << id << "\n"); 158 166 _printf_(" hnodes: " << hnodes << "\n"); 167 _printf_(" hvertices: " << hvertices << "\n"); 159 168 _printf_(" helements: " << helements << "\n"); 160 169 _printf_(" parameters: " << parameters << "\n"); … … 193 202 if(marshall_direction==MARSHALLING_BACKWARD){ 194 203 this->hnodes = new Hook(); 204 this->hvertices = new Hook(); 195 205 this->helements = new Hook(); 196 206 } 197 207 198 208 this->hnodes->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 209 this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 199 210 this->helements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 200 211 201 212 /*corresponding fields*/ 202 213 nodes =(Node**)this->hnodes->deliverp(); 214 vertices =(Vertex**)this->hvertices->deliverp(); 203 215 elements =(Element**)this->helements->deliverp(); 204 216 … … 245 257 * datasets, using internal ids and offsets hidden in hooks: */ 246 258 hnodes->configure(nodesin); 259 hvertices->configure(verticesin); 247 260 helements->configure(elementsin); 248 261 249 262 /*Initialize hooked fields*/ 250 263 this->nodes =(Node**)hnodes->deliverp(); 264 this->vertices=(Vertex**)hvertices->deliverp(); 251 265 this->elements=(Element**)helements->deliverp(); 252 266 … … 344 358 345 359 this->nodes=NULL; 360 this->vertices=NULL; 346 361 this->elements=NULL; 347 362 this->parameters=NULL; … … 349 364 /*Get Element type*/ 350 365 this->hnodes->reset(); 366 this->hvertices->reset(); 351 367 this->helements->reset(); 352 368 … … 420 436 IssmDouble penalty_offset; 421 437 422 /*Objects: */423 Tria *tria1 = NULL;424 Tria *tria2 = NULL;425 426 438 /*enum of element? */ 427 439 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 428 tria1=(Tria*)elements[0];429 tria2=(Tria*)elements[1];440 Tria* tria1=(Tria*)elements[0]; 441 Tria* tria2=(Tria*)elements[1]; 430 442 431 443 /*Initialize Element Matrix*/ … … 435 447 /*Get some parameters: */ 436 448 this->parameters->FindParam(&penalty_offset,StressbalancePenaltyFactorEnum); 437 tria1->GetInputValue(&h[0], nodes[0],ThicknessEnum);438 tria2->GetInputValue(&h[1], nodes[1],ThicknessEnum);449 tria1->GetInputValue(&h[0],vertices[0],ThicknessEnum); 450 tria2->GetInputValue(&h[1],vertices[1],ThicknessEnum); 439 451 if (h[0]!=h[1])_error_("different thicknesses not supported for rift fronts"); 440 452 thickness=h[0]; … … 506 518 IssmDouble pressure_water; 507 519 508 /*Objects: */509 Tria *tria1 = NULL;510 Tria *tria2 = NULL;511 512 520 /*enum of element? */ 513 521 if(elements[0]->ObjectEnum()!=TriaEnum)_error_("only Tria element allowed for Riftfront load!"); 514 tria1=(Tria*)elements[0];515 tria2=(Tria*)elements[1];522 Tria* tria1=(Tria*)elements[0]; 523 Tria* tria2=(Tria*)elements[1]; 516 524 517 525 /*Initialize Element Matrix*/ … … 523 531 rho_water=tria1->FindParam(MaterialsRhoSeawaterEnum); 524 532 gravity=tria1->FindParam(ConstantsGEnum); 525 tria1->GetInputValue(&h[0], nodes[0],ThicknessEnum);526 tria2->GetInputValue(&h[1], nodes[1],ThicknessEnum);533 tria1->GetInputValue(&h[0],vertices[0],ThicknessEnum); 534 tria2->GetInputValue(&h[1],vertices[1],ThicknessEnum); 527 535 if (h[0]!=h[1])_error_("different thicknesses not supported for rift fronts"); 528 536 thickness=h[0]; 529 tria1->GetInputValue(&b[0], nodes[0],BaseEnum);530 tria2->GetInputValue(&b[1], nodes[1],BaseEnum);537 tria1->GetInputValue(&b[0],vertices[0],BaseEnum); 538 tria2->GetInputValue(&b[1],vertices[1],BaseEnum); 531 539 if (b[0]!=b[1])_error_("different beds not supported for rift fronts"); 532 540 bed=b[0]; … … 571 579 572 580 /*Ok, add contribution to first node, along the normal i==0: */ 573 for (j=0;j<2;j++){581 for(int j=0;j<2;j++){ 574 582 pe->values[j]+=pressure*normal[j]*length; 575 583 } 576 584 577 585 /*Add contribution to second node, along the opposite normal: i==1 */ 578 for (j=0;j<2;j++){586 for(int j=0;j<2;j++){ 579 587 pe->values[2+j]+= -pressure*normal[j]*length; 580 588 } … … 624 632 625 633 /*First recover velocity: */ 626 tria1->GetInputValue(&vx1, nodes[0],VxEnum);627 tria2->GetInputValue(&vx2, nodes[1],VxEnum);628 tria1->GetInputValue(&vy1, nodes[0],VyEnum);629 tria2->GetInputValue(&vy2, nodes[1],VyEnum);634 tria1->GetInputValue(&vx1,vertices[0],VxEnum); 635 tria2->GetInputValue(&vx2,vertices[1],VxEnum); 636 tria1->GetInputValue(&vy1,vertices[0],VyEnum); 637 tria2->GetInputValue(&vy2,vertices[1],VyEnum); 630 638 631 639 /*Node 1 faces node 2, compute penetration of 2 into 1 (V2-V1).N (with N normal vector, and V velocity vector: */ -
TabularUnified issm/trunk-jpl/src/c/classes/Loads/Riftfront.h ¶
r23959 r24089 28 28 /*hooks: */ 29 29 Hook* hnodes; 30 Hook* hvertices; 30 31 Hook* helements; 31 32 32 33 /*Corresponding fields*/ 33 34 Node **nodes; 35 Vertex **vertices; 34 36 Element **elements; 35 37 -
TabularUnified issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp ¶
r21892 r24089 497 497 /*update static arrays*/ 498 498 switch(finiteelement){ 499 case P0Enum: 499 case P0Enum: case P0DGEnum: 500 500 switch(iv){ 501 501 case 0: coord1=1./3.; coord2=1./3.; coord3=1./3.; break;
Note:
See TracChangeset
for help on using the changeset viewer.