petscdmlibmesh.C File Reference

Go to the source code of this file.

Functions

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

Function Documentation

◆ DMlibMeshGetSystem()

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

Definition at line 53 of file petscdmlibmesh.C.

References CHKERRQ(), ierr, and PetscFunctionReturn().

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

54 {
55  PetscErrorCode (*f)(DM,libMesh::NonlinearImplicitSystem *&) = 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 }
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
PetscErrorCode ierr
PetscFunctionReturn(0)
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 CHKERRQ(), ierr, and PetscFunctionReturn().

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 #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 }
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
PetscErrorCode ierr
PetscFunctionReturn(0)
CHKERRQ(ierr)