MeshSerializeRegister

Adds a serialization method to the mesh package.

Synopsis

#include "mesh.h"  
int MeshRegisterDestroy()

Synopsis


MeshSerializeRegister(char *name, char *path, char *func_name, int (*serialize_func)(MPI_Comm, Mesh *, PetscViewer, PetscTruth))

Not Collective

Input Parameters

name - The name of a new user-defined serialization routine
path - The path (either absolute or relative) of the library containing this routine
func_name - The name of the serialization routine
serialize_func - The serialization routine itself

Notes

MeshSerializeRegister() may be called multiple times to add several user-defined serializers.

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

Sample usage

  MeshSerializeRegisterDynamic("my_store", "/home/username/my_lib/lib/libO/solaris/libmy.a", "MyStoreFunc", MyStoreFunc);

Then, your serialization can be chosen with the procedural interface via

    MeshSetSerializeType(mesh, "my_store")
or at runtime via the option
    -mesh_serialize_type my_store

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

Keywords

mesh, register

See Also

MeshSerializeRegisterAll(), MeshSerializeRegisterDestroy()
M*/ #undef __FUNCT__ #define __FUNCT__ "MeshSerializeRegister" int MeshSerializeRegister(const char sname[], const char path[], const char name[], int (*function)(MPI_Comm, Mesh *, PetscViewer, PetscTruth)) { char fullname[256]; int ierr;

PetscFunctionBegin; ierr = PetscStrcpy(fullname, path); CHKERRQ(ierr); ierr = PetscStrcat(fullname, ":"); CHKERRQ(ierr); ierr = PetscStrcat(fullname, name); CHKERRQ(ierr); ierr = PetscFListAdd(&MeshSerializeList, sname, fullname, (void (*)(void)) function); CHKERRQ(ierr); PetscFunctionReturn(0); }

/*MC MeshOrderingRegister - Adds an ordering method to the mesh package.

Synopsis


MeshOrderingRegister(char *order_name, char *path, char *order_func_name, int (*order_func)(MPI_Comm, Mesh *, PetscViewer, PetscTruth))

Not Collective

Input Parameters

order_name - The name of a new user-defined serialization routine
path - The path (either absolute or relative) of the library containing this routine
order_func_name - The name of routine to create method context
order_func - The serialization routine itself

Notes

MeshOrderingRegister() may be called multiple times to add several user-defined solvers.

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

Sample usage

  MeshOrderingRegister("my_order", /home/username/my_lib/lib/libO/solaris/mylib.a, "MyOrderFunc", MyOrderFunc);

Then, your serialization can be chosen with the procedural interface via

    MeshGetOrdering(mesh, "my_order", &ao)
or at runtime via the option
    -mesh_ordering_type my_order

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

Keywords

mesh, register

See Also

MeshOrderingRegisterAll(), MeshOrderingRegisterDestroy()
M*/ #undef __FUNCT__ #define __FUNCT__ "MeshOrderingRegister" int MeshOrderingRegister(const char sname[], const char path[], const char name[], int (*function)(Mesh, MeshOrderingType, AO *)) { char fullname[256]; int ierr;

PetscFunctionBegin; ierr = PetscStrcpy(fullname, path); CHKERRQ(ierr); ierr = PetscStrcat(fullname, ":"); CHKERRQ(ierr); ierr = PetscStrcat(fullname, name); CHKERRQ(ierr); ierr = PetscFListAdd(&MeshOrderingList, sname, fullname, (void (*)(void)) function); CHKERRQ(ierr); PetscFunctionReturn(0); }

/*-------------------------------------------------------------------------------------------------------------------*/ #undef __FUNCT__ #define __FUNCT__ "MeshRegisterDestroy" /*@C MeshRegisterDestroy - Frees the list of creation routines for meshes that were registered by MeshRegister().

Not collective

Keywords

mesh, register, destroy

See Also

MeshRegister(), MeshRegisterAll(), MeshSerializeRegisterDestroy()

Level:advanced
Location:
src/mesh/interface/meshreg.c
Index of all Mesh routines
Table of Contents for all manual pages
Index of all manual pages