Changeset 5727
- Timestamp:
- 09/09/10 15:21:14 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Element.h
r5719 r5727 38 38 virtual void GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue)=0; 39 39 virtual void GetParameterValue(double* pvalue,Node* node,int enumtype)=0; 40 virtual void GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in)=0;41 40 virtual void Gradj(Vec gradient,int control_type)=0; 42 41 virtual void GradjDrag(Vec gradient)=0; -
issm/trunk/src/c/objects/Elements/Penta.cpp
r5726 r5727 4331 4331 } 4332 4332 /*}}}*/ 4333 /*FUNCTION Penta::GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in) {{{1*/4334 void Penta::GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in){4335 4336 /*Output*/4337 double value;4338 4339 /*Intermediaries*/4340 const int numnodes=6;4341 int grid1=-1,grid2=-1;4342 int grid3;4343 int i;4344 double gauss_penta[numnodes];4345 4346 /*go through 6 nodes (all nodes for penta) and identify 1st and 2nd nodes: */4347 ISSMASSERT(nodes);4348 for(i=0;i<numnodes;i++){4349 if (node1==nodes[i]) grid1=i;4350 if (node2==nodes[i]) grid2=i;4351 }4352 4353 /*Reverse grid1 and 2 if necessary*/4354 if (grid1>grid2){4355 4356 /*Reverse grid1 and grid2*/4357 grid3=grid1; grid1=grid2; grid2=grid3;4358 4359 /*Change segment gauss point (between -1 and +1)*/4360 gauss_seg=-gauss_seg;4361 }4362 4363 /*Build Penta Gauss point*/4364 if (grid2<3){4365 4366 /*We are on the basal triangle*/4367 gauss_penta[3]=-1.;4368 4369 if (grid1==0 && grid2==1){4370 /*gauss_seg is between 0 and 1*/4371 gauss_penta[0]=0.5*(1.-gauss_seg);4372 gauss_penta[1]=1.-0.5*(1.-gauss_seg);4373 gauss_penta[2]=0.;4374 }4375 else if (grid1==0 && grid2==2){4376 /*gauss_seg is between 0 and 2*/4377 gauss_penta[0]=0.5*(1.-gauss_seg);4378 gauss_penta[1]=0.;4379 gauss_penta[2]=1.-0.5*(1.-gauss_seg);4380 }4381 else if (grid1==1 && grid2==2){4382 /*gauss_seg is between 1 and 2*/4383 gauss_penta[0]=0.;4384 gauss_penta[1]=0.5*(1.-gauss_seg);4385 gauss_penta[2]=1.-0.5*(1.-gauss_seg);4386 }4387 else{4388 ISSMERROR("The 2 nodes provided are either the same or did not match current Penta nodes");4389 }4390 }4391 else if(grid1>2){4392 4393 /*We are on the surface triangle*/4394 gauss_penta[3]=+1.;4395 4396 if (grid1==3 && grid2==4){4397 /*gauss_seg is between 0 and 1*/4398 gauss_penta[0]=0.5*(1.-gauss_seg);4399 gauss_penta[1]=1.-0.5*(1.-gauss_seg);4400 gauss_penta[2]=0.;4401 }4402 else if (grid1==3 && grid2==5){4403 /*gauss_seg is between 0 and 2*/4404 gauss_penta[0]=0.5*(1.-gauss_seg);4405 gauss_penta[1]=0.;4406 gauss_penta[2]=1.-0.5*(1.-gauss_seg);4407 }4408 else if (grid1==4 && grid2==5){4409 /*gauss_seg is between 1 and 2*/4410 gauss_penta[0]=0.;4411 gauss_penta[1]=0.5*(1.-gauss_seg);4412 gauss_penta[2]=1.-0.5*(1.-gauss_seg);4413 }4414 else{4415 ISSMERROR("The 2 nodes provided are either the same or did not match current Penta nodes");4416 }4417 }4418 else{4419 ISSMERROR("vertical segments not implemented yet");4420 }4421 4422 /*OK, now we can call input method*/4423 input_in->GetParameterValue(&value, &gauss_penta[0]);4424 4425 /*Assign output pointers:*/4426 *pvalue=value;4427 }4428 /*}}}*/4429 4333 /*FUNCTION Penta::GetPhi {{{1*/ 4430 4334 void Penta::GetPhi(double* phi, double* epsilon, double viscosity){ -
issm/trunk/src/c/objects/Elements/Penta.h
r5719 r5727 160 160 void GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue); 161 161 void GetParameterValue(double* pvalue,Node* node,int enumtype); 162 void GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in);163 162 void GetPhi(double* phi, double* epsilon, double viscosity); 164 163 void GetSolutionFromInputsDiagnosticHoriz(Vec solutiong); -
issm/trunk/src/c/objects/Loads/Pengrid.cpp
r5725 r5727 24 24 this->parameters=NULL; 25 25 this->hnode=NULL; 26 this->node=NULL; 26 27 this->helement=NULL; 28 this->element=NULL; 27 29 this->hmatpar=NULL; 30 this->matpar=NULL; 28 31 29 32 /*not active, not zigzagging: */ … … 65 68 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this. 66 69 this->parameters=NULL; 70 this->node=NULL; 71 this->element=NULL; 72 this->matpar=NULL; 67 73 68 74 //let's not forget internals … … 197 203 /*parameters: may not exist even yet, so let Configure handle it: */ 198 204 this->parameters=NULL; 205 this->node=NULL; 206 this->element=NULL; 207 this->matpar=NULL; 199 208 200 209 /*return: */ … … 233 242 pengrid->helement=(Hook*)this->helement->copy(); 234 243 244 /*corresponding fields*/ 245 pengrid->node =(Node*)pengrid->hnode->delivers(); 246 pengrid->matpar =(Matpar*)pengrid->hmatpar->delivers(); 247 pengrid->element=(Element*)pengrid->helement->delivers(); 248 235 249 //let's not forget internals 236 250 pengrid->active=this->active=0; … … 252 266 hmatpar->configure(materialsin); 253 267 268 /*Get corresponding fields*/ 269 node=(Node*)hnode->delivers(); 270 element=(Element*)helement->delivers(); 271 matpar=(Matpar*)hmatpar->delivers(); 272 254 273 /*point parameters to real dataset: */ 255 274 this->parameters=parametersin; … … 408 427 int* doflist=NULL; 409 428 410 /*dynamic objects pointed to by hooks: */411 Node* node=NULL;412 413 /*recover objects from hooks: */414 node=(Node*)hnode->delivers();415 416 429 /*Some checks for debugging*/ 417 430 ISSMASSERT(node); … … 438 451 /*dynamic objects pointed to by hooks: */ 439 452 Penta* penta=NULL; 440 Node* node=NULL;441 453 442 454 /*recover objects from hooks: */ 443 penta=(Penta*)helement->delivers(); 444 node =(Node*)hnode->delivers(); 455 penta=(Penta*)element; 445 456 446 457 /*Get value on Element 1*/ … … 494 505 495 506 /*pointers: */ 496 Node* node=NULL;497 507 Penta* penta=NULL; 498 Matpar* matpar=NULL;499 508 500 509 /*recover pointers: */ 501 node=(Node*)hnode->delivers(); 502 penta=(Penta*)helement->delivers(); 503 matpar=(Matpar*)hmatpar->delivers(); 510 penta=(Penta*)element; 504 511 505 512 /*check that pengrid is not a clone (penalty to be added only once)*/ … … 577 584 578 585 /*pointers: */ 579 Node* node=NULL;580 586 Penta* penta=NULL; 581 587 582 588 /*recover pointers: */ 583 node=(Node*)hnode->delivers(); 584 penta=(Penta*)helement->delivers(); 589 penta=(Penta*)element; 585 590 586 591 /*If not Stokes, return*/ … … 630 635 631 636 /*pointers: */ 632 Node* node=NULL;633 637 Penta* penta=NULL; 634 Matpar* matpar=NULL;635 638 636 639 /*recover pointers: */ 637 node=(Node*)hnode->delivers(); 638 penta=(Penta*)helement->delivers(); 639 matpar=(Matpar*)hmatpar->delivers(); 640 penta=(Penta*)element; 640 641 641 642 /*check that pengrid is not a clone (penalty to be added only once)*/ … … 720 721 721 722 /*pointers: */ 722 Node* node=NULL;723 723 Penta* penta=NULL; 724 Matpar* matpar=NULL;725 724 726 725 /*recover pointers: */ 727 node=(Node*)hnode->delivers(); 728 penta=(Penta*)helement->delivers(); 729 matpar=(Matpar*)hmatpar->delivers(); 726 penta=(Penta*)element; 730 727 731 728 /*check that pengrid is not a clone (penalty to be added only once)*/ … … 794 791 795 792 /*pointers: */ 796 Node* node=NULL;797 793 Penta* penta=NULL; 798 Matpar* matpar=NULL;799 794 800 795 /*recover pointers: */ 801 node=(Node*)hnode->delivers(); 802 penta=(Penta*)helement->delivers(); 803 matpar=(Matpar*)hmatpar->delivers(); 796 penta=(Penta*)element; 804 797 805 798 if(!this->active)return; -
issm/trunk/src/c/objects/Loads/Pengrid.h
r5311 r5727 21 21 int analysis_type; 22 22 23 /*Hooks*/ 23 24 Hook* hnode; //hook to 1 node 24 25 Hook* helement; //hook to 1 element 25 26 Hook* hmatpar; //hook to 1 matpar 27 28 /*Corresponding fields*/ 29 Node *node; 30 Element *element; 31 Matpar *matpar; 26 32 27 33 Parameters* parameters; //pointer to solution parameters
Note:
See TracChangeset
for help on using the changeset viewer.