DiscretizationRegister

Adds a creation method to the discretization package.

Synopsis

#include "discretization.h"  
#undef __FUNCT__  
#define __FUNCT__ "DiscretizationRegister"
int DiscretizationRegister(const char sname[], const char path[], const char name[], int (*function)(Discretization))

Synopsis


DiscretizationRegister(char *name, char *path, char *func_name, int (*create_func)(Discretization))

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 the creation routine
create_func - The creation routine itself

Notes

DiscretizationRegister() may be called multiple times to add several user-defined disces.

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

Sample usage

  DiscretizationRegisterDynamic("my_disc", "/home/username/my_lib/lib/libO/solaris/libmy.a", "MyDiscretizationCreate", MyDiscretizationCreate);

Then, your disc type can be chosen with the procedural interface via

    DiscretizationCreate(MPI_Comm, Discretization *);
    DiscretizationSetType(vec, "my_disc")
or at runtime via the option
    -discretization_type my_disc

Note: $PETSC_ARCH and $BOPT occuring in pathname will be replaced with appropriate values.

Keywords

Discretizationretization, register

See Also

DiscretizationRegisterAll(), DiscretizationRegisterDestroy()

Level:advanced
Location:
src/grid/discretization/interface/discreg.c
Index of all Discretization routines
Table of Contents for all manual pages
Index of all manual pages