Changeset 5316
- Timestamp:
- 08/17/10 13:32:50 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r5314 r5316 414 414 if (!IsInput(name)) return; 415 415 416 /*Penta update B in InputUpdateFromSolutionThermal, so don't look for B update here.*/ 417 416 418 switch(type){ 417 419 … … 448 450 /*FUNCTION Penta::InputUpdateFromVectorDakota(double* vector, int name, int type);{{{1*/ 449 451 void Penta::InputUpdateFromVectorDakota(double* vector, int name, int type){ 450 451 /*Check that name is an element input*/ 452 if (!IsInput(name)) return; 453 454 switch(type){ 455 456 case VertexEnum: 457 458 /*New PentaVertexInpu*/ 459 double values[6]; 460 461 /*Get values on the 6 vertices*/ 462 for (int i=0;i<6;i++){ 463 values[i]=vector[this->nodes[i]->GetVertexDof()]; 464 } 465 466 /*update input*/ 467 this->inputs->AddInput(new PentaVertexInput(name,values)); 468 return; 469 470 default: 471 472 ISSMERROR("type %i (%s) not implemented yet",type,EnumToString(type)); 473 } 452 ISSMERROR(" not supported yet!"); 474 453 } 475 454 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r5314 r5316 413 413 double values[3]; 414 414 415 /*Get values on the 6vertices*/415 /*Get values on the 3 vertices*/ 416 416 for (int i=0;i<3;i++){ 417 417 values[i]=vector[this->nodes[i]->GetVertexDof()]; … … 445 445 /*FUNCTION Tria::InputUpdateFromVectorDakota(double* vector, int name, int type);{{{1*/ 446 446 void Tria::InputUpdateFromVectorDakota(double* vector, int name, int type){ 447 448 const int numgrids=3; 449 double gaussgrids[numgrids][numgrids]={{1,0,0},{0,1,0},{0,0,1}}; 450 int i,j; 447 451 448 452 /*Check that name is an element input*/ … … 456 460 double values[3]; 457 461 458 /*Get values on the 6vertices*/459 for (i nt i=0;i<3;i++){462 /*Get values on the 3 vertices*/ 463 for (i=0;i<3;i++){ 460 464 values[i]=vector[this->nodes[i]->GetVertexDof()]; 461 465 } 462 466 463 /*update input*/ 464 if (name==RheologyB2dEnum || name==RheologyBEnum){ 465 matice->inputs->AddInput(new TriaVertexInput(name,values)); 467 /*Branch on the specified type of update: */ 468 switch(name){ 469 case RheologyB2dEnum: 470 matice->inputs->AddInput(new TriaVertexInput(name,values)); 471 break; 472 case RheologyBEnum: 473 matice->inputs->AddInput(new TriaVertexInput(name,values)); 474 break; 475 case ThicknessEnum: 476 /*Update thickness + surface: assume bed is constant. On ice shelves, takes hydrostatic equilibrium {{{2*/ 477 double thickness[3]; 478 double surface[3]; 479 double bed[3]; 480 481 /*retrieve inputs: */ 482 inputs->GetParameterValues(&bed[0],&gaussgrids[0][0],3,BedEnum); 483 inputs->GetParameterValues(&surface[0],&gaussgrids[0][0],3,SurfaceEnum); 484 485 /*build new thickness: */ 486 for(j=0;j<3;j++)thickness[j]=values[j]; 487 488 /*build new bed and surface: */ 489 if (this->GetShelf()){ 490 /*hydrostatic equilibrium: */ 491 double rho_ice,rho_water,di; 492 rho_ice=this->matpar->GetRhoIce(); 493 rho_water=this->matpar->GetRhoWater(); 494 495 di=rho_ice/rho_water; 496 497 for(j=0;j<3;j++){ 498 surface[j]=(1-di)*thickness[j]; 499 bed[j]=-di*thickness[j]; 500 } 501 } 502 else{ 503 /*update bed on grounded ice: */ 504 for(j=0;j<3;j++)surface[j]=bed[j]+thickness[j]; 505 } 506 507 /*Add new inputs: */ 508 this->inputs->AddInput(new TriaVertexInput(ThicknessEnum,thickness)); 509 this->inputs->AddInput(new TriaVertexInput(BedEnum,bed)); 510 this->inputs->AddInput(new TriaVertexInput(SurfaceEnum,surface)); 511 512 /*}}}*/ 513 break; 514 default: 515 this->inputs->AddInput(new TriaVertexInput(name,values)); 466 516 } 467 else{ 468 this->inputs->AddInput(new TriaVertexInput(name,values)); 469 } 470 return; 517 break; 471 518 472 519 default: 473 474 520 ISSMERROR("type %i (%s) not implemented yet",type,EnumToString(type)); 475 521 } 522 476 523 } 477 524 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.