Changeset 12863
- Timestamp:
- 08/01/12 19:11:21 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/toolkits
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/toolkits/issm/SeqVec.cpp
r12520 r12863 42 42 this->vector=NULL; 43 43 if(this->M){ 44 this->vector=xNew ZeroInit<IssmDouble>(pM);44 this->vector=xNew<IssmDouble>(pM); 45 45 xMemCpy<IssmDouble>(this->vector,buffer,pM); 46 46 } -
issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp
r12859 r12863 34 34 } 35 35 /*}}}*/ 36 /*FUNCTION PetscVec::PetscVec(IssmDouble* serial_vec,int M){{{*/ 37 PetscVec::PetscVec(IssmDouble* serial_vec,int M){ 38 39 int* idxm=NULL; 40 if(M)idxm=xNew<int>(M); 41 for(int i=0;i<M;i++) idxm[i]=i; 42 43 this->vector=NewVec(M); 44 VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES); 45 VecAssemblyBegin(this->vector); 46 VecAssemblyEnd(this->vector); 47 48 xDelete<int>(idxm); 49 } 50 /*}}}*/ 51 /*FUNCTION PetscVec::~PetscVec(){{{*/ 52 PetscVec::~PetscVec(){ 53 VecFree(&this->vector); 54 } 55 /*}}}*/ 56 /*FUNCTION Vector::Vector(Vec petsc_vec){{{*/ 36 /*FUNCTION PetscVec::PetscVec(Vec petsc_vec){{{*/ 57 37 PetscVec::PetscVec(Vec petsc_vec){ 58 38 … … 68 48 } 69 49 /*}}}*/ 50 /*FUNCTION PetscVec::PetscVec(IssmDouble* serial_vec,int M){{{*/ 51 PetscVec::PetscVec(IssmDouble* serial_vec,int M){ 52 53 int* idxm=NULL; 54 if(M)idxm=xNew<int>(M); 55 for(int i=0;i<M;i++) idxm[i]=i; 56 57 this->vector=NewVec(M); 58 VecSetValues(this->vector,M,idxm,serial_vec,INSERT_VALUES); 59 VecAssemblyBegin(this->vector); 60 VecAssemblyEnd(this->vector); 61 62 xDelete<int>(idxm); 63 } 64 /*}}}*/ 65 /*FUNCTION PetscVec::~PetscVec(){{{*/ 66 PetscVec::~PetscVec(){ 67 VecFree(&this->vector); 68 } 69 /*}}}*/ 70 70 71 71 /*PetscVec specific routines: */
Note:
See TracChangeset
for help on using the changeset viewer.