#include "petscvec.h" PetscErrorCode VecRegister(const char sname[], PetscErrorCode (*function)(Vec))Not Collective
name | - The name of a new user-defined creation routine | |
create_func | - The creation routine itself |
VecRegister("my_vec",MyVectorCreate);
Then, your vector type can be chosen with the procedural interface via
VecCreate(MPI_Comm, Vec *); VecSetType(Vec,"my_vector_name");or at runtime via the option
-vec_type my_vector_name