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);
83 auto *dm_field =
static_cast<DMCtxImpl *
>(dm->data);
90 CHKERR dm_field->tsCtx->clearLoops();
91 if (dm_field->snesCtx)
92 CHKERR dm_field->snesCtx->clearLoops();
94 CHKERR dm_field->kspCtx->clearLoops();
96 dm_field->nestedSchurDataPtr.reset();
97 dm_field->blocMatDataPtr.reset();
98 dm_field->tsCtx.reset();
99 dm_field->snesCtx.reset();
100 dm_field->kspCtx.reset();
106 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
111 CHKERR PetscObjectGetComm((PetscObject)dm, &
comm);
114 MPI_Comm_compare(
comm, PETSC_COMM_SELF, &
result);
117 <<
"MoFEM DM destroy for problem " << dm_field->
problemName
121 <<
"MoFEM DM destroy for problem " << dm_field->
problemName
134 delete static_cast<DMCtxImpl *
>(dm->data);
144 const char problem_name[],
152 "data structure for MoFEM not yet created");
156 "DM function not implemented into MoFEM");
174 boost::shared_ptr<KspCtx>(
new KspCtx(*m_field_ptr, problem_name));
176 boost::shared_ptr<SnesCtx>(
new SnesCtx(*m_field_ptr, problem_name));
178 boost::shared_ptr<TsCtx>(
new TsCtx(*m_field_ptr, problem_name));
181 CHKERR PetscObjectGetComm((PetscObject)dm, &
comm);
184 if (
result > MPI_CONGRUENT) {
186 "MoFEM and DM using different communicators");
188 MPI_Comm_size(
comm, &dm_field->
sIze);
189 MPI_Comm_rank(
comm, &dm_field->
rAnk);
195 MPI_Comm_compare(
comm, PETSC_COMM_SELF, &
result);
196 if (
result == MPI_IDENT) {
198 <<
"MoFEM DM created for problem " << dm_field->
problemName;
202 <<
"MoFEM DM created for problem " << dm_field->
problemName;
214 "data structure for MoFEM not yet created");
217 delete static_cast<DMCtxImpl *
>(dm_duplicate->data);
219 dm_duplicate->data = dm->data;
220 ++(
static_cast<DMCtxImpl *
>(dm_duplicate->data)->referenceNumber);
229 "data structure for MoFEM not yet created on dm");
232 "data structure for MoFEM not yet created on swap dm");
234 auto *dm_field =
static_cast<DMCtxImpl *
>(dm->data);
235 auto *dm_field_swap =
static_cast<DMCtxImpl *
>(dm_swap->data);
237 auto tmp_field = dm_field;
238 dm_field = dm_field_swap;
239 dm_field_swap = tmp_field;
249 "data structure for MoFEM not yet created");
258 subdm_field->
isSubDM = PETSC_TRUE;
268 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
273 "data structure for MoFEM not yet created");
288 boost::shared_ptr<Range> r_ptr) {
289 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
294 "data structure for MoFEM not yet created");
305 boost::shared_ptr<Range> r_ptr) {
310 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
315 "data structure for MoFEM not yet created");
330 boost::shared_ptr<Range> r_ptr) {
331 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
336 "data structure for MoFEM not yet created");
347 boost::shared_ptr<Range> r_ptr) {
352 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
355 *is_sub_dm = dm_field->
isSubDM;
360 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
363 if (dm_field->
isSubDM != PETSC_TRUE) {
365 "This DM is not created as a SubDM");
370 boost::shared_ptr<Problem::SubProblemData> sub_data =
372 CHKERR sub_data->getRowIs(is);
377 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
380 if (dm_field->
isSubDM != PETSC_TRUE) {
382 "This DM is not created as a SubDM");
387 boost::shared_ptr<Problem::SubProblemData> sub_data =
389 CHKERR sub_data->getColIs(is);
394 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
399 "data structure for MoFEM not yet created");
412 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
417 "data structure for MoFEM not yet created");
424 "No need to add problem on column when problem block structurally "
432 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
440 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
445 "data structure for MoFEM not yet created");
452 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
457 "data structure for MoFEM not yet created");
464 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
472 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
483 IS *new_row_indices) {
484 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
490 "DM problem %s is not set up; call DMSetUp first",
494 "only a parent problem is rebuilt in place (%s)",
498 "rebuild in place needs the distributed builder: set "
499 "DMMoFEMSetIsPartitioned for %s",
507 old_row_indices ? &is_old :
nullptr, new_row_indices ? &is_new :
nullptr);
520 CHKERR DMClearGlobalVectors(dm);
521 CHKERR DMClearLocalVectors(dm);
522 CHKERR DMClearNamedGlobalVectors(dm);
523 CHKERR DMClearNamedLocalVectors(dm);
525 if (old_row_indices) {
526 *old_row_indices = is_old;
527 CHKERR PetscObjectReference((PetscObject)*old_row_indices);
529 if (new_row_indices) {
530 *new_row_indices = is_new;
531 CHKERR PetscObjectReference((PetscObject)*new_row_indices);
537 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
545 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
549 ->resolveSharedFiniteElements(dm_field->
problemPtr, fe_name);
554 PetscLayout *layout) {
555 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
560 CHKERR PetscObjectGetComm((PetscObject)dm, &
comm);
567 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
575 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
585 for (
auto fe : fe_name) {
592 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
601 ScatterMode scatter_mode,
603 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
612 ScatterMode scatter_mode,
614 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
623 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
633 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
649 dm_field->
problemPtr, fe_name, *method, low_rank, up_rank,
nullptr,
656 DM dm,
const std::string fe_name, boost::shared_ptr<MoFEM::FEMethod> method,
659 low_rank, up_rank, cache_ptr);
665 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
669 dm, fe_name, method, dm_field->
rAnk, dm_field->
rAnk, cache_ptr);
676 boost::shared_ptr<MoFEM::FEMethod> method,
683 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
688 *method, dm_field->
rAnk, dm_field->
rAnk);
693template <
class S,
class T0,
class T1,
class T2>
695 T1 pre_only, T2 post_only) {
696 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
700 dm_field->
kspCtx->getPreProcComputeRhs().push_back(pre_only);
703 dm_field->
kspCtx->getComputeRhs().push_back(
707 dm_field->
kspCtx->getPostProcComputeRhs().push_back(post_only);
719 dm, fe_name, method, pre_only, post_only);
724 boost::shared_ptr<MoFEM::FEMethod> method,
725 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
726 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
728 boost::shared_ptr<MoFEM::FEMethod>,
729 boost::shared_ptr<MoFEM::BasicMethod>,
730 boost::shared_ptr<MoFEM::BasicMethod>>(
731 dm, fe_name, method, pre_only, post_only);
734template <
class S,
class T0,
class T1,
class T2>
736 T1 pre_only, T2 post_only) {
737 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
741 dm_field->
kspCtx->getPreProcSetOperators().push_back(pre_only);
744 dm_field->
kspCtx->getSetOperators().push_back(
748 dm_field->
kspCtx->getPostProcSetOperators().push_back(post_only);
761 dm, fe_name, method, pre_only, post_only);
766 boost::shared_ptr<MoFEM::FEMethod> method,
767 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
768 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
770 boost::shared_ptr<MoFEM::FEMethod>>(
771 dm, fe_name, method, pre_only, post_only);
774template <
class S,
class T0,
class T1,
class T2>
776 T1 pre_only, T2 post_only) {
777 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
781 dm_field->
snesCtx->getPreProcComputeRhs().push_back(pre_only);
784 dm_field->
snesCtx->getComputeRhs().push_back(
788 dm_field->
snesCtx->getPostProcComputeRhs().push_back(post_only);
800 dm, fe_name, method, pre_only, post_only);
805 boost::shared_ptr<MoFEM::FEMethod> method,
806 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
807 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
809 boost::shared_ptr<MoFEM::FEMethod>,
810 boost::shared_ptr<MoFEM::BasicMethod>,
811 boost::shared_ptr<MoFEM::BasicMethod>>(
812 dm, fe_name, method, pre_only, post_only);
815template <
class S,
class T0,
class T1,
class T2>
817 T1 pre_only, T2 post_only) {
818 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
822 dm_field->
snesCtx->getPreProcSetOperators().push_back(pre_only);
825 dm_field->
snesCtx->getSetOperators().push_back(
829 dm_field->
snesCtx->getPostProcSetOperators().push_back(post_only);
841 dm, fe_name, method, pre_only, post_only);
846 boost::shared_ptr<MoFEM::FEMethod> method,
847 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
848 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
850 boost::shared_ptr<MoFEM::FEMethod>,
851 boost::shared_ptr<MoFEM::BasicMethod>,
852 boost::shared_ptr<MoFEM::BasicMethod>>(
853 dm, fe_name, method, pre_only, post_only);
856template <
class S,
class T0,
class T1,
class T2>
858 T1 pre_only, T2 post_only) {
859 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
863 dm_field->
tsCtx->getPreProcessIFunction().push_back(pre_only);
866 dm_field->
tsCtx->getLoopsIFunction().push_back(
870 dm_field->
tsCtx->getPostProcessIFunction().push_back(post_only);
882 dm, fe_name, method, pre_only, post_only);
888 boost::shared_ptr<MoFEM::FEMethod> method,
889 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
890 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
892 boost::shared_ptr<MoFEM::FEMethod>,
893 boost::shared_ptr<MoFEM::BasicMethod>,
894 boost::shared_ptr<MoFEM::BasicMethod>>(
895 dm, fe_name, method, pre_only, post_only);
899template <
class S,
class T0,
class T1,
class T2>
901 T1 pre_only, T2 post_only) {
902 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
906 dm_field->
tsCtx->getPreProcessIJacobian().push_back(pre_only);
909 dm_field->
tsCtx->getLoopsIJacobian().push_back(
913 dm_field->
tsCtx->getPostProcessIJacobian().push_back(post_only);
925 pre_only, post_only);
930 boost::shared_ptr<MoFEM::FEMethod> method,
931 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
932 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
934 boost::shared_ptr<MoFEM::FEMethod>,
935 boost::shared_ptr<MoFEM::BasicMethod>,
936 boost::shared_ptr<MoFEM::BasicMethod>>(
937 dm, fe_name, method, pre_only, post_only);
940template <
class S,
class T0,
class T1,
class T2>
942 T1 pre_only, T2 post_only) {
943 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
947 dm_field->
tsCtx->getPreProcessRHSFunction().push_back(pre_only);
949 dm_field->
tsCtx->getLoopsRHSFunction().push_back(
952 dm_field->
tsCtx->getPostProcessRHSFunction().push_back(post_only);
959 boost::shared_ptr<MoFEM::FEMethod> method,
960 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
961 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
963 boost::shared_ptr<MoFEM::FEMethod>,
964 boost::shared_ptr<MoFEM::BasicMethod>,
965 boost::shared_ptr<MoFEM::BasicMethod>>(
966 dm, fe_name, method, pre_only, post_only);
976 dm, fe_name, method, pre_only, post_only);
980template <
class S,
class T0,
class T1,
class T2>
982 T1 pre_only, T2 post_only) {
983 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
987 dm_field->
tsCtx->getPreProcessRHSFunction().push_back(pre_only);
989 dm_field->
tsCtx->getLoopsRHSFunction().push_back(
992 dm_field->
tsCtx->getPostProcessRHSFunction().push_back(post_only);
999 boost::shared_ptr<MoFEM::FEMethod> method,
1000 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
1001 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
1003 boost::shared_ptr<MoFEM::FEMethod>,
1004 boost::shared_ptr<MoFEM::BasicMethod>,
1005 boost::shared_ptr<MoFEM::BasicMethod>>(
1006 dm, fe_name, method, pre_only, post_only);
1016 dm, fe_name, method, pre_only, post_only);
1020template <
class S,
class T0,
class T1,
class T2>
1022 T1 pre_only, T2 post_only) {
1023 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1027 dm_field->
tsCtx->getPreProcessIFunction().push_back(pre_only);
1030 dm_field->
tsCtx->getLoopsIFunction().push_back(
1034 dm_field->
tsCtx->getPostProcessIFunction().push_back(post_only);
1046 dm, fe_name, method, pre_only, post_only);
1052 boost::shared_ptr<MoFEM::FEMethod> method,
1053 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
1054 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
1056 boost::shared_ptr<MoFEM::FEMethod>,
1057 boost::shared_ptr<MoFEM::BasicMethod>,
1058 boost::shared_ptr<MoFEM::BasicMethod>>(
1059 dm, fe_name, method, pre_only, post_only);
1063template <
class S,
class T0,
class T1,
class T2>
1065 T1 pre_only, T2 post_only) {
1066 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1070 dm_field->
tsCtx->getPreProcessIJacobian().push_back(pre_only);
1073 dm_field->
tsCtx->getLoopsIJacobian().push_back(
1077 dm_field->
tsCtx->getPostProcessIJacobian().push_back(post_only);
1089 pre_only, post_only);
1094 boost::shared_ptr<MoFEM::FEMethod> method,
1095 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
1096 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
1098 boost::shared_ptr<MoFEM::FEMethod>,
1099 boost::shared_ptr<MoFEM::BasicMethod>,
1100 boost::shared_ptr<MoFEM::BasicMethod>>(
1101 dm, fe_name, method, pre_only, post_only);
1104template <
class S,
class T0,
class T1,
class T2>
1106 T1 pre_only, T2 post_only) {
1107 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1111 dm_field->
tsCtx->getPreProcessMonitor().push_back(pre_only);
1113 dm_field->
tsCtx->getLoopsMonitor().push_back(
1116 dm_field->
tsCtx->getPostProcessMonitor().push_back(post_only);
1127 dm, ts, fe_name, method, pre_only, post_only);
1133 boost::shared_ptr<MoFEM::FEMethod> method,
1134 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
1135 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
1137 boost::shared_ptr<MoFEM::FEMethod>,
1138 boost::shared_ptr<MoFEM::BasicMethod>,
1139 boost::shared_ptr<MoFEM::BasicMethod>>(
1140 dm, ts, fe_name, method, pre_only, post_only);
1145 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1148 *ksp_ctx = dm_field->
kspCtx.get();
1154 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1157 const_cast<boost::shared_ptr<MoFEM::KspCtx> &
>(ksp_ctx) = dm_field->
kspCtx;
1162 boost::shared_ptr<MoFEM::KspCtx> ksp_ctx) {
1163 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1166 dm_field->
kspCtx = ksp_ctx;
1171 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1174 *snes_ctx = dm_field->
snesCtx.get();
1180 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1183 const_cast<boost::shared_ptr<MoFEM::SnesCtx> &
>(snes_ctx) = dm_field->
snesCtx;
1188 boost::shared_ptr<MoFEM::SnesCtx> snes_ctx) {
1189 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1200 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1211 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1219 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1227 const boost::shared_ptr<MoFEM::TsCtx> &
ts_ctx) {
1228 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1231 const_cast<boost::shared_ptr<MoFEM::TsCtx> &
>(
ts_ctx) = dm_field->
tsCtx;
1236 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1244 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1255 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1260 CHKERR VecSetDM(g_ptr, dm);
1265 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1275 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1279 if (strcmp(dm->mattype, MATSHELL) == 0) {
1287 "Matrix shell data not set, or matrix type not implemented");
1290 }
else if (strcmp(dm->mattype, MATMPIAIJ) == 0) {
1292 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(dm_field->
problemName,
1294 }
else if (strcmp(dm->mattype, MATAIJ) == 0) {
1296 ->createSeqAIJWithArrays<PetscLocalIdx_mi_tag>(dm_field->
problemName,
1298 }
else if (strcmp(dm->mattype, MATAIJCUSPARSE) == 0) {
1300 ->createMPIAIJCUSPARSEWithArrays<PetscGlobalIdx_mi_tag>(
1302 }
else if (strcmp(dm->mattype, MATSEQAIJCUSPARSE) == 0) {
1304 ->createSeqAIJCUSPARSEWithArrays<PetscLocalIdx_mi_tag>(
1308 "Matrix type not implemented");
1315 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1319 if (strcmp(dm->mattype, MATSHELL) == 0) {
1327 "Matrix shell data not set, or matrix type not implemented");
1329 }
else if (strcmp(dm->mattype, MATMPIAIJ) == 0) {
1331 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(dm_field->
problemName,
1333 }
else if (strcmp(dm->mattype, MATAIJ) == 0) {
1335 ->createSeqAIJWithArrays<PetscLocalIdx_mi_tag>(dm_field->
problemName,
1337 }
else if (strcmp(dm->mattype, MATAIJCUSPARSE) == 0) {
1339 ->createMPIAIJCUSPARSEWithArrays<PetscGlobalIdx_mi_tag>(
1341 }
else if (strcmp(dm->mattype, MATSEQAIJCUSPARSE) == 0) {
1343 ->createSeqAIJCUSPARSEWithArrays<PetscLocalIdx_mi_tag>(
1347 "Matrix type not implemented");
1353#if PETSC_VERSION_GE(3, 17, 0)
1355 PetscOptionItems *PetscOptionsObject) {
1356#elif PETSC_VERSION_GE(3, 7, 0)
1359#elif PETSC_VERSION_GE(3, 5, 3)
1365 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1368#if PETSC_VERSION_GE(3, 18, 0)
1369 PetscOptionsHeadBegin(PetscOptionsObject,
"DMMoFEM Options");
1370#elif PETSC_VERSION_GE(3, 5, 3)
1371 PetscOptionsHead(PetscOptionsObject,
"DMMoFEM Options");
1373 PetscOptionsHead(
"DMMoFEM Options");
1375 ierr = PetscOptionsBool(
"-dm_is_partitioned",
1376 "set if mesh is partitioned (works which native MOAB "
1377 "file format, i.e. h5m",
1385 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1432 PetscValidHeaderSpecific(subdm, DM_CLASSID, 1);
1441 map<std::string, boost::shared_ptr<Range>> *entity_map_row =
nullptr;
1442 map<std::string, boost::shared_ptr<Range>> *entity_map_col =
nullptr;
1452 subdm_field->
isSquareMatrix == PETSC_TRUE, entity_map_row, entity_map_col,
1459 0, subdm_field->
sIze,
1480 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1482 CHKERR VecGhostUpdateBegin(
g, INSERT_VALUES, SCATTER_FORWARD);
1487 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1490 CHKERR VecGhostUpdateEnd(
g, INSERT_VALUES, SCATTER_FORWARD);
1496 double *array_loc, *array_glob;
1497 CHKERR VecGetArray(
l, &array_loc);
1498 CHKERR VecGetArray(
g, &array_glob);
1501 cblas_dcopy(nb_dofs + nb_ghost, array_glob, 1, array_loc, 1);
1504 cblas_daxpy(nb_dofs + nb_ghost, 1, array_glob, 1, array_loc, 1);
1509 CHKERR VecRestoreArray(
l, &array_loc);
1510 CHKERR VecRestoreArray(
g, &array_glob);
1517 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1524 double *array_loc, *array_glob;
1525 CHKERR VecGetArray(
l, &array_loc);
1526 CHKERR VecGetArray(
g, &array_glob);
1529 cblas_dcopy(nb_dofs + nb_ghost, array_loc, 1, array_glob, 1);
1532 cblas_daxpy(nb_dofs + nb_ghost, 1, array_loc, 1, array_glob, 1);
1537 CHKERR VecRestoreArray(
l, &array_loc);
1538 CHKERR VecRestoreArray(
g, &array_glob);
1549 char ***fieldNames, IS **fields) {
1550 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1565 Field_multiIndex::iterator fit, hi_fit;
1566 fit = fields_ptr->begin();
1567 hi_fit = fields_ptr->end();
1568 *numFields = std::distance(fit, hi_fit);
1571 CHKERR PetscMalloc1(*numFields, fieldNames);
1574 CHKERR PetscMalloc1(*numFields, fields);
1577 for (
int f = 0; fit != hi_fit; fit++,
f++) {
1579 CHKERR PetscStrallocpy(fit->get()->getName().c_str(),
1580 (
char **)&(*fieldNames)[
f]);
1584 ->isCreateProblemFieldAndRank(
1586 fit->get()->getNbOfCoeffs(), &(*fields)[
f]);
1595 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1605 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1613 boost::shared_ptr<BlockStructure> data) {
1614 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1622 boost::shared_ptr<BlockStructure> &data) {
1623 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1631 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1635 *mat = mat_data.first;
1636 CHKERR PetscObjectReference((PetscObject)(*mat));
1642 boost::shared_ptr<NestSchurData> data) {
1643 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1655 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1659 *mat = mat_data.first;
1660 CHKERR PetscObjectReference((PetscObject)(*mat));
1665 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
Implementation of DM context. You should not use it directly.
Discrete manager interface for MoFEM.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode DMGlobalToLocalBegin_MoFEM(DM dm, Vec, InsertMode, Vec)
PetscErrorCode DMoFEMMeshToGlobalVector(DM dm, Vec g, InsertMode mode, ScatterMode scatter_mode, RowColData rc=RowColData::COL)
set ghosted vector values on all existing mesh entities
PetscErrorCode DMGlobalToLocalEnd_MoFEM(DM dm, Vec, InsertMode, Vec)
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)
PetscErrorCode DMMoFEMCreateSubDM(DM subdm, DM dm, const char problem_name[])
Must be called by user to set Sub DM MoFEM data structures.
PetscErrorCode DMMoFEMGetIsPartitioned(DM dm, PetscBool *is_partitioned)
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
PetscErrorCode DMMoFEMSNESSetFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES residual evaluation function
PetscErrorCode DMMoFEMGetProblemFiniteElementLayout(DM dm, std::string fe_name, PetscLayout *layout)
Get finite elements layout in the problem.
PetscErrorCode DMMoFEMRebuildProblem(DM dm, const MoFEM::BitRefLevel target_bit, const MoFEM::BitRefLevel target_mask, IS *old_row_indices=PETSC_NULLPTR, IS *new_row_indices=PETSC_NULLPTR)
Rebuild the DM's parent problem in place on a new bit ref level.
PetscErrorCode DMCreateLocalVector_MoFEM(DM dm, Vec *l)
DMShellSetCreateLocalVector.
PetscErrorCode DMMoFEMSetSquareProblem(DM dm, PetscBool square_problem)
set squared problem
PetscErrorCode DMMoFEMTSSetIFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set TS implicit function evaluation function
PetscErrorCode DMDestroy_MoFEM(DM dm)
Destroys dm with MoFEM data structure.
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
PetscErrorCode DMoFEMPostProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
PetscErrorCode DMMoFEMAddColCompositeProblem(DM dm, const char prb_name[])
Add problem to composite DM on col.
PetscErrorCode DMLocalToGlobalBegin_MoFEM(DM, Vec, InsertMode, Vec)
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
PetscErrorCode DMCreate_MoFEM(DM dm)
Create dm data structure with MoFEM data structure.
PetscErrorCode DMMoFEMSetSnesCtx(DM dm, boost::shared_ptr< MoFEM::SnesCtx > snes_ctx)
Set MoFEM::SnesCtx data structure.
PetscErrorCode DMMoFEMSetKspCtx(DM dm, boost::shared_ptr< MoFEM::KspCtx > ksp_ctx)
set MoFEM::KspCtx data structure
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[])
PetscErrorCode DMMoFEMGetIsSubDM(DM dm, PetscBool *is_sub_dm)
PetscErrorCode DMMoFEMAddRowCompositeProblem(DM dm, const char prb_name[])
Add problem to composite DM on row.
PetscErrorCode DMMoFEMSNESSetJacobian(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES Jacobian evaluation function
PetscErrorCode DMCreateMatrix_MoFEM(DM dm, Mat *M)
PetscErrorCode DMSetFromOptions_MoFEM(DM dm)
PetscErrorCode DMMoFEMGetTsCtx(DM dm, MoFEM::TsCtx **ts_ctx)
get MoFEM::TsCtx data structure
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode, RowColData rc=RowColData::COL)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMMoFEMGetKspCtx(DM dm, MoFEM::KspCtx **ksp_ctx)
get MoFEM::KspCtx data structure
PetscErrorCode DMMoFEMGetSquareProblem(DM dm, PetscBool *square_problem)
get squared problem
PetscErrorCode DMoFEMLoopDofs(DM dm, const char field_name[], MoFEM::DofMethod *method)
execute method for dofs on field in problem
PetscErrorCode DMMoFEMKSPSetComputeRHS(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set KSP right hand side evaluation function
PetscErrorCode DMMoFEMResolveSharedFiniteElements(DM dm, std::string fe_name)
Resolve shared entities.
PetscErrorCode DMMoFEMSetTsCtx(DM dm, boost::shared_ptr< MoFEM::TsCtx > ts_ctx)
Set MoFEM::TsCtx data structure.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
PetscErrorCode DMMoFEMGetFieldIS(DM dm, RowColData rc, const char field_name[], IS *is)
get field is in the problem
PetscErrorCode DMMoFEMTSSetIJacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
MoFEMErrorCode DMMoFEMCreateBlockMat(DM dm, Mat *mat)
Create block matrix.
PetscErrorCode DMoFEMGetInterfacePtr(DM dm, MoFEM::Interface **m_field_ptr)
Get pointer to MoFEM::Interface.
PetscErrorCode DMMoFEMAddSubFieldCol(DM dm, const char field_name[])
PetscErrorCode DMMoFEMTSSetI2Jacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
PetscErrorCode DMMoFEMTSSetI2Function(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS implicit function evaluation function
PetscErrorCode DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
PetscErrorCode DMMoFEMGetSnesCtx(DM dm, MoFEM::SnesCtx **snes_ctx)
get MoFEM::SnesCtx data structure
PetscErrorCode DMMoFEMGetIsCompDM(DM dm, PetscBool *is_comp_dm)
Get if this DM is composite DM.
PetscErrorCode DMSubDMSetUp_MoFEM(DM subdm)
PetscErrorCode DMMoFEMKSPSetComputeOperators(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
Set KSP operators and push mofem finite element methods.
PetscErrorCode DMCreateFieldIS_MoFEM(DM dm, PetscInt *numFields, char ***fieldNames, IS **fields)
PetscErrorCode DMMoFEMUnSetElement(DM dm, std::string fe_name)
unset element from dm
PetscErrorCode DMSetUp_MoFEM(DM dm)
PetscErrorCode DMLocalToGlobalEnd_MoFEM(DM, Vec, InsertMode, Vec)
PetscErrorCode DMoFEMLoopFiniteElementsUpAndLowRank(DM dm, const char fe_name[], MoFEM::FEMethod *method, int low_rank, int up_rank, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
PetscErrorCode DMoFEMPreProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
PetscErrorCode DMSetOperators_MoFEM(DM dm)
Set operators for MoFEM dm.
virtual const Problem * get_problem(const std::string problem_name) const =0
Get the problem object.
virtual const Field_multiIndex * get_fields() const =0
Get the fields object.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
virtual MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
MoFEMErrorCode buildProblemOnDistributedMesh(const std::string name, const bool square_matrix, int verb=VERBOSE)
build problem data structures, assuming that mesh is distributed (collective)
MoFEMErrorCode partitionGhostDofs(const std::string name, int verb=VERBOSE)
determine ghost nodes
MoFEMErrorCode rebuildProblemOnDistributedMesh(const std::string &name, const BitRefLevel target_bit, const BitRefLevel target_mask, const bool square_matrix, int verb=VERBOSE, SmartPetscObj< IS > *old_row_indices=nullptr, SmartPetscObj< IS > *new_row_indices=nullptr)
Rebuild a parent problem in place on a distributed mesh (collective)
MoFEMErrorCode buildComposedProblem(const std::string out_name, const std::vector< std::string > add_row_problems, const std::vector< std::string > add_col_problems, const bool square_matrix=true, int verb=1)
build composite problem
MoFEMErrorCode buildProblem(const std::string name, const bool square_matrix, int verb=VERBOSE)
build problem data structures
MoFEMErrorCode buildSubProblem(const std::string out_name, const std::vector< std::string > &fields_row, const std::vector< std::string > &fields_col, const std::string main_problem, const bool square_matrix=true, const map< std::string, boost::shared_ptr< Range > > *entityMapRow=nullptr, const map< std::string, boost::shared_ptr< Range > > *entityMapCol=nullptr, int verb=VERBOSE)
build sub problem
MoFEMErrorCode partitionProblem(const std::string name, int verb=VERBOSE)
partition problem dofs (collective)
MoFEMErrorCode partitionGhostDofsOnDistributedMesh(const std::string name, int verb=VERBOSE)
determine ghost nodes on distributed meshes
MoFEMErrorCode partitionFiniteElements(const std::string name, bool part_from_moab=false, int low_proc=-1, int hi_proc=-1, int verb=VERBOSE)
partition finite elements
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
virtual MoFEMErrorCode modify_problem_unset_finite_element(const std::string name_problem, const std::string &fe_name)=0
unset finite element from problem, this remove entities assigned to finite element to a particular pr...
virtual MoFEMErrorCode delete_problem(const std::string name)=0
Delete problem.
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
virtual bool check_problem(const std::string name)=0
check if problem exist
virtual MoFEMErrorCode modify_problem_mask_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
set dof mask ref level for problem
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
FTensor::Index< 'l', 3 > l
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
Set Monitor To TS solver.
PetscErrorCode TsSetIJacobian(TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a, Mat A, Mat B, void *ctx)
Set function evaluating jacobian in TS solver.
PetscErrorCode TsMonitorSet(TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
Set monitor for TS solver.
PetscErrorCode DMMoFEMTSSetRHSFunction(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS the right hand side function
PetscErrorCode SnesMat(SNES snes, Vec x, Mat A, Mat B, void *ctx)
This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver.
PetscErrorCode DMMoFEMSetDestroyProblem(DM dm, PetscBool destroy_problem)
MoFEMErrorCode DMMoFEMCreateHybridL2Mat(DM dm, SmartPetscObj< Mat > &mat)
Create matrix for hybridised system.
PetscErrorCode DMMoFEMGetDestroyProblem(DM dm, PetscBool *destroy_problem)
MoFEMErrorCode DMMoFEMGetBlocMatData(DM dm, boost::shared_ptr< BlockStructure > &)
Get data for block mat.
PetscErrorCode TsSetI2Function(TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, Vec F, void *ctx)
Calculation the right hand side for second order PDE in time.
PetscErrorCode TsSetRHSFunction(TS ts, PetscReal t, Vec u, Vec F, void *ctx)
TS solver function.
std::pair< SmartPetscObj< Mat >, boost::shared_ptr< NestSchurData > > createSchurNestedMatrix(boost::shared_ptr< NestSchurData > schur_net_data_ptr)
Create a Mat Diag Blocks object.
PetscErrorCode SnesRhs(SNES snes, Vec x, Vec f, void *ctx)
This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver.
PetscErrorCode DMMoFEMGetSubRowIS(DM dm, IS *is)
get sub problem is
PetscErrorCode DMMoFEMClearDMCtx(DM dm)
Clear solver and Schur data owned by a MoFEM DM context.
MoFEMErrorCode DMMoFEMCreateNestSchurMat(DM dm, Mat *mat)
Create nest schur matrix.
PetscErrorCode TsSetIFunction(TS ts, PetscReal t, Vec u, Vec u_t, Vec F, void *ctx)
Set IFunction for TS solver.
PetscErrorCode DMMoFEMGetSubColIS(DM dm, IS *is)
get sub problem is
PetscErrorCode KspRhs(KSP ksp, Vec f, void *ctx)
Run over elements in the lists.
MoFEMErrorCode DMMoFEMSetBlocMatData(DM dm, boost::shared_ptr< BlockStructure >)
Set data for block mat.
PetscErrorCode TsSetI2Jacobian(TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, PetscReal a, PetscReal aa, Mat A, Mat B, void *ctx)
Calculation Jacobian for second order PDE in time.
PetscErrorCode KspMat(KSP ksp, Mat A, Mat B, void *ctx)
Run over elements in the list.
PetscErrorCode TsSetRHSJacobian(TS ts, PetscReal t, Vec u, Mat A, Mat B, void *ctx)
TS solver function.
MoFEMErrorCode DMMoFEMSetNestSchurData(DM dm, boost::shared_ptr< NestSchurData >)
PetscErrorCode DMMoFEMTSSetRHSJacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS the right hand side jacobian
PetscErrorCode DMMoFEMSetVerbosity(DM dm, const int verb)
Set verbosity level.
PetscErrorCode DMMoFEMSwapDMCtx(DM dm, DM dm_swap)
Swap internal data structure.
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data structure.
SchurShellMatData createBlockMat(DM dm, boost::shared_ptr< BlockStructure > data)
Create a Schur Mat object.
boost::weak_ptr< CacheTuple > CacheTupleWeakPtr
constexpr auto field_name
Data structure to exchange data between MoFEM and User Loop Methods.
virtual MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
virtual MPI_Comm & get_comm() const =0
PetscBool isSquareMatrix
true if rows equals to cols
std::vector< std::string > rowCompPrb
boost::shared_ptr< NestSchurData > nestedSchurDataPtr
PetscBool destroyProblem
If true destroy problem with DM.
const Problem * problemMainOfSubPtr
pointer to main problem to sub-problem
std::string problemName
Problem name.
PetscBool isPartitioned
true if read mesh is on parts
std::map< std::string, boost::shared_ptr< Range > > mapTypeCol
const Problem * problemPtr
pointer to problem data structure
std::map< std::string, boost::shared_ptr< Range > > mapTypeRow
std::vector< std::string > colSubFields
boost::shared_ptr< BlockStructure > blocMatDataPtr
Interface * mField_ptr
MoFEM interface.
std::vector< std::string > rowSubFields
PetscBool isProblemBuild
True if problem is build.
std::vector< std::string > colCompPrb
PETSc Discrete Manager data structure.
boost::shared_ptr< SnesCtx > snesCtx
data structure SNES
boost::shared_ptr< TsCtx > tsCtx
data structure for TS solver
boost::shared_ptr< KspCtx > kspCtx
data structure KSP
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Deprecated interface functions.
Data structure for user loop methods on degrees of freedom (DOFs)
Structure for user loop methods on finite elements.
Section manager is used to create indexes and sections.
Interface for linear (KSP) solver.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Matrix manager is used to build and partition problems.
MoFEMErrorCode createHybridL2MPIAIJ(const std::string problem_name, SmartPetscObj< Mat > &aij_ptr, int verb=QUIET)
Create a Hybrid MPIAij object.
Index tags of the numbered DOF containers that also read the index.
keeps basic data about problem
DofIdx getNbLocalDofsRow() const
MoFEMErrorCode getNumberOfElementsByNameAndPart(MPI_Comm comm, const std::string name, PetscLayout *layout) const
Get number of finite elements by name on processors.
BitRefLevel getBitRefLevel() const
BitRefLevel getBitRefLevelMask() const
boost::shared_ptr< SubProblemData > & getSubData() const
Get main problem of sub-problem is.
DofIdx getNbGhostDofsRow() const
Problem manager is used to build and partition problems.
intrusive_ptr for managing petsc objects
Interface for nonlinear (SNES) solver.
Interface for Time Stepping (TS) solver.
base class for all interface classes
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Vector manager is used to create vectors \mofem_vectors.