Changeset 5730
- Timestamp:
- 09/09/10 15:40:34 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Loads
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Loads/Pengrid.cpp
r5729 r5730 443 443 } 444 444 /*}}}*/ 445 /*FUNCTION Pengrid::GetParameterValue {{{1*/446 void Pengrid::GetParameterValue(double* pvalue,int enumtype){447 448 /*output: */449 double value;450 451 /*dynamic objects pointed to by hooks: */452 Penta* penta=NULL;453 454 /*recover objects from hooks: */455 penta=(Penta*)element;456 457 /*Get value on Element 1*/458 penta->GetParameterValue(&value,node,enumtype);459 460 /*Assign output pointers:*/461 *pvalue=value;462 }463 /*}}}*/464 445 /*FUNCTION Pengrid::PenaltyConstrain {{{1*/ 465 446 void Pengrid::PenaltyConstrain(int* punstable){ … … 502 483 int reset_penalties=0; 503 484 int stabilize_constraints; 504 GaussPenta* gauss=NULL;505 506 /*pointers: */507 Penta* penta=NULL;508 485 509 486 /*recover pointers: */ 510 penta=(Penta*)element;487 Penta* penta=(Penta*)element; 511 488 512 489 /*check that pengrid is not a clone (penalty to be added only once)*/ … … 518 495 519 496 //First recover pressure and temperature values, using the element: */ 520 gauss=new GaussPenta(); 521 gauss->GaussVertex(penta->GetNodeIndex(node)); 522 penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum); 523 penta->inputs->GetParameterValue(&temperature,gauss,TemporaryTemperatureEnum); 497 penta->GetParameterValue(&pressure,node,PressureEnum); 498 penta->GetParameterValue(&temperature,node,TemporaryTemperatureEnum); 524 499 525 500 //Recover our data: … … 563 538 //*Assign output pointers:*/ 564 539 *punstable=unstable; 565 566 /*Clean up*/567 delete gauss;568 540 } 569 541 /*}}}1*/ … … 598 570 599 571 //recover slope: */ 600 this->GetParameterValue(&slope[0],BedSlopeXEnum);601 this->GetParameterValue(&slope[1],BedSlopeYEnum);572 penta->inputs->GetParameterValue(&slope[0],BedSlopeXEnum); 573 penta->inputs->GetParameterValue(&slope[1],BedSlopeYEnum); 602 574 603 575 /*recover parameters: */ … … 628 600 int* doflist=NULL; 629 601 double meltingpoint; 630 GaussPenta* gauss=NULL;631 602 632 603 double pressure; … … 635 606 double penalty_offset; 636 607 637 /*pointers: */638 Penta* penta=NULL;639 640 608 /*recover pointers: */ 641 penta=(Penta*)element;609 Penta* penta=(Penta*)element; 642 610 643 611 /*check that pengrid is not a clone (penalty to be added only once)*/ … … 645 613 646 614 //First recover pressure and temperature values, using the element: */ 647 gauss=new GaussPenta(); 648 gauss->GaussVertex(penta->GetNodeIndex(node)); 649 penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum); 650 penta->inputs->GetParameterValue(&temperature,gauss,TemperatureEnum); 615 penta->GetParameterValue(&pressure,node,PressureEnum); 616 penta->GetParameterValue(&temperature,node,TemperatureEnum); 651 617 652 618 /*recover parameters: */ … … 669 635 670 636 /*Clean up*/ 671 delete gauss;672 637 xfree((void**)&doflist); 673 638 } … … 720 685 double t_pmp; 721 686 double dt,penalty_offset; 722 GaussPenta* gauss=NULL;723 724 /*pointers: */725 Penta* penta=NULL;726 687 727 688 /*recover pointers: */ 728 penta=(Penta*)element;689 Penta* penta=(Penta*)element; 729 690 730 691 /*check that pengrid is not a clone (penalty to be added only once)*/ … … 735 696 736 697 //First recover pressure and temperature values, using the element: */ 737 gauss=new GaussPenta(); 738 gauss->GaussVertex(penta->GetNodeIndex(node)); 739 penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum); 740 penta->inputs->GetParameterValue(&temperature,gauss,TemperatureEnum); 698 penta->GetParameterValue(&pressure,node,PressureEnum); 699 penta->GetParameterValue(&temperature,node,TemperatureEnum); 741 700 inputs->GetParameterValue(&melting_offset,MeltingOffsetEnum); 742 701 parameters->FindParam(&dt,DtEnum); … … 771 730 772 731 /*Clean up*/ 773 delete gauss;774 732 xfree((void**)&doflist); 775 733 … … 791 749 double t_pmp; 792 750 double penalty_offset; 793 GaussPenta* gauss=NULL;794 795 /*pointers: */796 Penta* penta=NULL;797 751 798 752 /*recover pointers: */ 799 penta=(Penta*)element;753 Penta* penta=(Penta*)element; 800 754 801 755 if(!this->active)return; … … 805 759 806 760 //First recover pressure and penalty_offset 807 gauss=new GaussPenta(); 808 gauss->GaussVertex(penta->GetNodeIndex(node)); 809 penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum); 761 penta->GetParameterValue(&pressure,node,PressureEnum); 810 762 parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); 811 763 … … 822 774 823 775 /*Clean up*/ 824 delete gauss;825 776 xfree((void**)&doflist); 826 777 -
issm/trunk/src/c/objects/Loads/Pengrid.h
r5727 r5730 80 80 void PenaltyCreateKMatrixDiagnosticStokes(Mat Kgg,double kmax); 81 81 void GetDofList(int** pdoflist); 82 void GetParameterValue(double* pvalue,int enumtype);83 82 void PenaltyCreateKMatrixThermal(Mat Kgg,double kmax); 84 83 void PenaltyCreateKMatrixMelting(Mat Kgg,double kmax);
Note:
See TracChangeset
for help on using the changeset viewer.