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 49 of file petscdmlibmesh.C.

References libMesh::CHKERRQ(), and libMesh::ierr.

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

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

◆ 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::CHKERRQ(), and libMesh::ierr.

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

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