Changeset 5986
- Timestamp:
- 09/23/10 11:58:43 (14 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r5908 r5986 273 273 ./shared/Elements/GetNumberOfDofs.cpp\ 274 274 ./shared/Elements/NewElementMatrix.cpp\ 275 ./shared/Elements/NewElementVector.cpp\276 275 ./shared/String/DescriptorIndex.cpp\ 277 276 ./shared/String/sharedstring.h\ … … 833 832 ./shared/Elements/GetNumberOfDofs.cpp\ 834 833 ./shared/Elements/NewElementMatrix.cpp\ 835 ./shared/Elements/NewElementVector.cpp\836 834 ./shared/String/DescriptorIndex.cpp\ 837 835 ./shared/String/sharedstring.h\ -
issm/trunk/src/c/objects/Elements/Penta.cpp
r5978 r5986 3019 3019 inputs->GetParameterValue(&approximation,ApproximationEnum); 3020 3020 if(approximation!=PattynStokesApproximationEnum) return NULL; 3021 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);3021 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum); 3022 3022 3023 3023 /*Retrieve all inputs and parameters*/ … … 3083 3083 inputs->GetParameterValue(&approximation,ApproximationEnum); 3084 3084 if(approximation!=PattynStokesApproximationEnum) return NULL; 3085 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);3085 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum); 3086 3086 3087 3087 /*Retrieve all inputs and parameters*/ … … 3206 3206 /*Initialize Element vector and return if necessary*/ 3207 3207 if(IsOnWater()) return NULL; 3208 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3208 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3209 3209 3210 3210 /*Retrieve all inputs and parameters*/ … … 3304 3304 /*Initialize Element vector and return if necessary*/ 3305 3305 if(IsOnWater()) return NULL; 3306 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum);3306 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,PattynApproximationEnum); 3307 3307 3308 3308 /*Retrieve all inputs and parameters*/ … … 3376 3376 inputs->GetParameterValue(&approximation,ApproximationEnum); 3377 3377 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); 3379 3379 3380 3380 /*Retrieve all inputs and parameters*/ … … 3444 3444 inputs->GetParameterValue(&approximation,ApproximationEnum); 3445 3445 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); 3447 3447 3448 3448 /*Retrieve all inputs and parameters*/ … … 3521 3521 /*Initialize Element vector and return if necessary*/ 3522 3522 if(IsOnWater()) return NULL; 3523 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3523 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3524 3524 3525 3525 /*Retrieve all inputs and parameters*/ … … 3652 3652 /*Initialize Element vector and return if necessary*/ 3653 3653 if(IsOnWater()) return NULL; 3654 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3654 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3655 3655 3656 3656 /*Retrieve all inputs and parameters*/ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r5946 r5986 3473 3473 /*Initialize Element vector and return if necessary*/ 3474 3474 if(IsOnWater()) return NULL; 3475 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3475 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3476 3476 3477 3477 /*Retrieve all inputs and parameters*/ … … 3517 3517 /*Initialize Element vector and return if necessary*/ 3518 3518 if(IsOnWater()) return NULL; 3519 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3519 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3520 3520 3521 3521 /*Retrieve all inputs and parameters*/ … … 3561 3561 /*Initialize Element vector and return if necessary*/ 3562 3562 if(IsOnWater()) return NULL; 3563 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3563 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3564 3564 3565 3565 /*Retrieve all inputs and parameters*/ … … 3606 3606 /*Initialize Element vector and return if necessary*/ 3607 3607 if(IsOnWater()) return NULL; 3608 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3608 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3609 3609 3610 3610 /*Retrieve all inputs and parameters*/ … … 3667 3667 /*Initialize Element vector and return if necessary*/ 3668 3668 if(IsOnWater()) return NULL; 3669 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum);3669 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,MacAyealApproximationEnum); 3670 3670 3671 3671 /*Retrieve all inputs and parameters*/ … … 3732 3732 /*Initialize Element vector and return if necessary*/ 3733 3733 if(IsOnWater()) return NULL; 3734 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3734 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3735 3735 3736 3736 /*Retrieve all inputs and parameters*/ … … 3786 3786 /*Initialize Element vector and return if necessary*/ 3787 3787 if(IsOnWater()) return NULL; 3788 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);3788 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 3789 3789 3790 3790 /*Retrieve all inputs and parameters*/ … … 3967 3967 /*Initialize Element vector and return if necessary*/ 3968 3968 if(IsOnWater()) return NULL; 3969 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum);3969 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters,StokesApproximationEnum); 3970 3970 3971 3971 /*Retrieve all inputs and parameters*/ … … 4137 4137 /*Initialize Element vector and return if necessary*/ 4138 4138 if(IsOnWater()) return NULL; 4139 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);4139 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 4140 4140 4141 4141 /*Retrieve all inputs and parameters*/ … … 4204 4204 /*Initialize Element vector and return if necessary*/ 4205 4205 if(IsOnWater()) return NULL; 4206 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);4206 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 4207 4207 4208 4208 /*Retrieve all inputs and parameters*/ … … 4250 4250 /*Initialize Element vector and return if necessary*/ 4251 4251 if(IsOnWater()) return NULL; 4252 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);4252 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 4253 4253 4254 4254 /*Retrieve all inputs and parameters*/ … … 4297 4297 /*Initialize Element vector and return if necessary*/ 4298 4298 if(IsOnWater()) return NULL; 4299 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);4299 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 4300 4300 4301 4301 /*Retrieve all inputs and parameters*/ … … 4352 4352 /*Initialize Element vector and return if necessary*/ 4353 4353 if(IsOnWater()) return NULL; 4354 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);4354 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 4355 4355 4356 4356 /*Retrieve all inputs and parameters*/ … … 4410 4410 /*Initialize Element vector and return if necessary*/ 4411 4411 if(IsOnWater()) return NULL; 4412 ElementVector* pe= NewElementVector(nodes,NUMVERTICES,this->parameters);4412 ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters); 4413 4413 4414 4414 /*Retrieve all inputs and parameters*/ -
issm/trunk/src/c/objects/Loads/Icefront.cpp
r5942 r5986 468 468 /*Initialize Element vector and return if necessary*/ 469 469 if(tria->IsOnWater()) return NULL; 470 ElementVector* pe= NewElementVector(nodes,NUMVERTICESSEG,this->parameters,MacAyealApproximationEnum);470 ElementVector* pe=new ElementVector(nodes,NUMVERTICESSEG,this->parameters,MacAyealApproximationEnum); 471 471 472 472 /*Retrieve all inputs and parameters*/ … … 571 571 /*Initialize Element vector and return if necessary*/ 572 572 if(penta->IsOnWater()) return NULL; 573 ElementVector* pe= NewElementVector(nodes,NUMVERTICESQUA,this->parameters,PattynApproximationEnum);573 ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,PattynApproximationEnum); 574 574 575 575 /*Retrieve all inputs and parameters*/ … … 645 645 /*Initialize Element vector and return if necessary*/ 646 646 if(penta->IsOnWater()) return NULL; 647 ElementVector* pe= NewElementVector(nodes,NUMVERTICESQUA,this->parameters,StokesApproximationEnum);647 ElementVector* pe=new ElementVector(nodes,NUMVERTICESQUA,this->parameters,StokesApproximationEnum); 648 648 649 649 /*Retrieve all inputs and parameters*/ -
issm/trunk/src/c/objects/Loads/Numericalflux.cpp
r5911 r5986 600 600 Tria* tria=(Tria*)element; 601 601 if(tria->IsOnWater()) return NULL; 602 ElementVector* pe= NewElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters);602 ElementVector* pe=new ElementVector(nodes,NUMVERTICES_BOUNDARY,this->parameters); 603 603 604 604 /*Retrieve all inputs and parameters*/ -
issm/trunk/src/c/objects/Loads/Pengrid.cpp
r5937 r5986 625 625 /*check that pengrid is not a clone (penalty to be added only once)*/ 626 626 if (node->IsClone()) return NULL; 627 ElementVector* pe= NewElementVector(&node,NUMVERTICES,this->parameters);627 ElementVector* pe=new ElementVector(&node,NUMVERTICES,this->parameters); 628 628 629 629 /*Retrieve all inputs and parameters*/ … … 665 665 /*Initialize Element matrix and return if necessary*/ 666 666 if(!this->active) return NULL; 667 ElementVector* pe= NewElementVector(&node,1,this->parameters);667 ElementVector* pe=new ElementVector(&node,1,this->parameters); 668 668 669 669 /*Retrieve all inputs and parameters*/ -
issm/trunk/src/c/objects/Loads/Riftfront.cpp
r5941 r5986 590 590 /*Initialize Element Matrix*/ 591 591 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); 593 593 594 594 /*Get some inputs: */ -
issm/trunk/src/c/objects/Numerics/ElementVector.cpp
r5926 r5986 131 131 } 132 132 /*}}}*/ 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*/ 134 ElementVector::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 139 142 /*fill values with 0: */ 140 143 this->values=(double*)xcalloc(this->nrows,sizeof(double)); 141 144 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 } 182 159 } 183 160 /*}}}*/ -
issm/trunk/src/c/objects/Numerics/ElementVector.h
r5926 r5986 13 13 #include "../Object.h" 14 14 #include "../../toolkits/toolkits.h" 15 #include "../../EnumDefinitions/EnumDefinitions.h" 16 class Node; 15 17 /*}}}*/ 16 18 … … 35 37 ElementVector(ElementVector* pe1,ElementVector* pe2); 36 38 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); 39 40 ~ElementVector(); 40 41 /*}}}*/ -
issm/trunk/src/c/shared/Elements/elements.h
r5908 r5986 17 17 int* GetGlobalDofList(Node** nodes,int numnodes,int setenum,int approximation_enum); 18 18 ElementMatrix* 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);21 19 22 20 inline void printarray(double* array,int lines,int cols=1){
Note:
See TracChangeset
for help on using the changeset viewer.