6 #if PETSC_VERSION_GE(3, 6, 0)
7 #include <petsc/private/dmimpl.h>
10 #include <petsc-private/dmimpl.h>
11 #include <petsc-private/vecimpl.h>
21 *iface =
const_cast<DMCtx *
>(
this);
27 auto core_log = logging::core::get();
50 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
66 CHKERR DMSetMatType(dm, MATMPIAIJ);
72 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
80 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
85 CHKERR PetscObjectGetComm((PetscObject)dm, &comm);
88 MPI_Comm_compare(comm, PETSC_COMM_SELF, &result);
89 if (result == MPI_IDENT)
91 <<
"MoFEM DM destroy for problem " << dm_field->
problemName
95 <<
"MoFEM DM destroy for problem " << dm_field->
problemName
106 delete static_cast<DMCtxImpl *
>(dm->data);
115 const char problem_name[],
123 "data structure for MoFEM not yet created");
127 "DM function not implemented into MoFEM");
145 boost::shared_ptr<KspCtx>(
new KspCtx(*m_field_ptr, problem_name));
147 boost::shared_ptr<SnesCtx>(
new SnesCtx(*m_field_ptr, problem_name));
149 boost::shared_ptr<TsCtx>(
new TsCtx(*m_field_ptr, problem_name));
152 CHKERR PetscObjectGetComm((PetscObject)dm, &comm);
154 MPI_Comm_compare(comm, m_field_ptr->
get_comm(), &result);
155 if (result > MPI_CONGRUENT) {
157 "MoFEM and DM using different communicators");
159 MPI_Comm_size(comm, &dm_field->
sIze);
160 MPI_Comm_rank(comm, &dm_field->
rAnk);
166 MPI_Comm_compare(comm, PETSC_COMM_SELF, &result);
167 if (result == MPI_IDENT) {
169 <<
"MoFEM DM created for problem " << dm_field->
problemName;
173 <<
"MoFEM DM created for problem " << dm_field->
problemName;
185 "data structure for MoFEM not yet created");
188 delete static_cast<DMCtxImpl *
>(dm_duplicate->data);
190 dm_duplicate->data = dm->data;
191 ++(
static_cast<DMCtxImpl *
>(dm_duplicate->data)->referenceNumber);
200 "data structure for MoFEM not yet created on dm");
203 "data structure for MoFEM not yet created on swap dm");
205 auto *dm_field =
static_cast<DMCtxImpl *
>(dm->data);
206 auto *dm_field_swap =
static_cast<DMCtxImpl *
>(dm_swap->data);
208 auto tmp_field = dm_field;
209 dm_field = dm_field_swap;
210 dm_field_swap = tmp_field;
220 "data structure for MoFEM not yet created");
229 subdm_field->
isSubDM = PETSC_TRUE;
239 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
244 "data structure for MoFEM not yet created");
259 boost::shared_ptr<Range> r_ptr) {
260 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
265 "data structure for MoFEM not yet created");
276 boost::shared_ptr<Range> r_ptr) {
281 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
286 "data structure for MoFEM not yet created");
301 boost::shared_ptr<Range> r_ptr) {
302 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
307 "data structure for MoFEM not yet created");
318 boost::shared_ptr<Range> r_ptr) {
324 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
327 *is_sub_dm = dm_field->
isSubDM;
333 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
336 if (dm_field->
isSubDM != PETSC_TRUE) {
338 "This DM is not created as a SubDM");
343 boost::shared_ptr<Problem::SubProblemData> sub_data =
345 CHKERR sub_data->getRowIs(is);
351 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
354 if (dm_field->
isSubDM != PETSC_TRUE) {
356 "This DM is not created as a SubDM");
361 boost::shared_ptr<Problem::SubProblemData> sub_data =
363 CHKERR sub_data->getColIs(is);
368 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
373 "data structure for MoFEM not yet created");
386 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
391 "data structure for MoFEM not yet created");
398 "No need to add problem on column when problem block structurally "
407 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
415 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
420 "data structure for MoFEM not yet created");
427 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
432 "data structure for MoFEM not yet created");
440 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
449 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
457 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
465 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
469 ->resolveSharedFiniteElements(dm_field->
problemPtr, fe_name);
474 PetscLayout *layout) {
476 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
481 CHKERR PetscObjectGetComm((PetscObject)dm, &comm);
490 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
498 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
508 for (
auto fe : fe_name) {
515 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
524 ScatterMode scatter_mode) {
526 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
536 ScatterMode scatter_mode) {
537 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
547 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
557 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
573 dm_field->
problemPtr, fe_name, *method, low_rank, up_rank,
nullptr,
580 DM dm,
const std::string fe_name, boost::shared_ptr<MoFEM::FEMethod> method,
583 low_rank, up_rank, cache_ptr);
589 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
593 dm, fe_name, method, dm_field->
rAnk, dm_field->
rAnk, cache_ptr);
600 boost::shared_ptr<MoFEM::FEMethod> method,
607 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
612 *method, dm_field->
rAnk, dm_field->
rAnk);
617 template <
class S,
class T0,
class T1,
class T2>
619 T1 pre_only, T2 post_only) {
620 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
624 dm_field->
kspCtx->getPreProcComputeRhs().push_back(pre_only);
627 dm_field->
kspCtx->getComputeRhs().push_back(
631 dm_field->
kspCtx->getPostProcComputeRhs().push_back(post_only);
643 dm, fe_name, method, pre_only, post_only);
648 boost::shared_ptr<MoFEM::FEMethod> method,
649 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
650 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
652 boost::shared_ptr<MoFEM::FEMethod>,
653 boost::shared_ptr<MoFEM::BasicMethod>,
654 boost::shared_ptr<MoFEM::BasicMethod>>(
655 dm, fe_name, method, pre_only, post_only);
658 template <
class S,
class T0,
class T1,
class T2>
660 T1 pre_only, T2 post_only) {
661 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
665 dm_field->
kspCtx->getPreProcSetOperators().push_back(pre_only);
668 dm_field->
kspCtx->getSetOperators().push_back(
672 dm_field->
kspCtx->getPostProcSetOperators().push_back(post_only);
685 dm, fe_name, method, pre_only, post_only);
690 boost::shared_ptr<MoFEM::FEMethod> method,
691 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
692 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
694 boost::shared_ptr<MoFEM::FEMethod>>(
695 dm, fe_name, method, pre_only, post_only);
698 template <
class S,
class T0,
class T1,
class T2>
700 T1 pre_only, T2 post_only) {
701 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
705 dm_field->
snesCtx->getPreProcComputeRhs().push_back(pre_only);
708 dm_field->
snesCtx->getComputeRhs().push_back(
712 dm_field->
snesCtx->getPostProcComputeRhs().push_back(post_only);
724 dm, fe_name, method, pre_only, post_only);
729 boost::shared_ptr<MoFEM::FEMethod> method,
730 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
731 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
733 boost::shared_ptr<MoFEM::FEMethod>,
734 boost::shared_ptr<MoFEM::BasicMethod>,
735 boost::shared_ptr<MoFEM::BasicMethod>>(
736 dm, fe_name, method, pre_only, post_only);
739 template <
class S,
class T0,
class T1,
class T2>
741 T1 pre_only, T2 post_only) {
742 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
746 dm_field->
snesCtx->getPreProcSetOperators().push_back(pre_only);
749 dm_field->
snesCtx->getSetOperators().push_back(
753 dm_field->
snesCtx->getPostProcSetOperators().push_back(post_only);
765 dm, fe_name, method, pre_only, post_only);
770 boost::shared_ptr<MoFEM::FEMethod> method,
771 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
772 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
774 boost::shared_ptr<MoFEM::FEMethod>,
775 boost::shared_ptr<MoFEM::BasicMethod>,
776 boost::shared_ptr<MoFEM::BasicMethod>>(
777 dm, fe_name, method, pre_only, post_only);
780 template <
class S,
class T0,
class T1,
class T2>
782 T1 pre_only, T2 post_only) {
783 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
787 dm_field->
tsCtx->getPreProcessIFunction().push_back(pre_only);
790 dm_field->
tsCtx->getLoopsIFunction().push_back(
794 dm_field->
tsCtx->getPostProcessIFunction().push_back(post_only);
806 dm, fe_name, method, pre_only, post_only);
812 boost::shared_ptr<MoFEM::FEMethod> method,
813 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
814 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
816 boost::shared_ptr<MoFEM::FEMethod>,
817 boost::shared_ptr<MoFEM::BasicMethod>,
818 boost::shared_ptr<MoFEM::BasicMethod>>(
819 dm, fe_name, method, pre_only, post_only);
823 template <
class S,
class T0,
class T1,
class T2>
825 T1 pre_only, T2 post_only) {
826 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
830 dm_field->
tsCtx->getPreProcessIJacobian().push_back(pre_only);
833 dm_field->
tsCtx->getLoopsIJacobian().push_back(
837 dm_field->
tsCtx->getPostProcessIJacobian().push_back(post_only);
849 pre_only, post_only);
854 boost::shared_ptr<MoFEM::FEMethod> method,
855 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
856 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
858 boost::shared_ptr<MoFEM::FEMethod>,
859 boost::shared_ptr<MoFEM::BasicMethod>,
860 boost::shared_ptr<MoFEM::BasicMethod>>(
861 dm, fe_name, method, pre_only, post_only);
864 template <
class S,
class T0,
class T1,
class T2>
866 T1 pre_only, T2 post_only) {
867 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
871 dm_field->
tsCtx->getPreProcessRHSFunction().push_back(pre_only);
873 dm_field->
tsCtx->getLoopsRHSFunction().push_back(
876 dm_field->
tsCtx->getPostProcessRHSFunction().push_back(post_only);
883 boost::shared_ptr<MoFEM::FEMethod> method,
884 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
885 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
887 boost::shared_ptr<MoFEM::FEMethod>,
888 boost::shared_ptr<MoFEM::BasicMethod>,
889 boost::shared_ptr<MoFEM::BasicMethod>>(
890 dm, fe_name, method, pre_only, post_only);
900 dm, fe_name, method, pre_only, post_only);
904 template <
class S,
class T0,
class T1,
class T2>
906 T1 pre_only, T2 post_only) {
907 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
911 dm_field->
tsCtx->getPreProcessRHSFunction().push_back(pre_only);
913 dm_field->
tsCtx->getLoopsRHSFunction().push_back(
916 dm_field->
tsCtx->getPostProcessRHSFunction().push_back(post_only);
923 boost::shared_ptr<MoFEM::FEMethod> method,
924 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
925 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
927 boost::shared_ptr<MoFEM::FEMethod>,
928 boost::shared_ptr<MoFEM::BasicMethod>,
929 boost::shared_ptr<MoFEM::BasicMethod>>(
930 dm, fe_name, method, pre_only, post_only);
940 dm, fe_name, method, pre_only, post_only);
944 template <
class S,
class T0,
class T1,
class T2>
946 T1 pre_only, T2 post_only) {
947 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
951 dm_field->
tsCtx->getPreProcessIFunction().push_back(pre_only);
954 dm_field->
tsCtx->getLoopsIFunction().push_back(
958 dm_field->
tsCtx->getPostProcessIFunction().push_back(post_only);
970 dm, fe_name, method, pre_only, post_only);
976 boost::shared_ptr<MoFEM::FEMethod> method,
977 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
978 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
980 boost::shared_ptr<MoFEM::FEMethod>,
981 boost::shared_ptr<MoFEM::BasicMethod>,
982 boost::shared_ptr<MoFEM::BasicMethod>>(
983 dm, fe_name, method, pre_only, post_only);
987 template <
class S,
class T0,
class T1,
class T2>
989 T1 pre_only, T2 post_only) {
990 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
994 dm_field->
tsCtx->getPreProcessIJacobian().push_back(pre_only);
997 dm_field->
tsCtx->getLoopsIJacobian().push_back(
1001 dm_field->
tsCtx->getPostProcessIJacobian().push_back(post_only);
1013 pre_only, post_only);
1018 boost::shared_ptr<MoFEM::FEMethod> method,
1019 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
1020 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
1022 boost::shared_ptr<MoFEM::FEMethod>,
1023 boost::shared_ptr<MoFEM::BasicMethod>,
1024 boost::shared_ptr<MoFEM::BasicMethod>>(
1025 dm, fe_name, method, pre_only, post_only);
1028 template <
class S,
class T0,
class T1,
class T2>
1030 T1 pre_only, T2 post_only) {
1031 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1035 dm_field->
tsCtx->getPreProcessMonitor().push_back(pre_only);
1037 dm_field->
tsCtx->getLoopsMonitor().push_back(
1040 dm_field->
tsCtx->getPostProcessMonitor().push_back(post_only);
1051 dm, ts, fe_name, method, pre_only, post_only);
1057 boost::shared_ptr<MoFEM::FEMethod> method,
1058 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
1059 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
1061 boost::shared_ptr<MoFEM::FEMethod>,
1062 boost::shared_ptr<MoFEM::BasicMethod>,
1063 boost::shared_ptr<MoFEM::BasicMethod>>(
1064 dm, ts, fe_name, method, pre_only, post_only);
1069 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1072 *ksp_ctx = dm_field->
kspCtx.get();
1078 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1081 const_cast<boost::shared_ptr<MoFEM::KspCtx> &
>(ksp_ctx) = dm_field->
kspCtx;
1086 boost::shared_ptr<MoFEM::KspCtx> ksp_ctx) {
1087 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1090 dm_field->
kspCtx = ksp_ctx;
1095 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1098 *snes_ctx = dm_field->
snesCtx.get();
1104 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1107 const_cast<boost::shared_ptr<MoFEM::SnesCtx> &
>(snes_ctx) = dm_field->
snesCtx;
1112 boost::shared_ptr<MoFEM::SnesCtx> snes_ctx) {
1113 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1124 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1135 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1143 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1151 const boost::shared_ptr<MoFEM::TsCtx> &
ts_ctx) {
1152 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1155 const_cast<boost::shared_ptr<MoFEM::TsCtx> &
>(
ts_ctx) = dm_field->
tsCtx;
1160 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1168 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1178 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1183 CHKERR VecSetDM(g_ptr, dm);
1188 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1198 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1202 if (strcmp(dm->mattype, MATSHELL) == 0) {
1209 "Matrix shell data not set, or matrix type not implemented");
1212 }
else if (strcmp(dm->mattype, MATMPIAIJ) == 0) {
1214 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(dm_field->
problemName,
1216 }
else if (strcmp(dm->mattype, MATAIJ) == 0) {
1218 ->createSeqAIJWithArrays<PetscLocalIdx_mi_tag>(dm_field->
problemName,
1220 }
else if (strcmp(dm->mattype, MATAIJCUSPARSE) == 0) {
1222 ->createMPIAIJCUSPARSEWithArrays<PetscGlobalIdx_mi_tag>(
1224 }
else if (strcmp(dm->mattype, MATSEQAIJCUSPARSE) == 0) {
1226 ->createSeqAIJCUSPARSEWithArrays<PetscLocalIdx_mi_tag>(
1230 "Matrix type not implemented");
1237 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1241 if (strcmp(dm->mattype, MATSHELL) == 0) {
1249 "Matrix shell data not set, or matrix type not implemented");
1251 }
else if (strcmp(dm->mattype, MATMPIAIJ) == 0) {
1253 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(dm_field->
problemName,
1255 }
else if (strcmp(dm->mattype, MATAIJ) == 0) {
1257 ->createSeqAIJWithArrays<PetscLocalIdx_mi_tag>(dm_field->
problemName,
1259 }
else if (strcmp(dm->mattype, MATAIJCUSPARSE) == 0) {
1261 ->createMPIAIJCUSPARSEWithArrays<PetscGlobalIdx_mi_tag>(
1263 }
else if (strcmp(dm->mattype, MATSEQAIJCUSPARSE) == 0) {
1265 ->createSeqAIJCUSPARSEWithArrays<PetscLocalIdx_mi_tag>(
1269 "Matrix type not implemented");
1275 #if PETSC_VERSION_GE(3, 7, 0)
1278 #elif PETSC_VERSION_GE(3, 5, 3)
1284 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1287 #if PETSC_VERSION_GE(3, 5, 3)
1288 ierr = PetscOptionsHead(PetscOptionsObject,
"DMMoFEM Options");
1291 ierr = PetscOptionsHead(
"DMMoFEM Options");
1294 ierr = PetscOptionsBool(
"-dm_is_partitioned",
1295 "set if mesh is partitioned (works which native MOAB "
1296 "file format, i.e. h5m",
1304 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1351 PetscValidHeaderSpecific(subdm, DM_CLASSID, 1);
1360 map<std::string, boost::shared_ptr<Range>> *entity_map_row =
nullptr;
1361 map<std::string, boost::shared_ptr<Range>> *entity_map_col =
nullptr;
1371 subdm_field->
isSquareMatrix == PETSC_TRUE, entity_map_row, entity_map_col,
1378 0, subdm_field->
sIze,
1399 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1401 CHKERR VecGhostUpdateBegin(
g, INSERT_VALUES, SCATTER_FORWARD);
1407 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1410 CHKERR VecGhostUpdateEnd(
g, INSERT_VALUES, SCATTER_FORWARD);
1416 double *array_loc, *array_glob;
1417 CHKERR VecGetArray(
l, &array_loc);
1418 CHKERR VecGetArray(
g, &array_glob);
1421 cblas_dcopy(nb_dofs + nb_ghost, array_glob, 1, array_loc, 1);
1424 cblas_daxpy(nb_dofs + nb_ghost, 1, array_glob, 1, array_loc, 1);
1429 CHKERR VecRestoreArray(
l, &array_loc);
1430 CHKERR VecRestoreArray(
g, &array_glob);
1437 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1444 double *array_loc, *array_glob;
1445 CHKERR VecGetArray(
l, &array_loc);
1446 CHKERR VecGetArray(
g, &array_glob);
1449 cblas_dcopy(nb_dofs + nb_ghost, array_loc, 1, array_glob, 1);
1452 cblas_daxpy(nb_dofs + nb_ghost, 1, array_loc, 1, array_glob, 1);
1457 CHKERR VecRestoreArray(
l, &array_loc);
1458 CHKERR VecRestoreArray(
g, &array_glob);
1470 char ***fieldNames, IS **fields) {
1471 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1486 Field_multiIndex::iterator fit, hi_fit;
1487 fit = fields_ptr->begin();
1488 hi_fit = fields_ptr->end();
1489 *numFields = std::distance(fit, hi_fit);
1492 CHKERR PetscMalloc1(*numFields, fieldNames);
1495 CHKERR PetscMalloc1(*numFields, fields);
1498 for (
int f = 0; fit != hi_fit; fit++,
f++) {
1500 CHKERR PetscStrallocpy(fit->get()->getName().c_str(),
1501 (
char **)&(*fieldNames)[
f]);
1505 ->isCreateProblemFieldAndRank(
1507 fit->get()->getNbOfCoeffs(), &(*fields)[
f]);
1516 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1526 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1534 boost::shared_ptr<BlockStructure> data) {
1535 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1543 boost::shared_ptr<BlockStructure> &data) {
1544 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1552 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1556 *mat = mat_data.first;
1557 CHKERR PetscObjectReference((PetscObject)(*mat));
1563 boost::shared_ptr<NestSchurData> data) {
1564 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1573 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1577 *mat = mat_data.first;
1578 CHKERR PetscObjectReference((PetscObject)(*mat));
1583 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);