Skip to main content
`Ctrl`+`K`

# VecRegister

Adds a new vector component implementation

## Synopsis

    #include "petscvec.h"
    PetscErrorCode VecRegister(const char sname[], PetscErrorCode (*function)(Vec))

Not Collective, No Fortran Support

## Input Parameters

- sname - The name of a new user-defined creation routine

- function - The creation routine

## Notes

`VecRegister()` may be called multiple times to add several user-defined vectors

## Example Usage

        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

## See Also

`VecRegisterAll()`, `VecRegisterDestroy()`

## Level

advanced

## Location

src/vec/vec/interface/vecreg.c

Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages