Date: 2016-07-24T16:50:55+00:00

Actual source code: sfregi.c
petsc-3.7.3 2016-07-24
Report Typos and Errors

      1: #include <petsc/private/sfimpl.h>     /*I  "petscsf.h"  I*/

      3: #if defined(PETSC_HAVE_MPI_WIN_CREATE)
      4: PETSC_EXTERN PetscErrorCode PetscSFCreate_Window(PetscSF);
      5: #endif
      6: PETSC_EXTERN PetscErrorCode PetscSFCreate_Basic(PetscSF);

      8: PetscFunctionList PetscSFList;

     12: /*@C
     13:    PetscSFRegisterAll - Registers all the PetscSF communication implementations

     15:    Not Collective

     17:    Level: advanced

     19: .keywords: PetscSF, register, all

     21: .seealso:  PetscSFRegisterDestroy()
     22: @*/
     23: PetscErrorCode  PetscSFRegisterAll(void)
     24: {

     28:   if (PetscSFRegisterAllCalled) return(0);
     29:   PetscSFRegisterAllCalled = PETSC_TRUE;
     30: #if defined(PETSC_HAVE_MPI_WIN_CREATE) && defined(PETSC_HAVE_MPI_TYPE_DUP)
     31:   PetscSFRegister(PETSCSFWINDOW, PetscSFCreate_Window);
     32: #endif
     33:   PetscSFRegister(PETSCSFBASIC,  PetscSFCreate_Basic);
     34:   return(0);
     35: }

     39: /*@C
     40:   PetscSFRegister  - Adds an implementation of the PetscSF communication protocol.

     42:    Not collective

     44:    Input Parameters:
     45: +  name_impl - name of a new user-defined implementation
     46: -  routine_create - routine to create method context

     48:    Notes:
     49:    PetscSFRegister() may be called multiple times to add several user-defined implementations.

     51:    Sample usage:
     52: .vb
     53:    PetscSFRegister("my_impl",MyImplCreate);
     54: .ve

     56:    Then, this implementation can be chosen with the procedural interface via
     57: $     PetscSFSetType(sf,"my_impl")
     58:    or at runtime via the option
     59: $     -snes_type my_solver

     61:    Level: advanced

     63: .keywords: PetscSF, register

     65: .seealso: PetscSFRegisterAll(), PetscSFRegisterDestroy()
     66: @*/
     67: PetscErrorCode  PetscSFRegister(const char sname[],PetscErrorCode (*function)(PetscSF))
     68: {

     72:   PetscFunctionListAdd(&PetscSFList,sname,function);
     73:   return(0);
     74: }