libMesh
Functions
petscdmlibmesh.C File Reference

Go to the source code of this file.

Functions

PetscErrorCode DMlibMeshSetSystem (DM dm, libMesh::NonlinearImplicitSystem &sys)
 Any functional implementation of the DMlibMesh API must compose the following functions with the DM object. More...
 
PetscErrorCode DMlibMeshGetSystem (DM dm, libMesh::NonlinearImplicitSystem *&sys)
 

Function Documentation

PetscErrorCode DMlibMeshGetSystem ( DM  dm,
libMesh::NonlinearImplicitSystem *&  sys 
)

Definition at line 53 of file petscdmlibmesh.C.

References CHKERRQ(), ierr, libmesh_nullptr, PetscFunctionReturn(), and libMesh::sys.

Referenced by DMlibMeshFunction(), DMlibMeshJacobian(), and DMVariableBounds_libMesh().

54 {
55  PetscErrorCode (*f)(DM,libMesh::NonlinearImplicitSystem *&) = libmesh_nullptr;
56  PetscErrorCode ierr;
57 
58  PetscFunctionBegin;
59  PetscValidHeaderSpecific(dm,DM_CLASSID,1);
60 #if PETSC_RELEASE_LESS_THAN(3,4,0)
61  ierr = PetscObjectQueryFunction((PetscObject)dm,"DMlibMeshGetSystem_C",(PetscVoidFunction*)&f);CHKERRQ(ierr);
62 #else
63  ierr = PetscObjectQueryFunction((PetscObject)dm,"DMlibMeshGetSystem_C",&f);CHKERRQ(ierr);
64 #endif
65  if (!f) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP, "DM has no implementation for DMlibMeshGetSystem");
66  ierr = (*f)(dm,sys);CHKERRQ(ierr);
68 }
ImplicitSystem & sys
const class libmesh_nullptr_t libmesh_nullptr
This class provides a specific system class.
PetscErrorCode ierr
PetscFunctionReturn(0)
CHKERRQ(ierr)
PetscErrorCode DMlibMeshSetSystem ( DM  ,
libMesh::NonlinearImplicitSystem  
)

Any functional implementation of the DMlibMesh API must compose the following functions with the DM object.

(See PETSc documentation on PetscObjectComposeFunction(), a polymorphism mechanism.) The following functions are called in PetscNonlinear Solver (others can be called by users): DMlibMeshSetSystem(), DMlibMeshGetSystem()

Any implementation needs to register its creation routine, DMCreate_libMesh, with PETSc using DMRegister().

Definition at line 34 of file petscdmlibmesh.C.

References CHKERRQ(), ierr, libmesh_nullptr, PetscFunctionReturn(), and libMesh::sys.

Referenced by libMesh::PetscNonlinearSolver< T >::init().

35 {
36  PetscErrorCode (*f)(DM,libMesh::NonlinearImplicitSystem &) = libmesh_nullptr;
37  PetscErrorCode ierr;
38 
39  PetscFunctionBegin;
40  PetscValidHeaderSpecific(dm,DM_CLASSID,1);
41 #if PETSC_RELEASE_LESS_THAN(3,4,0)
42  ierr = PetscObjectQueryFunction((PetscObject)dm,"DMlibMeshSetSystem_C",(PetscVoidFunction*)&f);CHKERRQ(ierr);
43 #else
44  ierr = PetscObjectQueryFunction((PetscObject)dm,"DMlibMeshSetSystem_C",&f);CHKERRQ(ierr);
45 #endif
46  if (!f) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP, "DM has no implementation for DMlibMeshSetSystem");
47  ierr = (*f)(dm,sys);CHKERRQ(ierr);
49 }
ImplicitSystem & sys
const class libmesh_nullptr_t libmesh_nullptr
This class provides a specific system class.
PetscErrorCode ierr
PetscFunctionReturn(0)
CHKERRQ(ierr)