Changeset 5986


Ignore:
Timestamp:
09/23/10 11:58:43 (14 years ago)
Author:
Mathieu Morlighem
Message:

Deleted NewElementVector. Direct call to constructor now

Location:
issm/trunk/src/c
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Makefile.am

    r5908 r5986  
    273273                                        ./shared/Elements/GetNumberOfDofs.cpp\
    274274                                        ./shared/Elements/NewElementMatrix.cpp\
    275                                         ./shared/Elements/NewElementVector.cpp\
    276275                                        ./shared/String/DescriptorIndex.cpp\
    277276                                        ./shared/String/sharedstring.h\
     
    833832                                        ./shared/Elements/GetNumberOfDofs.cpp\
    834833                                        ./shared/Elements/NewElementMatrix.cpp\
    835                                         ./shared/Elements/NewElementVector.cpp\
    836834                                        ./shared/String/DescriptorIndex.cpp\
    837835                                        ./shared/String/sharedstring.h\
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r5978 r5986  
    30193019        inputs->GetParameterValue(&approximation,ApproximationEnum);
    30203020        if(approximation!=PattynStokesApproximationEnum) return NULL;
    3021         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
     3021        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
    30223022
    30233023        /*Retrieve all inputs and parameters*/
     
    30833083        inputs->GetParameterValue(&approximation,ApproximationEnum);
    30843084        if(approximation!=PattynStokesApproximationEnum) return NULL;
    3085         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
     3085        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
    30863086
    30873087        /*Retrieve all inputs and parameters*/
     
    32063206        /*Initialize Element vector and return if necessary*/
    32073207        if(IsOnWater()) return NULL;
    3208         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3208        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    32093209
    32103210        /*Retrieve all inputs and parameters*/
     
    33043304        /*Initialize Element vector and return if necessary*/
    33053305        if(IsOnWater()) return NULL;
    3306         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
     3306        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);
    33073307
    33083308        /*Retrieve all inputs and parameters*/
     
    33763376        inputs->GetParameterValue(&approximation,ApproximationEnum);
    33773377        if(approximation!=StokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
    3378         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
     3378        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
    33793379
    33803380        /*Retrieve all inputs and parameters*/
     
    34443444        inputs->GetParameterValue(&approximation,ApproximationEnum);
    34453445        if(approximation!=StokesApproximationEnum && approximation!=PattynStokesApproximationEnum) return NULL;
    3446         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
     3446        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
    34473447
    34483448        /*Retrieve all inputs and parameters*/
     
    35213521        /*Initialize Element vector and return if necessary*/
    35223522        if(IsOnWater()) return NULL;
    3523         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3523        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    35243524
    35253525        /*Retrieve all inputs and parameters*/
     
    36523652        /*Initialize Element vector and return if necessary*/
    36533653        if(IsOnWater()) return NULL;
    3654         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3654        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    36553655
    36563656        /*Retrieve all inputs and parameters*/
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r5946 r5986  
    34733473        /*Initialize Element vector and return if necessary*/
    34743474        if(IsOnWater()) return NULL;
    3475         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3475        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    34763476
    34773477        /*Retrieve all inputs and parameters*/
     
    35173517        /*Initialize Element vector and return if necessary*/
    35183518        if(IsOnWater()) return NULL;
    3519         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3519        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    35203520
    35213521        /*Retrieve all inputs and parameters*/
     
    35613561        /*Initialize Element vector and return if necessary*/
    35623562        if(IsOnWater()) return NULL;
    3563         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3563        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    35643564
    35653565        /*Retrieve all inputs and parameters*/
     
    36063606        /*Initialize Element vector and return if necessary*/
    36073607        if(IsOnWater()) return NULL;
    3608         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3608        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    36093609
    36103610        /*Retrieve all inputs and parameters*/
     
    36673667        /*Initialize Element vector and return if necessary*/
    36683668        if(IsOnWater()) return NULL;
    3669         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
     3669        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);
    36703670
    36713671        /*Retrieve all inputs and parameters*/
     
    37323732        /*Initialize Element vector and return if necessary*/
    37333733        if(IsOnWater()) return NULL;
    3734         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3734        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    37353735
    37363736        /*Retrieve all inputs and parameters*/
     
    37863786        /*Initialize Element vector and return if necessary*/
    37873787        if(IsOnWater()) return NULL;
    3788         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     3788        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    37893789
    37903790        /*Retrieve all inputs and parameters*/
     
    39673967        /*Initialize Element vector and return if necessary*/
    39683968        if(IsOnWater()) return NULL;
    3969         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
     3969        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);
    39703970
    39713971        /*Retrieve all inputs and parameters*/
     
    41374137        /*Initialize Element vector and return if necessary*/
    41384138        if(IsOnWater()) return NULL;
    4139         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     4139        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    41404140
    41414141        /*Retrieve all inputs and parameters*/
     
    42044204        /*Initialize Element vector and return if necessary*/
    42054205        if(IsOnWater()) return NULL;
    4206         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     4206        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    42074207
    42084208        /*Retrieve all inputs and parameters*/
     
    42504250        /*Initialize Element vector and return if necessary*/
    42514251        if(IsOnWater()) return NULL;
    4252         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     4252        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    42534253
    42544254        /*Retrieve all inputs and parameters*/
     
    42974297        /*Initialize Element vector and return if necessary*/
    42984298        if(IsOnWater()) return NULL;
    4299         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     4299        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    43004300
    43014301        /*Retrieve all inputs and parameters*/
     
    43524352        /*Initialize Element vector and return if necessary*/
    43534353        if(IsOnWater()) return NULL;
    4354         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     4354        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    43554355
    43564356        /*Retrieve all inputs and parameters*/
     
    44104410        /*Initialize Element vector and return if necessary*/
    44114411        if(IsOnWater()) return NULL;
    4412         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     4412        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    44134413
    44144414        /*Retrieve all inputs and parameters*/
  • issm/trunk/src/c/objects/Loads/Icefront.cpp

    r5942 r5986  
    468468        /*Initialize Element vector and return if necessary*/
    469469        if(tria->IsOnWater()) return NULL;
    470         ElementVector* pe=NewElementVector(nodes,NUMVERTICESSEG,this->parameters,MacAyealApproximationEnum);
     470        ElementVector* pe=new ElementVector(nodes,NUMVERTICESSEG,this->parameters,MacAyealApproximationEnum);
    471471
    472472        /*Retrieve all inputs and parameters*/
     
    571571        /*Initialize Element vector and return if necessary*/
    572572        if(penta->IsOnWater()) return NULL;
    573         ElementVector* pe=NewElementVector(nodes,NUMVERTICESQUA,this->parameters,PattynApproximationEnum);
     573        ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,PattynApproximationEnum);
    574574
    575575        /*Retrieve all inputs and parameters*/
     
    645645        /*Initialize Element vector and return if necessary*/
    646646        if(penta->IsOnWater()) return NULL;
    647         ElementVector* pe=NewElementVector(nodes,NUMVERTICESQUA,this->parameters,StokesApproximationEnum);
     647        ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,StokesApproximationEnum);
    648648
    649649        /*Retrieve all inputs and parameters*/
  • issm/trunk/src/c/objects/Loads/Numericalflux.cpp

    r5911 r5986  
    600600        Tria*  tria=(Tria*)element;
    601601        if(tria->IsOnWater()) return NULL;
    602         ElementVector* pe=NewElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);
     602        ElementVector* pe=new ElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);
    603603
    604604        /*Retrieve all inputs and parameters*/
  • issm/trunk/src/c/objects/Loads/Pengrid.cpp

    r5937 r5986  
    625625        /*check that pengrid is not a clone (penalty to be added only once)*/
    626626        if (node->IsClone()) return NULL;
    627         ElementVector* pe=NewElementVector(&node,NUMVERTICES,this->parameters);
     627        ElementVector* pe=new ElementVector(&node,NUMVERTICES,this->parameters);
    628628
    629629        /*Retrieve all inputs and parameters*/
     
    665665        /*Initialize Element matrix and return if necessary*/
    666666        if(!this->active) return NULL;
    667         ElementVector* pe=NewElementVector(&node,1,this->parameters);
     667        ElementVector* pe=new ElementVector(&node,1,this->parameters);
    668668
    669669        /*Retrieve all inputs and parameters*/
  • issm/trunk/src/c/objects/Loads/Riftfront.cpp

    r5941 r5986  
    590590        /*Initialize Element Matrix*/
    591591        if(this->active) return NULL; /*The penalty is active. No loads implied here.*/
    592         ElementVector* pe=NewElementVector(nodes,NUMVERTICES,this->parameters);
     592        ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
    593593
    594594        /*Get some inputs: */
  • issm/trunk/src/c/objects/Numerics/ElementVector.cpp

    r5926 r5986  
    131131}
    132132/*}}}*/
    133 /*FUNCTION ElementVector::ElementVector(int gsize,int* gglobaldoflist){{{1*/
    134 ElementVector::ElementVector(int gsize,int* in_gglobaldoflist){
    135 
    136         this->nrows=gsize;
    137         this->pf=false;
    138        
     133/*FUNCTION ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){{{1*/
     134ElementVector::ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation){
     135
     136        /*retrieve some parameters: */
     137        parameters->FindParam(&this->pf,KffEnum);
     138
     139        /*get number of dofs in sets g,f and s: */
     140        this->nrows=GetNumberOfDofs(nodes,numnodes,GsetEnum,approximation);
     141
    139142        /*fill values with 0: */
    140143        this->values=(double*)xcalloc(this->nrows,sizeof(double));
    141144       
    142         /*dofs: */
    143         if(this->nrows){
    144                 this->gglobaldoflist=(int*)xmalloc(nrows*sizeof(int));
    145                 memcpy(this->gglobaldoflist,in_gglobaldoflist,nrows*sizeof(int));
    146         }
    147         else{
    148                 this->gglobaldoflist=NULL;
    149         }
    150         /*not needed: */
    151         this->fsize=0;
    152         this->flocaldoflist=NULL;
    153         this->fglobaldoflist=NULL;
    154 
    155 }
    156 /*}}}*/
    157 /*FUNCTION ElementVector::ElementVector(int gsize,int* flocaldoflist,int* fglobaldoflist,int fsize){{{1*/
    158 ElementVector::ElementVector(int gsize,int* in_flocaldoflist,int* in_fglobaldoflist,int in_fsize){
    159 
    160         this->nrows=gsize;
    161         this->pf=true;
    162        
    163         /*fill values with 0: */
    164         this->values=(double*)xcalloc(this->nrows,sizeof(double));
    165        
    166         /*dofs: */
    167         this->fsize=in_fsize;
    168         if(this->fsize){
    169                 this->flocaldoflist=(int*)xmalloc(fsize*sizeof(int));
    170                 this->fglobaldoflist=(int*)xmalloc(fsize*sizeof(int));
    171                 memcpy(this->flocaldoflist,in_flocaldoflist,fsize*sizeof(int));
    172                 memcpy(this->fglobaldoflist,in_fglobaldoflist,fsize*sizeof(int));
    173         }
    174         else{
    175                 this->flocaldoflist=NULL;
    176                 this->fglobaldoflist=NULL;
    177         }
    178        
    179         /*not needed: */
    180         this->gglobaldoflist=NULL;
    181 
     145        /*Get fsize*/
     146        if(pf) fsize=GetNumberOfDofs(nodes,numnodes,FsetEnum,approximation);
     147        else   fsize=0;
     148
     149        /*get dof lists for f and s set: */
     150        gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
     151        if(pf){
     152                flocaldoflist =GetLocalDofList( nodes,numnodes,FsetEnum,approximation);
     153                fglobaldoflist=GetGlobalDofList(nodes,numnodes,FsetEnum,approximation);
     154        }
     155        else{
     156                flocaldoflist =NULL;
     157                fglobaldoflist=NULL;
     158        }
    182159}
    183160/*}}}*/
  • issm/trunk/src/c/objects/Numerics/ElementVector.h

    r5926 r5986  
    1313#include "../Object.h"
    1414#include "../../toolkits/toolkits.h"
     15#include "../../EnumDefinitions/EnumDefinitions.h"
     16class Node;
    1517/*}}}*/
    1618
     
    3537                ElementVector(ElementVector* pe1,ElementVector* pe2);
    3638                ElementVector(ElementVector* pe1,ElementVector* pe2,ElementVector* pe3);
    37                 ElementVector(int gsize,int* gglobaldoflist);
    38                 ElementVector(int gsize,int* flocaldoflist,int* fglobaldoflist,int fsize);
     39                ElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
    3940                ~ElementVector();
    4041                /*}}}*/
  • issm/trunk/src/c/shared/Elements/elements.h

    r5908 r5986  
    1717int*           GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation_enum);
    1818ElementMatrix* NewElementMatrix(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
    19 ElementVector* NewElementVector(Node** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
    20 //ElementVector* NewElementVector(Nodes** nodes,int numnodes,Parameters* parameters,int approximation=NoneApproximationEnum);
    2119
    2220inline void printarray(double* array,int lines,int cols=1){
Note: See TracChangeset for help on using the changeset viewer.