23 #if !PETSC_VERSION_LESS_THAN(3,3,0) 26 #if !PETSC_RELEASE_LESS_THAN(3,6,0) 27 # include <petsc/private/dmimpl.h> 29 # include <petsc-private/dmimpl.h> 48 #define DMLIBMESH_NO_DECOMPOSITION 0 49 #define DMLIBMESH_FIELD_DECOMPOSITION 1 50 #define DMLIBMESH_DOMAIN_DECOMPOSITION 2 52 #define DMLIBMESH_NO_EMBEDDING 0 53 #define DMLIBMESH_FIELD_EMBEDDING 1 54 #define DMLIBMESH_DOMAIN_EMBEDDING 2 59 std::map<std::string, unsigned int> *
varids;
60 std::map<unsigned int, std::string> *
varnames;
61 std::map<std::string, unsigned int> *
blockids;
75 #define __FUNCT__ "DMlibMeshGetVec_Private" 88 #define __FUNCT__ "DMlibMeshSetSystem_libMesh" 95 PetscValidHeaderSpecific(dm,DM_CLASSID,1);
97 ierr = PetscObjectTypeCompare((PetscObject)dm, DMLIBMESH,&islibmesh);
98 if (!islibmesh) SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Got DM of type %s, not of type %s", ((PetscObject)dm)->type_name, DMLIBMESH);
100 if (dm->setupcalled) SETERRQ(((PetscObject)dm)->comm,
PETSC_ERR_ARG_WRONGSTATE,
"Cannot reset the libMesh system after DM has been set up.");
108 for (
unsigned int v = 0; v < dofmap.
n_variables(); ++v) {
110 dlm->
varids->insert(std::pair<std::string,unsigned int>(vname,v));
111 dlm->
varnames->insert(std::pair<unsigned int,std::string>(v,vname));
116 std::set<subdomain_id_type> blocks;
121 blocks.insert(elem->subdomain_id());
125 std::set<subdomain_id_type>::iterator bit = blocks.begin();
126 std::set<subdomain_id_type>::iterator bend = blocks.end();
127 if (bit == bend) SETERRQ(((PetscObject)dm)->comm, PETSC_ERR_PLIB,
"No mesh blocks found.");
129 for (; bit != bend; ++bit) {
132 if (!bname.length()) {
137 std::ostringstream ss;
141 dlm->
blockids->insert(std::pair<std::string,unsigned int>(bname,bid));
142 dlm->
blocknames->insert(std::pair<unsigned int,std::string>(bid,bname));
149 #define __FUNCT__ "DMlibMeshGetSystem_libMesh" 155 PetscValidHeaderSpecific(dm,DM_CLASSID,1);
157 ierr = PetscObjectTypeCompare((PetscObject)dm, DMLIBMESH,&islibmesh);
CHKERRQ(
ierr);
158 if (!islibmesh) SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Got DM of type %s, not of type %s", ((PetscObject)dm)->type_name, DMLIBMESH);
166 #define __FUNCT__ "DMlibMeshGetBlocks" 172 PetscValidHeaderSpecific(dm,DM_CLASSID,1);
174 ierr = PetscObjectTypeCompare((PetscObject)dm, DMLIBMESH,&islibmesh);
175 if (!islibmesh) SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Got DM of type %s, not of type %s", ((PetscObject)dm)->type_name, DMLIBMESH);
177 PetscValidPointer(n,2);
178 *n = cast_int<unsigned int>(
dlm->
blockids->size());
184 ierr = PetscStrallocpy(pr.first.c_str(), *blocknames+i);
CHKERRQ(
ierr);
191 #define __FUNCT__ "DMlibMeshGetVariables" 196 PetscValidHeaderSpecific(dm,DM_CLASSID,1);
199 ierr = PetscObjectTypeCompare((PetscObject)dm, DMLIBMESH,&islibmesh);
200 if (!islibmesh) SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Got DM of type %s, not of type %s", ((PetscObject)dm)->type_name, DMLIBMESH);
202 PetscValidPointer(n,2);
203 *n = cast_int<unsigned int>(
dlm->
varids->size());
216 #define __FUNCT__ "DMlibMeshSetUpName_Private" 223 std::map<unsigned int, std::string> * dnames = PETSC_NULL, * enames = PETSC_NULL;
229 name +=
":dec:block:";
235 unsigned int id = *dit;
238 name += (*dnames)[id];
248 name +=
":emb:block:";
252 for (std::map<unsigned int, std::string>::iterator eit = enames->begin(); eit != enames->end(); ++eit) {
253 std::string ename = eit->second;
254 if (eit != enames->begin())
266 #define __FUNCT__ "DMCreateFieldDecomposition_libMesh" 277 if (namelist) {
ierr = PetscMalloc(*len*
sizeof(
char *), namelist);
CHKERRQ(
ierr);}
278 if (islist) {
ierr = PetscMalloc(*len*
sizeof(IS), islist);
CHKERRQ(
ierr);}
279 if (dmlist) {
ierr = PetscMalloc(*len*
sizeof(DM), dmlist);
CHKERRQ(
ierr);}
282 std::set<numeric_index_type> dindices;
284 std::map<std::string, unsigned int> dvarids;
285 std::map<unsigned int, std::string> dvarnames;
286 unsigned int dvcount = 0;
289 dvarids.insert(std::pair<std::string, unsigned int>(vname,v));
290 dvarnames.insert(std::pair<unsigned int,std::string>(v,vname));
291 if (!dvcount) dname = vname;
292 else dname +=
"_" + vname;
294 if (!islist)
continue;
298 for (
const auto & elem :
302 std::vector<numeric_index_type> evindices;
305 for (
unsigned int i = 0; i < evindices.size(); ++i) {
308 dindices.insert(dof);
319 ierr = PetscMalloc(
sizeof(PetscInt)*dindices.size(), &darray);
CHKERRQ(
ierr);
321 for (
const auto &
id : dindices) {
325 ierr = ISCreateGeneral(((PetscObject)dm)->comm,
326 cast_int<PetscInt>(dindices.size()),
331 #if PETSC_RELEASE_LESS_THAN(3,3,1) 339 if (elen != dlen) SETERRQ1(((PetscObject)dm)->comm, PETSC_ERR_PLIB,
"Failed to embed subdomain %D", d);
373 #define __FUNCT__ "DMCreateDomainDecomposition_libMesh" 383 if (namelist) {
ierr = PetscMalloc(*len*
sizeof(
char *), namelist);
CHKERRQ(
ierr);}
384 if (innerislist) {
ierr = PetscMalloc(*len*
sizeof(IS), innerislist);
CHKERRQ(
ierr);}
385 if (outerislist) *outerislist = PETSC_NULL;
386 if (dmlist) {
ierr = PetscMalloc(*len*
sizeof(DM), dmlist);
CHKERRQ(
ierr);}
388 std::set<numeric_index_type> dindices;
390 std::map<std::string, unsigned int> dblockids;
391 std::map<unsigned int,std::string> dblocknames;
392 unsigned int dbcount = 0;
395 dblockids.insert(std::pair<std::string, unsigned int>(bname,b));
396 dblocknames.insert(std::pair<unsigned int,std::string>(b,bname));
397 if (!dbcount) dname = bname;
398 else dname +=
"_" + bname;
400 if (!innerislist)
continue;
404 for ( ; el != end_el; ++el) {
405 const Elem * elem = *el;
406 std::vector<numeric_index_type> evindices;
411 for (
const auto & dof : evindices) {
413 dindices.insert(dof);
424 ierr = PetscMalloc(
sizeof(PetscInt)*dindices.size(), &darray);
CHKERRQ(
ierr);
426 for (
const auto &
id : dindices) {
430 ierr = ISCreateGeneral(((PetscObject)dm)->comm,
431 cast_int<PetscInt>(dindices.size()),
436 #if PETSC_RELEASE_LESS_THAN(3,3,1) 444 if (elen != dlen) SETERRQ1(((PetscObject)dm)->comm, PETSC_ERR_PLIB,
"Failed to embed field %D", d);
453 (*innerislist)[d] = dis;
483 #define __FUNCT__ "DMlibMeshCreateFieldDecompositionDM" 489 PetscValidHeaderSpecific(dm,DM_CLASSID,1);
490 ierr = PetscObjectTypeCompare((PetscObject)dm, DMLIBMESH,&islibmesh);
491 if (!islibmesh) SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Got DM of type %s, not of type %s", ((PetscObject)dm)->type_name, DMLIBMESH);
492 if (dnumber < 0) SETERRQ1(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Negative number %D of decomposition parts", dnumber);
493 PetscValidPointer(ddm,5);
503 ddlm->
decomposition =
new(std::vector<std::set<unsigned int>>);
506 for (PetscInt d = 0; d < dnumber; ++d) {
507 if (dsizes[d] < 0) SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Negative size %D of decomposition part %D", dsizes[d],d);
509 for (PetscInt v = 0; v < dsizes[d]; ++v) {
510 std::string vname(dvarlists[d][v]);
511 std::map<std::string, unsigned int>::const_iterator vit =
dlm->
varids->find(vname);
513 SETERRQ3(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Variable %D on the %D-th list with name %s is not owned by this DM", v, d, dvarlists[d][v]);
514 unsigned int vid = vit->second;
521 for (
const auto & pr : (*ddlm->
varids)) {
523 unsigned int vid = pr.second;
535 #define __FUNCT__ "DMlibMeshCreateDomainDecompositionDM" 541 PetscValidHeaderSpecific(dm,DM_CLASSID,1);
542 ierr = PetscObjectTypeCompare((PetscObject)dm, DMLIBMESH,&islibmesh);
543 if (!islibmesh) SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Got DM of type %s, not of type %s", ((PetscObject)dm)->type_name, DMLIBMESH);
544 if (dnumber < 0) SETERRQ1(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Negative number %D of decomposition parts", dnumber);
545 PetscValidPointer(ddm,5);
555 ddlm->
decomposition =
new(std::vector<std::set<unsigned int>>);
558 for (PetscInt d = 0; d < dnumber; ++d) {
559 if (dsizes[d] < 0) SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Negative size %D of decomposition part %D", dsizes[d],d);
561 for (PetscInt b = 0; b < dsizes[d]; ++b) {
562 std::string bname(dblocklists[d][b]);
563 std::map<std::string, unsigned int>::const_iterator bit =
dlm->
blockids->find(bname);
565 SETERRQ3(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Block %D on the %D-th list with name %s is not owned by this DM", b, d, dblocklists[d][b]);
566 unsigned int bid = bit->second;
573 for (
const auto & pr : (*ddlm->
blockids)) {
575 unsigned int bid = pr.second;
593 #if PETSC_RELEASE_LESS_THAN(3,3,1) 596 #define __FUNCT__ "DMlibMeshParseDecompositionDescriptor_Private" 605 struct token * llfirst = PETSC_NULL;
606 struct token * lllast = PETSC_NULL;
608 PetscInt stcount = 0, brcount = 0, d, i;
632 *dtype=DMLIBMESH_FIELD_DECOMPOSITION;
637 SETERRQ1(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"Could not determine decomposition type from descriptor: %s\n", ddesc);
CHKERRQ(
ierr);
638 *dtype=DMLIBMESH_DOMAIN_DECOMPOSITION;
641 while (count < len0) {
646 while (*ss && *ss !=
',' && *ss !=
';') {
649 st = PETSC_NULL; br = PETSC_NULL;
658 #if PETSC_RELEASE_LESS_THAN(3,5,0) 667 #if PETSC_RELEASE_LESS_THAN(3,5,0) 677 llfirst = lllast = st;
680 lllast->
next = st; lllast = st;
685 llfirst = lllast = br;
688 lllast->
next = br; lllast = br;
707 for (d = 0; d < *dcount; ++d) (*dsizes)[d] = 0;
708 tok = llfirst; d = 0;
716 for (d = 0; d < *dcount; ++d) {
717 ierr = PetscMalloc(
sizeof(
char **)*(*dsizes)[d], (* dlists)+d);
CHKERRQ(
ierr);
720 tok = llfirst; d = 0; i = 0;
740 #define __FUNCT__ "DMCreateFieldDecompositionDM_libMesh" 745 PetscInt dtype, dcount;
751 if (dtype == DMLIBMESH_FIELD_DECOMPOSITION){
754 else SETERRQ1(((PetscObject)dm)->comm, PETSC_ERR_PLIB,
"Unexpected unknown decomposition type for field decomposition descriptor %s", ddesc);
759 #define __FUNCT__ "DMCreateDomainDecompositionDM_libMesh" 764 PetscInt dtype, dcount;
770 if (dtype == DMLIBMESH_DOMAIN_DECOMPOSITION) {
773 else SETERRQ1(((PetscObject)dm)->comm, PETSC_ERR_PLIB,
"Unexpected unknown decomposition type for domain decomposition descriptor %s", ddesc);
781 #define __FUNCT__ "DMlibMeshFunction" 797 X_global.
swap(X_sys);
804 X_global.swap(X_sys);
811 libmesh_error_msg(
"ERROR: cannot specify both a function and object to compute the Residual!");
814 libmesh_error_msg(
"ERROR: cannot specify both a function and object to compute the combined Residual & Jacobian!");
829 libmesh_error_msg(
"Error! Unable to compute residual and/or Jacobian!");
836 #if !PETSC_RELEASE_LESS_THAN(3,3,1) 838 #define __FUNCT__ "SNESFunction_DMlibMesh" 851 #define __FUNCT__ "DMlibMeshJacobian" 853 #
if PETSC_RELEASE_LESS_THAN(3,5,0)
854 DM dm, Vec x, Mat jac, Mat pc, MatStructure * msflag
856 DM dm, Vec x, Mat jac, Mat pc
877 X_global.
swap(X_sys);
883 X_global.swap(X_sys);
891 libmesh_error_msg(
"ERROR: cannot specify both a function and object to compute the Jacobian!");
894 libmesh_error_msg(
"ERROR: cannot specify both a function and object to compute the combined Residual & Jacobian!");
909 libmesh_error_msg(
"Error! Unable to compute residual and/or Jacobian!");
914 #if PETSC_RELEASE_LESS_THAN(3,5,0) 915 *msflag = SAME_NONZERO_PATTERN;
920 #if !PETSC_RELEASE_LESS_THAN(3,3,1) 922 #define __FUNCT__ "SNESJacobian_DMlibMesh" 924 #
if PETSC_RELEASE_LESS_THAN(3,5,0)
925 SNES, Vec x, Mat * jac, Mat * pc, MatStructure * flag,
void * ctx
927 SNES, Vec x, Mat jac, Mat pc,
void * ctx
934 #if PETSC_RELEASE_LESS_THAN(3,5,0) 944 #define __FUNCT__ "DMVariableBounds_libMesh" 954 #if PETSC_VERSION_LESS_THAN(3,5,0) && PETSC_VERSION_RELEASE 966 SETERRQ(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"No bounds calculation in this libMesh object");
973 #define __FUNCT__ "DMCreateGlobalVector_libMesh" 984 SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"DM of type %s, not of type %s", ((PetscObject)dm)->type, DMLIBMESH);
1006 ierr = PetscObjectCompose((PetscObject)*x,
"DM",(PetscObject)dm);
CHKERRQ(
ierr);
1014 #define __FUNCT__ "DMCreateMatrix_libMesh" 1015 #if PETSC_VERSION_LT(3,5,0) 1029 SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"DM of type %s, not of type %s", ((PetscObject)dm)->type, DMLIBMESH);
1041 #define __FUNCT__ "DMView_libMesh" 1044 PetscErrorCode
ierr;
1046 const char *
name, * prefix;
1049 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&isascii);
CHKERRQ(
ierr);
1052 ierr = PetscObjectGetOptionsPrefix((PetscObject)dm, &prefix);
CHKERRQ(
ierr);
1053 ierr = PetscViewerASCIIPrintf(viewer,
"DM libMesh with name %s and prefix %s\n",
name, prefix);
CHKERRQ(
ierr);
1055 std::map<std::string,unsigned int>::iterator bit =
dlm->
blockids->begin();
1056 std::map<std::string,unsigned int>::const_iterator bend =
dlm->
blockids->end();
1057 for (; bit != bend; ++bit) {
1058 ierr = PetscViewerASCIIPrintf(viewer,
"(%s,%D) ", bit->first.c_str(), bit->second);
CHKERRQ(
ierr);
1062 std::map<std::string,unsigned int>::iterator vit =
dlm->
varids->begin();
1063 std::map<std::string,unsigned int>::const_iterator vend =
dlm->
varids->end();
1064 for (; vit != vend; ++vit) {
1065 ierr = PetscViewerASCIIPrintf(viewer,
"(%s,%D) ", vit->first.c_str(), vit->second);
CHKERRQ(
ierr);
1069 ierr = PetscViewerASCIIPrintf(viewer,
"No decomposition\n");
CHKERRQ(
ierr);
1073 ierr = PetscViewerASCIIPrintf(viewer,
"Field decomposition by variable: ");
CHKERRQ(
ierr);
1076 ierr = PetscViewerASCIIPrintf(viewer,
"Domain decomposition by block: ");
CHKERRQ(
ierr);
1078 else SETERRQ1(((PetscObject)dm)->comm, PETSC_ERR_PLIB,
"Unexpected decomposition type: %D",
dlm->
decomposition_type);
1081 std::set<unsigned int>::iterator dbegin = (*
dlm->
decomposition)[d].begin();
1084 for (; dit != dend; ++dit) {
1085 if (dit != dbegin) {
1100 #define __FUNCT__ "DMSetUp_libMesh" 1104 PetscErrorCode
ierr;
1111 SETERRQ2(((PetscObject)dm)->comm, PETSC_ERR_ARG_WRONG,
"DM of type %s, not of type %s", ((PetscObject)dm)->type, DMLIBMESH);
1119 #if PETSC_RELEASE_LESS_THAN(3,3,1) 1134 dm->ops->createglobalvector = 0;
1135 dm->ops->creatematrix = 0;
1144 #define __FUNCT__ "DMDestroy_libMesh" 1148 PetscErrorCode
ierr;
1163 #define __FUNCT__ "DMCreate_libMesh" 1166 PetscErrorCode
ierr;
1170 PetscValidHeaderSpecific(dm,DM_CLASSID,1);
1171 #if PETSC_RELEASE_LESS_THAN(3,5,0) 1179 dlm->
varids =
new(std::map<std::string, unsigned int>);
1180 dlm->
blockids =
new(std::map<std::string, unsigned int>);
1181 dlm->
varnames =
new(std::map<unsigned int, std::string>);
1188 dm->ops->createlocalvector = 0;
1189 dm->ops->getcoloring = 0;
1191 dm->ops->createinterpolation= 0;
1193 dm->ops->refine = 0;
1194 dm->ops->coarsen = 0;
1195 dm->ops->getinjection = 0;
1196 dm->ops->getaggregates = 0;
1198 #if PETSC_RELEASE_LESS_THAN(3,3,1) 1207 dm->ops->setfromoptions = 0;
1211 #if PETSC_RELEASE_LESS_THAN(3,4,0) 1224 #endif // #if !PETSC_VERSION_LESS_THAN(3,3,0) static PetscErrorCode SNESFunction_DMlibMesh(SNES, Vec x, Vec r, void *ctx)
std::string name(const ElemQuality q)
void set_union(T &data, const unsigned int root_id) const
static PetscErrorCode DMVariableBounds_libMesh(DM dm, Vec xl, Vec xu)
static PetscErrorCode DMCreateDomainDecomposition_libMesh(DM dm, PetscInt *len, char ***namelist, IS **innerislist, IS **outerislist, DM **dmlist)
NonlinearImplicitSystem * sys
NumericVector interface to PETSc Vec.
static PetscErrorCode DMCreateGlobalVector_libMesh(DM dm, Vec *x)
static PetscErrorCode DMCreateDomainDecompositionDM_libMesh(DM dm, const char *ddesc, DM *ddm)
std::unique_ptr< NonlinearSolver< Number > > nonlinear_solver
PetscErrorCode DMlibMeshSetUpName_Private(DM dm)
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
unsigned int embedding_type
std::map< std::string, unsigned int > * blockids
PetscErrorCode DMlibMeshSetSystem_libMesh(DM dm, NonlinearImplicitSystem &sys)
std::map< std::string, unsigned int > * varids
The base class for all geometric element types.
unsigned int n_variables() const
static PetscErrorCode DMCreateFieldDecomposition_libMesh(DM dm, PetscInt *len, char ***namelist, IS **islist, DM **dmlist)
NumericVector< Number > * rhs
const Parallel::Communicator & comm() const
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
static PetscErrorCode SNESJacobian_DMlibMesh(#if PETSC_RELEASE_LESS_THAN(3, 5, 0) SNES, Vec x, Mat *jac, Mat *pc, MatStructure *flag, void *ctx #else SNES, Vec x, Mat jac, Mat pc, void *ctx #endif)
static PetscErrorCode DMlibMeshJacobian(#if PETSC_RELEASE_LESS_THAN(3, 5, 0) DM dm, Vec x, Mat jac, Mat pc, MatStructure *msflag #else DM dm, Vec x, Mat jac, Mat pc #endif)
PetscErrorCode DMlibMeshGetBlocks(DM dm, PetscInt *n, char ***blocknames)
virtual element_iterator active_local_subdomain_elements_end(subdomain_id_type subdomain_id)=0
const MeshBase & get_mesh() const
virtual void swap(NumericVector< T > &v) override
Manages the degrees of freedom (DOFs) in a simulation.
std::vector< std::set< unsigned int > > * decomposition
PetscErrorCode DMCreate_libMesh(DM dm)
virtual element_iterator active_local_subdomain_elements_begin(subdomain_id_type subdomain_id)=0
static PetscErrorCode DMSetUp_libMesh(DM dm)
const Variable & variable(const unsigned int c) const
PetscErrorCode DMlibMeshCreateFieldDecompositionDM(DM dm, PetscInt dnumber, PetscInt *dsizes, char ***dvarlists, DM *ddm)
dof_id_type numeric_index_type
static PetscErrorCode DMCreateMatrix_libMesh(DM dm, const MatType, Mat *A) static PetscErrorCode DMCreateMatrix_libMesh(DM dm
static PetscErrorCode DMlibMeshFunction(DM dm, Vec x, Vec r)
PetscErrorCode DMlibMeshGetSystem_libMesh(DM dm, NonlinearImplicitSystem *&sys)
std::unique_ptr< NumericVector< Number > > solution
std::map< unsigned int, std::string > * varnames
SimpleRange< I > as_range(const std::pair< I, I > &p)
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and non-linear solv...
std::map< unsigned int, std::string > * blocknames
std::string & subdomain_name(subdomain_id_type id)
PetscErrorCode DMlibMeshGetVec_Private(DM, const char *, Vec *)
static PetscErrorCode DMCreateFieldDecompositionDM_libMesh(DM dm, const char *ddesc, DM *ddm)
static PetscErrorCode DMlibMeshParseDecompositionDescriptor_Private(DM dm, const char *ddesc, PetscInt *dtype, PetscInt *dcount, PetscInt **dsizes, char ****dlists)
static PetscErrorCode Mat * A
SparseMatrix< Number > * matrix
PetscErrorCode DMlibMeshGetVariables(DM dm, PetscInt *n, char ***varnames)
SparseMatrix interface to PETSc Mat.
std::unique_ptr< NumericVector< Number > > current_local_solution
PetscErrorCode DMlibMeshCreateDomainDecompositionDM(DM dm, PetscInt dnumber, PetscInt *dsizes, char ***dblocklists, DM *ddm)
PetscErrorCode DMlibMeshGetSystem(DM dm, libMesh::NonlinearImplicitSystem *&sys)
const std::string & name() const
const std::string & name() const
dof_id_type first_dof(const processor_id_type proc) const
dof_id_type end_dof(const processor_id_type proc) const
const DofMap & get_dof_map() const
static PetscErrorCode DMView_libMesh(DM dm, PetscViewer viewer)
unsigned int decomposition_type
static PetscErrorCode DMDestroy_libMesh(DM dm)
void enforce_constraints_exactly(const System &system, NumericVector< Number > *v=nullptr, bool homogeneous=false) const