libMesh
Loading...
Searching...
No Matches
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.
 
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.

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...
PetscFunctionReturn(LIBMESH_PETSC_SUCCESS)
LibmeshPetscCallQ(DMShellGetContext(dm, &ctx))

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

◆ DMlibMeshSetSystem()

PetscErrorCode DMlibMeshSetSystem ( DM  dm,
libMesh::NonlinearImplicitSystem sys 
)

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.

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}

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