Ignore:
Timestamp:
09/20/10 13:50:57 (14 years ago)
Author:
Mathieu Morlighem
Message:

NewElementMatrix and NewElementVector are now in shared, common to all elements and loads

File:
1 edited

Legend:

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

    r5881 r5908  
    24292429        /*Initialize Element matrix and return if necessary*/
    24302430        if(IsOnWater()) return NULL;
    2431         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     2431        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    24322432
    24332433        /*Retrieve all Inputs and parameters: */
     
    25342534        /*Initialize Element matrix and return if necessary*/
    25352535        if(IsOnWater()) return NULL;
    2536         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     2536        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    25372537
    25382538        /*Retrieve all inputs and parameters*/
     
    26012601        /*Initialize Element matrix and return if necessary*/
    26022602        if(IsOnWater()) return NULL;
    2603         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     2603        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    26042604
    26052605        /*Retrieve all inputs and parameters*/
     
    27332733        /*Initialize Element matrix and return if necessary*/
    27342734        if(IsOnWater()) return NULL;
    2735         ElementMatrix* Ke=this->NewElementMatrix(MacAyealApproximationEnum);
     2735        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
    27362736
    27372737        /*Retrieve all inputs and parameters*/
     
    28012801        /*Initialize Element matrix and return if necessary*/
    28022802        if(IsOnWater() || IsOnShelf()) return NULL;
    2803         ElementMatrix* Ke=this->NewElementMatrix(MacAyealApproximationEnum);
     2803        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
    28042804
    28052805        /*Retrieve all inputs and parameters*/
     
    28722872        /*Initialize Element matrix and return if necessary*/
    28732873        if(IsOnWater() || IsOnShelf()) return NULL;
    2874         ElementMatrix* Ke1=this->NewElementMatrix(MacAyealApproximationEnum);
    2875         ElementMatrix* Ke2=this->NewElementMatrix(PattynApproximationEnum);
     2874        ElementMatrix* Ke1=NewElementMatrix(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
     2875        ElementMatrix* Ke2=NewElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
    28762876        ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
    28772877        delete Ke1; delete Ke2;
     
    29612961        /*Initialize Element matrix and return if necessary*/
    29622962        if(IsOnWater() || IsOnShelf()) return NULL;
    2963         ElementMatrix* Ke=this->NewElementMatrix(PattynApproximationEnum);
     2963        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
    29642964
    29652965        /*Retrieve all inputs and parameters*/
     
    30213021        /*Initialize Element matrix and return if necessary*/
    30223022        if(IsOnWater()) return NULL;
    3023         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3023        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    30243024
    30253025        /*Create Element matrix*/
     
    30523052        /*Initialize Element matrix and return if necessary*/
    30533053        if(IsOnWater()) return NULL;
    3054         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3054        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    30553055
    30563056        /*Retrieve all inputs and parameters*/
     
    31023102        /*Initialize Element matrix and return if necessary*/
    31033103        if(IsOnWater()) return NULL;
    3104         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3104        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    31053105
    31063106        /*Retrieve all inputs and parameters*/
     
    31733173        /*Initialize Element matrix and return if necessary*/
    31743174        if(IsOnWater()) return NULL;
    3175         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3175        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    31763176
    31773177        /*Retrieve all inputs and parameters*/
     
    32933293        /*Initialize Element matrix and return if necessary*/
    32943294        if(IsOnWater()) return NULL;
    3295         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3295        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    32963296
    32973297        /*Retrieve all inputs and parameters*/
     
    33683368        /*Initialize Element matrix and return if necessary*/
    33693369        if(IsOnWater()) return NULL;
    3370         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3370        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    33713371
    33723372        GetVerticesCoordinates(&xyz_list[0][0],nodes,NUMVERTICES);
     
    34193419        /*Initialize Element matrix and return if necessary*/
    34203420        if(IsOnWater() || !IsOnShelf()) return NULL;
    3421         ElementMatrix* Ke=this->NewElementMatrix(NoneApproximationEnum);
     3421        ElementMatrix* Ke=NewElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum);
    34223422
    34233423        /*Retrieve all inputs and parameters*/
     
    37443744
    37453745        /*Initialize element vector: */
    3746         pe=this->NewElementVector(MacAyealApproximationEnum);
     3746        pe=NewElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
    37473747
    37483748        /*Add pe_g values to pe element stifness load: */
     
    54535453}
    54545454/*}}}*/
    5455 /*FUNCTION Tria::NewElementMatrix{{{1*/
    5456 ElementMatrix* Tria::NewElementMatrix(int approximation){
    5457 
    5458         /*parameters: */
    5459         bool kff=false;
    5460 
    5461         /*output: */
    5462         ElementMatrix* Ke=NULL;
    5463         int gsize;
    5464         int fsize;
    5465         int ssize;
    5466         int* gglobaldoflist=NULL;
    5467         int* flocaldoflist=NULL;
    5468         int* fglobaldoflist=NULL;
    5469         int* slocaldoflist=NULL;
    5470         int* sglobaldoflist=NULL;
    5471         bool square=true;
    5472 
    5473         /*retrieve some parameters: */
    5474         this->parameters->FindParam(&kff,KffEnum);
    5475 
    5476         /*get number of dofs in sets g,f and s: */
    5477         gsize=this->GetNumberOfDofs(approximation,GsetEnum);
    5478         if(kff){
    5479                 fsize=this->GetNumberOfDofs(approximation,FsetEnum);
    5480                 ssize=this->GetNumberOfDofs(approximation,SsetEnum);
    5481         }
    5482 
    5483         /*get dof lists for f and s set: */
    5484         gglobaldoflist=this->GetGlobalDofList(approximation,GsetEnum);
    5485         if(kff){
    5486                 flocaldoflist=this->GetLocalDofList(approximation,FsetEnum);
    5487                 fglobaldoflist=this->GetGlobalDofList(approximation,FsetEnum);
    5488                 slocaldoflist=this->GetLocalDofList(approximation,SsetEnum);
    5489                 sglobaldoflist=this->GetGlobalDofList(approximation,SsetEnum);
    5490         }
    5491 
    5492         /*Use square constructor for ElementMatrix: */
    5493         if(!kff) Ke=new ElementMatrix(square,gglobaldoflist,gsize);
    5494         else     Ke=new ElementMatrix(square,gglobaldoflist,gsize,flocaldoflist,fglobaldoflist,fsize,slocaldoflist,sglobaldoflist,ssize);
    5495 
    5496         /*Free ressources and return:*/
    5497         xfree((void**)&gglobaldoflist);
    5498         xfree((void**)&flocaldoflist);
    5499         xfree((void**)&fglobaldoflist);
    5500         xfree((void**)&slocaldoflist);
    5501         xfree((void**)&sglobaldoflist);
    5502 
    5503         return Ke;
    5504 }
    5505 /*}}}*/
    5506 /*FUNCTION Tria::NewElementVector{{{1*/
    5507 ElementVector* Tria::NewElementVector(int approximation){
    5508 
    5509         /*parameters: */
    5510         bool kff=false;
    5511 
    5512         /*output: */
    5513         ElementVector* pe=NULL;
    5514         int gsize;
    5515         int fsize;
    5516         int* gglobaldoflist=NULL;
    5517         int* flocaldoflist=NULL;
    5518         int* fglobaldoflist=NULL;
    5519 
    5520         /*retrieve some parameters: */
    5521         this->parameters->FindParam(&kff,KffEnum);
    5522 
    5523         /*get number of dofs in sets g,f and s: */
    5524         gsize=this->GetNumberOfDofs(approximation,GsetEnum);
    5525         if(kff)fsize=this->GetNumberOfDofs(approximation,FsetEnum);
    5526 
    5527         /*get dof lists for f and s set: */
    5528         if(!kff){
    5529                 gglobaldoflist=this->GetGlobalDofList(approximation,GsetEnum);
    5530         }
    5531         else{
    5532                 flocaldoflist=this->GetLocalDofList(approximation,FsetEnum);
    5533                 fglobaldoflist=this->GetGlobalDofList(approximation,FsetEnum);
    5534         }
    5535 
    5536         /*constructor for ElementVector: */
    5537         if(!kff)pe=new ElementVector(gsize,gglobaldoflist);
    5538         else    pe=new ElementVector(gsize,flocaldoflist,fglobaldoflist,fsize);
    5539 
    5540         /*Free ressources and return:*/
    5541         xfree((void**)&gglobaldoflist);
    5542         xfree((void**)&flocaldoflist);
    5543         xfree((void**)&fglobaldoflist);
    5544        
    5545         return pe;
    5546 }
    5547 /*}}}*/
    55485455/*FUNCTION Tria::SetClone {{{1*/
    55495456void  Tria::SetClone(int* minranks){
Note: See TracChangeset for help on using the changeset viewer.