Date: 2013-07-02T14:39:48+00:00

Actual source code: vecs.c
petsc-3.4.2 2013-07-02

      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(struct _n_Vecs,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(struct _n_Vecs,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(struct _n_Vecs,y);
     46:   VecDuplicate(x->v,&(*y)->v);
     47:   (*y)->n = x->n;
     48:   return(0);
     49: }