Changeset 5729
- Timestamp:
- 09/09/10 15:29:21 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r5727 r5729 4159 4159 } 4160 4160 /*}}}*/ 4161 /*FUNCTION Penta::GaussFromNode {{{1*/4162 double* Penta::GaussFromNode(Node* node){4163 4164 /*variable declaration*/4165 int i,pos;4166 double* gauss=NULL;4167 4168 /*Allocate gauss*/4169 gauss=(double*)xmalloc(4*sizeof(double));4170 4171 for(i=0;i<6;i++){4172 if (node==nodes[i]){4173 switch(i){4174 case 0:4175 gauss[0]=1.0; gauss[1]=0.0; gauss[2]=0.0; gauss[3]= -1.0;4176 return gauss;4177 case 1:4178 gauss[0]=0.0; gauss[1]=1.0; gauss[2]=0.0; gauss[3]= -1.0;4179 return gauss;4180 case 2:4181 gauss[0]=0.0; gauss[1]=0.0; gauss[2]=1.0; gauss[3]= -1.0;4182 return gauss;4183 case 3:4184 gauss[0]=1.0; gauss[1]=0.0; gauss[2]=0.0; gauss[3]=1.0;4185 return gauss;4186 case 4:4187 gauss[0]=0.0; gauss[1]=1.0; gauss[2]=0.0; gauss[3]=1.0;4188 return gauss;4189 case 5:4190 gauss[0]=0.0; gauss[1]=0.0; gauss[2]=1.0; gauss[3]=1.0;4191 return gauss;4192 }4193 }4194 }4195 4196 /*output error if not found*/4197 ISSMERROR("Node not found in Penta");4198 }4199 /*}}}*/4200 4161 /*FUNCTION Penta::GetDofList {{{1*/ 4201 4162 void Penta::GetDofList(int** pdoflist,int approximation_enum){ -
issm/trunk/src/c/objects/Elements/Penta.h
r5727 r5729 147 147 void CreatePVectorSlope( Vec pg); 148 148 void CreatePVectorThermal( Vec pg); 149 double* GaussFromNode(Node* node);150 149 void GetDofList(int** pdoflist,int approximation_enum=0); 151 150 void GetDofList1(int* doflist); -
issm/trunk/src/c/objects/Loads/Pengrid.cpp
r5727 r5729 502 502 int reset_penalties=0; 503 503 int stabilize_constraints; 504 double* gauss=NULL;504 GaussPenta* gauss=NULL; 505 505 506 506 /*pointers: */ … … 518 518 519 519 //First recover pressure and temperature values, using the element: */ 520 gauss=penta->GaussFromNode(node); 520 gauss=new GaussPenta(); 521 gauss->GaussVertex(penta->GetNodeIndex(node)); 521 522 penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum); 522 523 penta->inputs->GetParameterValue(&temperature,gauss,TemporaryTemperatureEnum); … … 564 565 565 566 /*Clean up*/ 566 xfree((void**)&gauss);567 delete gauss; 567 568 } 568 569 /*}}}1*/ … … 627 628 int* doflist=NULL; 628 629 double meltingpoint; 629 double* gauss=NULL;630 GaussPenta* gauss=NULL; 630 631 631 632 double pressure; … … 644 645 645 646 //First recover pressure and temperature values, using the element: */ 646 gauss=penta->GaussFromNode(node); 647 gauss=new GaussPenta(); 648 gauss->GaussVertex(penta->GetNodeIndex(node)); 647 649 penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum); 648 650 penta->inputs->GetParameterValue(&temperature,gauss,TemperatureEnum); … … 667 669 668 670 /*Clean up*/ 669 xfree((void**)&gauss);671 delete gauss; 670 672 xfree((void**)&doflist); 671 673 } … … 718 720 double t_pmp; 719 721 double dt,penalty_offset; 720 double* gauss=NULL;722 GaussPenta* gauss=NULL; 721 723 722 724 /*pointers: */ … … 733 735 734 736 //First recover pressure and temperature values, using the element: */ 735 gauss=penta->GaussFromNode(node); 737 gauss=new GaussPenta(); 738 gauss->GaussVertex(penta->GetNodeIndex(node)); 736 739 penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum); 737 740 penta->inputs->GetParameterValue(&temperature,gauss,TemperatureEnum); … … 768 771 769 772 /*Clean up*/ 770 xfree((void**)&gauss);773 delete gauss; 771 774 xfree((void**)&doflist); 772 775 … … 788 791 double t_pmp; 789 792 double penalty_offset; 790 double* gauss=NULL;793 GaussPenta* gauss=NULL; 791 794 792 795 /*pointers: */ … … 802 805 803 806 //First recover pressure and penalty_offset 804 gauss=penta->GaussFromNode(node); 807 gauss=new GaussPenta(); 808 gauss->GaussVertex(penta->GetNodeIndex(node)); 805 809 penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum); 806 810 parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); … … 818 822 819 823 /*Clean up*/ 820 xfree((void**)&gauss);824 delete gauss; 821 825 xfree((void**)&doflist); 822 826
Note:
See TracChangeset
for help on using the changeset viewer.