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

◆ DMlibMeshGetSystem()

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

Definition at line 48 of file petscdmlibmesh.C.

References libMesh::LibmeshPetscCallQ(), and libMesh::PetscFunctionReturn().

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

49 {
50  PetscErrorCode (*f)(DM,libMesh::NonlinearImplicitSystem *&) = nullptr;
51 
52  PetscFunctionBegin;
53  PetscValidHeaderSpecific(dm,DM_CLASSID,1);
54  LibmeshPetscCallQ(PetscObjectQueryFunction((PetscObject)dm,"DMlibMeshGetSystem_C",&f));
55  if (!f) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP, "DM has no implementation for DMlibMeshGetSystem");
56  LibmeshPetscCallQ((*f)(dm,sys));
57  PetscFunctionReturn(LIBMESH_PETSC_SUCCESS);
58 }
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
LibmeshPetscCallQ(DMShellGetContext(dm, &ctx))
PetscFunctionReturn(LIBMESH_PETSC_SUCCESS)

◆ DMlibMeshSetSystem()

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 libMesh::LibmeshPetscCallQ(), and libMesh::PetscFunctionReturn().

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

35 {
36  PetscErrorCode (*f)(DM,libMesh::NonlinearImplicitSystem &) = nullptr;
37 
38  PetscFunctionBegin;
39  PetscValidHeaderSpecific(dm,DM_CLASSID,1);
40  LibmeshPetscCallQ(PetscObjectQueryFunction((PetscObject)dm,"DMlibMeshSetSystem_C",&f));
41  if (!f) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP, "DM has no implementation for DMlibMeshSetSystem");
42  LibmeshPetscCallQ((*f)(dm,sys));
43  PetscFunctionReturn(LIBMESH_PETSC_SUCCESS);
44 }
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
LibmeshPetscCallQ(DMShellGetContext(dm, &ctx))
PetscFunctionReturn(LIBMESH_PETSC_SUCCESS)