Actual source code: vecs.c

petsc-3.7.5 2017-01-01
Report Typos and Errors
  2: #include <petscvec.h>

  6: PetscErrorCode VecsDestroy(Vecs x)
  7: {
 10:   VecDestroy(&(x)->v);
 11:   PetscFree(x);
 12:   return(0);
 13: }

 17: PetscErrorCode VecsCreateSeq(MPI_Comm comm,PetscInt p,PetscInt m,Vecs *x)
 18: {
 21:   PetscNew(x);
 22:   VecCreateSeq(comm,p*m,&(*x)->v);
 23:   (*x)->n = m;
 24:   return(0);
 25: }

 29: PetscErrorCode VecsCreateSeqWithArray(MPI_Comm comm,PetscInt p,PetscInt m,PetscScalar *a,Vecs *x)
 30: {
 33:   PetscNew(x);
 34:   VecCreateSeqWithArray(comm,1,p*m,a,&(*x)->v);
 35:   (*x)->n = m;
 36:   return(0);
 37: }

 41: PetscErrorCode VecsDuplicate(Vecs x,Vecs *y)
 42: {
 45:   PetscNew(y);
 46:   VecDuplicate(x->v,&(*y)->v);
 47:   (*y)->n = x->n;
 48:   return(0);
 49: }