Changeset 5727


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

Removed some unused routines and added hooked fields for Pengrid instead of delivering in every routine

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

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Element.h

    r5719 r5727  
    3838                virtual void   GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue)=0;
    3939                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;
    4140                virtual void   Gradj(Vec gradient,int control_type)=0;
    4241                virtual void   GradjDrag(Vec gradient)=0;
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r5726 r5727  
    43314331}
    43324332/*}}}*/
    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 /*}}}*/
    44294333/*FUNCTION Penta::GetPhi {{{1*/
    44304334void Penta::GetPhi(double* phi, double*  epsilon, double viscosity){
  • issm/trunk/src/c/objects/Elements/Penta.h

    r5719 r5727  
    160160                void    GetParameterListOnVertices(double* pvalue,int enumtype,double defaultvalue);
    161161                void      GetParameterValue(double* pvalue,Node* node,int enumtype);
    162                 void      GetParameterValue(double* pvalue,Node* node1,Node* node2,double gauss_seg,Input* input_in);
    163162                void      GetPhi(double* phi, double*  epsilon, double viscosity);
    164163                void      GetSolutionFromInputsDiagnosticHoriz(Vec solutiong);
  • issm/trunk/src/c/objects/Loads/Pengrid.cpp

    r5725 r5727  
    2424        this->parameters=NULL;
    2525        this->hnode=NULL;
     26        this->node=NULL;
    2627        this->helement=NULL;
     28        this->element=NULL;
    2729        this->hmatpar=NULL;
     30        this->matpar=NULL;
    2831       
    2932        /*not active, not zigzagging: */
     
    6568        //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
    6669        this->parameters=NULL;
     70        this->node=NULL;
     71        this->element=NULL;
     72        this->matpar=NULL;
    6773
    6874        //let's not forget internals
     
    197203        /*parameters: may not exist even yet, so let Configure handle it: */
    198204        this->parameters=NULL;
     205        this->node=NULL;
     206        this->element=NULL;
     207        this->matpar=NULL;
    199208
    200209        /*return: */
     
    233242        pengrid->helement=(Hook*)this->helement->copy();
    234243
     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
    235249        //let's not forget internals
    236250        pengrid->active=this->active=0;
     
    252266        hmatpar->configure(materialsin);
    253267
     268        /*Get corresponding fields*/
     269        node=(Node*)hnode->delivers();
     270        element=(Element*)helement->delivers();
     271        matpar=(Matpar*)hmatpar->delivers();
     272
    254273        /*point parameters to real dataset: */
    255274        this->parameters=parametersin;
     
    408427        int* doflist=NULL;
    409428
    410         /*dynamic objects pointed to by hooks: */
    411         Node* node=NULL;
    412 
    413         /*recover objects from hooks: */
    414         node=(Node*)hnode->delivers();
    415 
    416429        /*Some checks for debugging*/
    417430        ISSMASSERT(node);
     
    438451        /*dynamic objects pointed to by hooks: */
    439452        Penta* penta=NULL;
    440         Node*  node=NULL;
    441453
    442454        /*recover objects from hooks: */
    443         penta=(Penta*)helement->delivers();
    444         node =(Node*)hnode->delivers();
     455        penta=(Penta*)element;
    445456
    446457        /*Get value on Element 1*/
     
    494505
    495506        /*pointers: */
    496         Node* node=NULL;
    497507        Penta* penta=NULL;
    498         Matpar*  matpar=NULL;
    499508
    500509        /*recover pointers: */
    501         node=(Node*)hnode->delivers();
    502         penta=(Penta*)helement->delivers();
    503         matpar=(Matpar*)hmatpar->delivers();
     510        penta=(Penta*)element;
    504511       
    505512        /*check that pengrid is not a clone (penalty to be added only once)*/
     
    577584
    578585        /*pointers: */
    579         Node* node=NULL;
    580586        Penta* penta=NULL;
    581587
    582588        /*recover pointers: */
    583         node=(Node*)hnode->delivers();
    584         penta=(Penta*)helement->delivers();
     589        penta=(Penta*)element;
    585590
    586591        /*If not Stokes, return*/
     
    630635
    631636        /*pointers: */
    632         Node* node=NULL;
    633637        Penta* penta=NULL;
    634         Matpar*  matpar=NULL;
    635638
    636639        /*recover pointers: */
    637         node=(Node*)hnode->delivers();
    638         penta=(Penta*)helement->delivers();
    639         matpar=(Matpar*)hmatpar->delivers();
     640        penta=(Penta*)element;
    640641
    641642        /*check that pengrid is not a clone (penalty to be added only once)*/
     
    720721
    721722        /*pointers: */
    722         Node* node=NULL;
    723723        Penta* penta=NULL;
    724         Matpar*  matpar=NULL;
    725724
    726725        /*recover pointers: */
    727         node=(Node*)hnode->delivers();
    728         penta=(Penta*)helement->delivers();
    729         matpar=(Matpar*)hmatpar->delivers();
     726        penta=(Penta*)element;
    730727
    731728        /*check that pengrid is not a clone (penalty to be added only once)*/
     
    794791
    795792        /*pointers: */
    796         Node* node=NULL;
    797793        Penta* penta=NULL;
    798         Matpar*  matpar=NULL;
    799794
    800795        /*recover pointers: */
    801         node=(Node*)hnode->delivers();
    802         penta=(Penta*)helement->delivers();
    803         matpar=(Matpar*)hmatpar->delivers();
     796        penta=(Penta*)element;
    804797
    805798        if(!this->active)return;
  • issm/trunk/src/c/objects/Loads/Pengrid.h

    r5311 r5727  
    2121                int analysis_type;
    2222               
     23                /*Hooks*/
    2324                Hook* hnode;  //hook to 1 node
    2425                Hook* helement;  //hook to 1 element
    2526                Hook* hmatpar; //hook to 1 matpar
     27
     28                /*Corresponding fields*/
     29                Node    *node;
     30                Element *element;
     31                Matpar  *matpar;
    2632
    2733                Parameters* parameters; //pointer to solution parameters
Note: See TracChangeset for help on using the changeset viewer.