Changeset 5729


Ignore:
Timestamp:
09/09/10 15:29:21 (15 years ago)
Author:
Mathieu Morlighem
Message:

use GaussPenta in Pengrid

Location:
issm/trunk/src/c/objects
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r5727 r5729  
    41594159}
    41604160/*}}}*/
    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 /*}}}*/
    42004161/*FUNCTION Penta::GetDofList {{{1*/
    42014162void  Penta::GetDofList(int** pdoflist,int approximation_enum){
  • issm/trunk/src/c/objects/Elements/Penta.h

    r5727 r5729  
    147147                void      CreatePVectorSlope( Vec pg);
    148148                void      CreatePVectorThermal( Vec pg);
    149                 double*   GaussFromNode(Node* node);
    150149                void      GetDofList(int** pdoflist,int approximation_enum=0);
    151150                void      GetDofList1(int* doflist);
  • issm/trunk/src/c/objects/Loads/Pengrid.cpp

    r5727 r5729  
    502502        int    reset_penalties=0;
    503503        int    stabilize_constraints;
    504         double* gauss=NULL;
     504        GaussPenta* gauss=NULL;
    505505
    506506        /*pointers: */
     
    518518
    519519        //First recover pressure and temperature values, using the element: */
    520         gauss=penta->GaussFromNode(node);
     520        gauss=new GaussPenta();
     521        gauss->GaussVertex(penta->GetNodeIndex(node));
    521522        penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum);
    522523        penta->inputs->GetParameterValue(&temperature,gauss,TemporaryTemperatureEnum);
     
    564565
    565566        /*Clean up*/
    566         xfree((void**)&gauss);
     567        delete gauss;
    567568}
    568569/*}}}1*/
     
    627628        int*      doflist=NULL;
    628629        double    meltingpoint;
    629         double*   gauss=NULL;
     630        GaussPenta*   gauss=NULL;
    630631
    631632        double pressure;
     
    644645
    645646        //First recover pressure and temperature values, using the element: */
    646         gauss=penta->GaussFromNode(node);
     647        gauss=new GaussPenta();
     648        gauss->GaussVertex(penta->GetNodeIndex(node));
    647649        penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum);
    648650        penta->inputs->GetParameterValue(&temperature,gauss,TemperatureEnum);
     
    667669
    668670        /*Clean up*/
    669         xfree((void**)&gauss);
     671        delete gauss;
    670672        xfree((void**)&doflist);
    671673}
     
    718720        double t_pmp;
    719721        double dt,penalty_offset;
    720         double* gauss=NULL;
     722        GaussPenta* gauss=NULL;
    721723
    722724        /*pointers: */
     
    733735
    734736        //First recover pressure and temperature values, using the element: */
    735         gauss=penta->GaussFromNode(node);
     737        gauss=new GaussPenta();
     738        gauss->GaussVertex(penta->GetNodeIndex(node));
    736739        penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum);
    737740        penta->inputs->GetParameterValue(&temperature,gauss,TemperatureEnum);
     
    768771
    769772        /*Clean up*/
    770         xfree((void**)&gauss);
     773        delete gauss;
    771774        xfree((void**)&doflist);
    772775
     
    788791        double t_pmp;
    789792        double penalty_offset;
    790         double* gauss=NULL;
     793        GaussPenta* gauss=NULL;
    791794
    792795        /*pointers: */
     
    802805
    803806        //First recover pressure  and penalty_offset
    804         gauss=penta->GaussFromNode(node);
     807        gauss=new GaussPenta();
     808        gauss->GaussVertex(penta->GetNodeIndex(node));
    805809        penta->inputs->GetParameterValue(&pressure,gauss,PressureEnum);
    806810        parameters->FindParam(&penalty_offset,PenaltyOffsetEnum);
     
    818822
    819823        /*Clean up*/
    820         xfree((void**)&gauss);
     824        delete gauss;
    821825        xfree((void**)&doflist);
    822826
Note: See TracChangeset for help on using the changeset viewer.