TaoWrapPetscVec

Creates a new TaoVec object using an existing PETSc Vec.

Synopsis

int TaoWrapPetscVec( Vec V, TaoVecPetsc* *TV)

Input Parameter

V - a PETSc vector
TV - the address of a pointer to a TaoVecPetsc

Output Parameter

TV -pointer to a new TaoVecPetsc

Note: A TaoVecPetsc is an object with the methods of an abstract TaoVec object. A TaoVecPetsc contains an implementation of the TaoVec methods. Routines using these vectors should declare a pointer to a TaoVec, assign this pointer to the address of a TaoVec object, use the pointer to invoke methods on the object, and use this pointer as an argument when calling other routines. This usage is different from the usage of a PETSc Vec. In PETSc, applications will typically declare a Vec, and pass it as an argument into routines. That is, applications will typically declare a pointer to a TaoVec and use the pointer, or declare a Vec and use it directly.

Note

The user is responsible for destroying the Vec V, in addition to to TaoVecPetsc vector TV. The Vec can be destroyed immediately after this routine.

See Also

TaoVecGetPetscVec(), TaoVecDestroy()

Level:developer
Location:src/petsctao/vector/taovec_petsc.c
TAO Solver Index
Table of Contents