 |
Ice Sheet System Model
4.18
Code documentation
|
Go to the documentation of this file.
10 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
15 #include "../petscincludes.h"
16 #include "../../../shared/shared.h"
37 VecSetSizes(this->
vector,m,M);
38 VecSetFromOptions(this->
vector);
50 VecDuplicate(petsc_vec,&this->
vector);
51 VecCopy(petsc_vec,this->
vector);
59 if(M)idxm=xNew<int>(M);
60 for(
int i=0;i<M;i++) idxm[i]=i;
63 VecSetValues(this->
vector,M,idxm,serial_vec,INSERT_VALUES);
64 VecAssemblyBegin(this->
vector);
65 VecAssemblyEnd(this->
vector);
79 VecView(this->
vector,PETSC_VIEWER_STDOUT_WORLD);
85 VecAssemblyBegin(this->
vector);
86 VecAssemblyEnd(this->
vector);
107 VecGetValues(this->
vector,1,&dof,pvalue);
114 VecGetSize(this->
vector,pM);
120 VecGetLocalSize(this->
vector,pm);
137 PetscInt lower_row,upper_row;
138 VecGetOwnershipRange(this->
vector,&lower_row,&upper_row);
139 int range=upper_row-lower_row;
149 int* indices=xNew<int>(range);
150 for(
int i=0;i<range;i++) indices[i]=lower_row+i;
153 VecGetValues(this->
vector,range,indices,values);
162 VecDuplicate(this->
vector,&vec_output);
172 VecSet(this->
vector,value);
240 VecScale(this->
vector,scale_factor);
247 VecPow(this->
vector,scale_factor);
void AYPX(PetscVec *X, IssmDouble a)
void SetValues(int ssize, int *list, IssmDouble *values, InsMode mode)
static ISSM_MPI_Comm GetComm(void)
void GetLocalSize(int *pM)
void PointwiseMult(PetscVec *x, PetscVec *y)
void GetValue(IssmDouble *pvalue, int dof)
IssmDouble Dot(PetscVec *vector)
void Scale(IssmDouble scale_factor)
void Shift(IssmDouble shift)
NormType ISSMToPetscNormMode(NormMode mode)
Vec NewVec(int size, ISSM_MPI_Comm comm, bool fromlocalsize)
int VecToMPISerial(double **pgathered_vector, Vec vector, ISSM_MPI_Comm comm, bool broadcast=true)
IssmDouble * ToMPISerial0(void)
PetscVec * Duplicate(void)
void GetLocalVector(IssmDouble **pvector, int **pindices)
IssmDouble Norm(NormMode norm_type)
void PointwiseDivide(PetscVec *x, PetscVec *y)
void AXPY(PetscVec *X, IssmDouble a)
InsertMode ISSMToPetscInsertMode(InsMode mode)
void Pow(IssmDouble scale_factor)
IssmDouble * ToMPISerial(void)
void Set(IssmDouble value)
IssmDouble max(IssmDouble a, IssmDouble b)
void SetValue(int dof, IssmDouble value, InsMode mode)