# VecRegisterDynamic

Adds a new vector component implementation

### Synopsis

    PetscErrorCode VecRegisterDynamic(char *name, char *path, char *func_name, PetscErrorCode (*create_func)(Vec))

Not Collective

### Input Parameters

| name | - The name of a new user-defined creation routine
| path | - The path (either absolute or relative) of the library containing this routine
| func_name | - The name of routine to create method context
| create_func | - The creation routine itself

### Notes

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

If dynamic libraries are used, then the fourth input argument (routine_create) is ignored.

### Sample usage

        VecRegisterDynamic("my_vec","/home/username/my_lib/lib/libO/solaris/libmy.a", "MyVectorCreate", 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

Notes: $PETSC_ARCH occuring in pathname will be replaced with appropriate values. If your function is not being put into a shared library then use VecRegister() instead

### Keywords

Vec, register

### See Also

VecRegisterAll(), VecRegisterDestroy(), VecRegister()

Level:advanced
Location:src/vec/../../include/petscvec.h
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages