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>
19 : mField_ptr(PETSC_NULL), isProblemBuild(PETSC_FALSE),
20 isPartitioned(PETSC_FALSE), isSquareMatrix(PETSC_TRUE),
21 isSubDM(PETSC_FALSE), isCompDM(PETSC_FALSE), destroyProblem(PETSC_FALSE),
22 verbosity(
VERBOSE), referenceNumber(0) {
25 auto core_log = logging::core::get();
43 *iface =
const_cast<DMCtx *
>(
this);
54 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
70 CHKERR DMSetMatType(dm, MATMPIAIJ);
76 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
78 dm->data =
new DMCtx();
84 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
85 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
89 CHKERR PetscObjectGetComm((PetscObject)dm, &comm);
92 MPI_Comm_compare(comm, PETSC_COMM_SELF, &result);
93 if (result == MPI_IDENT)
95 <<
"MoFEM DM destroy for problem " << dm_field->
problemName
99 <<
"MoFEM DM destroy for problem " << dm_field->
problemName
110 delete static_cast<DMCtx *
>(dm->data);
119 const char problem_name[],
124 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
127 "data structure for MoFEM not yet created");
131 "DM function not implemented into MoFEM");
149 boost::shared_ptr<KspCtx>(
new KspCtx(*m_field_ptr, problem_name));
151 boost::shared_ptr<SnesCtx>(
new SnesCtx(*m_field_ptr, problem_name));
153 boost::shared_ptr<TsCtx>(
new TsCtx(*m_field_ptr, problem_name));
156 CHKERR PetscObjectGetComm((PetscObject)dm, &comm);
158 MPI_Comm_compare(comm, m_field_ptr->
get_comm(), &result);
159 if (result > MPI_CONGRUENT) {
161 "MoFEM and DM using different communicators");
163 MPI_Comm_size(comm, &dm_field->
sIze);
164 MPI_Comm_rank(comm, &dm_field->
rAnk);
170 MPI_Comm_compare(comm, PETSC_COMM_SELF, &result);
171 if (result == MPI_IDENT) {
173 <<
"MoFEM DM created for problem " << dm_field->
problemName;
177 <<
"MoFEM DM created for problem " << dm_field->
problemName;
189 "data structure for MoFEM not yet created");
192 delete static_cast<DMCtx *
>(dm_duplicate->data);
194 dm_duplicate->data = dm->data;
195 ++(
static_cast<DMCtx *
>(dm_duplicate->data)->referenceNumber);
204 "data structure for MoFEM not yet created on dm");
207 "data structure for MoFEM not yet created on swap dm");
209 auto *dm_field =
static_cast<DMCtx *
>(dm->data);
210 auto *dm_field_swap =
static_cast<DMCtx *
>(dm_swap->data);
212 auto tmp_field = dm_field;
213 dm_field = dm_field_swap;
214 dm_field_swap = tmp_field;
224 "data structure for MoFEM not yet created");
226 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
233 subdm_field->
isSubDM = PETSC_TRUE;
243 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
245 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
248 "data structure for MoFEM not yet created");
259 boost::shared_ptr<Range> r_ptr) {
260 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
262 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
265 "data structure for MoFEM not yet created");
276 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
278 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
281 "data structure for MoFEM not yet created");
292 boost::shared_ptr<Range> r_ptr) {
293 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
295 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
298 "data structure for MoFEM not yet created");
310 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
312 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
313 *is_sub_dm = dm_field->
isSubDM;
319 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
321 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
322 if (dm_field->
isSubDM != PETSC_TRUE) {
324 "This DM is not created as a SubDM");
329 boost::shared_ptr<Problem::SubProblemData> sub_data =
331 CHKERR sub_data->getRowIs(is);
337 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
339 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
340 if (dm_field->
isSubDM != PETSC_TRUE) {
342 "This DM is not created as a SubDM");
347 boost::shared_ptr<Problem::SubProblemData> sub_data =
349 CHKERR sub_data->getColIs(is);
354 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
356 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
359 "data structure for MoFEM not yet created");
372 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
374 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
377 "data structure for MoFEM not yet created");
384 "No need to add problem on column when problem block structurally "
393 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
395 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
401 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
403 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
406 "data structure for MoFEM not yet created");
413 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
415 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
418 "data structure for MoFEM not yet created");
426 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
428 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
435 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
437 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
443 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
445 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
451 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
453 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
455 ->resolveSharedFiniteElements(dm_field->
problemPtr, fe_name);
460 PetscLayout *layout) {
462 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
464 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
467 CHKERR PetscObjectGetComm((PetscObject)dm, &comm);
476 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
478 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
484 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
486 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
494 for (
auto fe : fe_name) {
501 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
503 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
510 ScatterMode scatter_mode) {
512 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
514 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
522 ScatterMode scatter_mode) {
523 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
525 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
533 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
535 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
543 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
545 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
557 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
559 dm_field->
problemPtr, fe_name, *method, low_rank, up_rank,
nullptr,
566 DM dm,
const std::string fe_name, boost::shared_ptr<MoFEM::FEMethod> method,
569 low_rank, up_rank, cache_ptr);
575 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
577 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
579 dm, fe_name, method, dm_field->
rAnk, dm_field->
rAnk, cache_ptr);
586 boost::shared_ptr<MoFEM::FEMethod> method,
593 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
595 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
598 *method, dm_field->
rAnk, dm_field->
rAnk);
603template <
class S,
class T0,
class T1,
class T2>
605 T1 pre_only, T2 post_only) {
606 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
608 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
610 dm_field->
kspCtx->getPreProcComputeRhs().push_back(pre_only);
613 dm_field->
kspCtx->getComputeRhs().push_back(
617 dm_field->
kspCtx->getPostProcComputeRhs().push_back(post_only);
629 dm, fe_name, method, pre_only, post_only);
634 boost::shared_ptr<MoFEM::FEMethod> method,
635 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
636 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
638 boost::shared_ptr<MoFEM::FEMethod>,
639 boost::shared_ptr<MoFEM::BasicMethod>,
640 boost::shared_ptr<MoFEM::BasicMethod>>(
641 dm, fe_name, method, pre_only, post_only);
644template <
class S,
class T0,
class T1,
class T2>
646 T1 pre_only, T2 post_only) {
647 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
649 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
651 dm_field->
kspCtx->getPreProcSetOperators().push_back(pre_only);
654 dm_field->
kspCtx->getSetOperators().push_back(
658 dm_field->
kspCtx->getPostProcSetOperators().push_back(post_only);
671 dm, fe_name, method, pre_only, post_only);
676 boost::shared_ptr<MoFEM::FEMethod> method,
677 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
678 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
680 boost::shared_ptr<MoFEM::FEMethod>>(
681 dm, fe_name, method, pre_only, post_only);
684template <
class S,
class T0,
class T1,
class T2>
686 T1 pre_only, T2 post_only) {
687 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
689 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
691 dm_field->
snesCtx->getPreProcComputeRhs().push_back(pre_only);
694 dm_field->
snesCtx->getComputeRhs().push_back(
698 dm_field->
snesCtx->getPostProcComputeRhs().push_back(post_only);
710 dm, fe_name, method, pre_only, post_only);
715 boost::shared_ptr<MoFEM::FEMethod> method,
716 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
717 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
719 boost::shared_ptr<MoFEM::FEMethod>,
720 boost::shared_ptr<MoFEM::BasicMethod>,
721 boost::shared_ptr<MoFEM::BasicMethod>>(
722 dm, fe_name, method, pre_only, post_only);
725template <
class S,
class T0,
class T1,
class T2>
727 T1 pre_only, T2 post_only) {
728 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
730 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
732 dm_field->
snesCtx->getPreProcSetOperators().push_back(pre_only);
735 dm_field->
snesCtx->getSetOperators().push_back(
739 dm_field->
snesCtx->getPostProcSetOperators().push_back(post_only);
751 dm, fe_name, method, pre_only, post_only);
756 boost::shared_ptr<MoFEM::FEMethod> method,
757 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
758 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
760 boost::shared_ptr<MoFEM::FEMethod>,
761 boost::shared_ptr<MoFEM::BasicMethod>,
762 boost::shared_ptr<MoFEM::BasicMethod>>(
763 dm, fe_name, method, pre_only, post_only);
766template <
class S,
class T0,
class T1,
class T2>
768 T1 pre_only, T2 post_only) {
769 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
771 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
773 dm_field->
tsCtx->getPreProcessIFunction().push_back(pre_only);
776 dm_field->
tsCtx->getLoopsIFunction().push_back(
780 dm_field->
tsCtx->getPostProcessIFunction().push_back(post_only);
792 dm, fe_name, method, pre_only, post_only);
798 boost::shared_ptr<MoFEM::FEMethod> method,
799 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
800 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
802 boost::shared_ptr<MoFEM::FEMethod>,
803 boost::shared_ptr<MoFEM::BasicMethod>,
804 boost::shared_ptr<MoFEM::BasicMethod>>(
805 dm, fe_name, method, pre_only, post_only);
809template <
class S,
class T0,
class T1,
class T2>
811 T1 pre_only, T2 post_only) {
812 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
814 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
816 dm_field->
tsCtx->getPreProcessIJacobian().push_back(pre_only);
819 dm_field->
tsCtx->getLoopsIJacobian().push_back(
823 dm_field->
tsCtx->getPostProcessIJacobian().push_back(post_only);
835 pre_only, post_only);
840 boost::shared_ptr<MoFEM::FEMethod> method,
841 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
842 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
844 boost::shared_ptr<MoFEM::FEMethod>,
845 boost::shared_ptr<MoFEM::BasicMethod>,
846 boost::shared_ptr<MoFEM::BasicMethod>>(
847 dm, fe_name, method, pre_only, post_only);
850template <
class S,
class T0,
class T1,
class T2>
852 T1 pre_only, T2 post_only) {
853 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
855 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
857 dm_field->
tsCtx->getPreProcessRHSFunction().push_back(pre_only);
859 dm_field->
tsCtx->getLoopsRHSFunction().push_back(
862 dm_field->
tsCtx->getPostProcessRHSFunction().push_back(post_only);
869 boost::shared_ptr<MoFEM::FEMethod> method,
870 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
871 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
873 boost::shared_ptr<MoFEM::FEMethod>,
874 boost::shared_ptr<MoFEM::BasicMethod>,
875 boost::shared_ptr<MoFEM::BasicMethod>>(
876 dm, fe_name, method, pre_only, post_only);
886 dm, fe_name, method, pre_only, post_only);
890template <
class S,
class T0,
class T1,
class T2>
892 T1 pre_only, T2 post_only) {
893 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
895 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
897 dm_field->
tsCtx->getPreProcessRHSFunction().push_back(pre_only);
899 dm_field->
tsCtx->getLoopsRHSFunction().push_back(
902 dm_field->
tsCtx->getPostProcessRHSFunction().push_back(post_only);
909 boost::shared_ptr<MoFEM::FEMethod> method,
910 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
911 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
913 boost::shared_ptr<MoFEM::FEMethod>,
914 boost::shared_ptr<MoFEM::BasicMethod>,
915 boost::shared_ptr<MoFEM::BasicMethod>>(
916 dm, fe_name, method, pre_only, post_only);
926 dm, fe_name, method, pre_only, post_only);
930template <
class S,
class T0,
class T1,
class T2>
932 T1 pre_only, T2 post_only) {
933 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
935 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
937 dm_field->
tsCtx->getPreProcessIFunction().push_back(pre_only);
940 dm_field->
tsCtx->getLoopsIFunction().push_back(
944 dm_field->
tsCtx->getPostProcessIFunction().push_back(post_only);
956 dm, fe_name, method, pre_only, post_only);
962 boost::shared_ptr<MoFEM::FEMethod> method,
963 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
964 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
966 boost::shared_ptr<MoFEM::FEMethod>,
967 boost::shared_ptr<MoFEM::BasicMethod>,
968 boost::shared_ptr<MoFEM::BasicMethod>>(
969 dm, fe_name, method, pre_only, post_only);
973template <
class S,
class T0,
class T1,
class T2>
975 T1 pre_only, T2 post_only) {
976 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
978 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
980 dm_field->
tsCtx->getPreProcessIJacobian().push_back(pre_only);
983 dm_field->
tsCtx->getLoopsIJacobian().push_back(
987 dm_field->
tsCtx->getPostProcessIJacobian().push_back(post_only);
999 pre_only, post_only);
1004 boost::shared_ptr<MoFEM::FEMethod> method,
1005 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
1006 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
1008 boost::shared_ptr<MoFEM::FEMethod>,
1009 boost::shared_ptr<MoFEM::BasicMethod>,
1010 boost::shared_ptr<MoFEM::BasicMethod>>(
1011 dm, fe_name, method, pre_only, post_only);
1014template <
class S,
class T0,
class T1,
class T2>
1016 T1 pre_only, T2 post_only) {
1017 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1019 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1021 dm_field->
tsCtx->getPreProcessMonitor().push_back(pre_only);
1023 dm_field->
tsCtx->getLoopsMonitor().push_back(
1026 dm_field->
tsCtx->getPostProcessMonitor().push_back(post_only);
1037 dm, ts, fe_name, method, pre_only, post_only);
1043 boost::shared_ptr<MoFEM::FEMethod> method,
1044 boost::shared_ptr<MoFEM::BasicMethod> pre_only,
1045 boost::shared_ptr<MoFEM::BasicMethod> post_only) {
1047 boost::shared_ptr<MoFEM::FEMethod>,
1048 boost::shared_ptr<MoFEM::BasicMethod>,
1049 boost::shared_ptr<MoFEM::BasicMethod>>(
1050 dm, ts, fe_name, method, pre_only, post_only);
1055 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1057 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1058 *ksp_ctx = dm_field->
kspCtx.get();
1064 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1066 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1067 const_cast<boost::shared_ptr<MoFEM::KspCtx> &
>(ksp_ctx) = dm_field->
kspCtx;
1072 boost::shared_ptr<MoFEM::KspCtx> ksp_ctx) {
1073 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1075 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1076 dm_field->
kspCtx = ksp_ctx;
1081 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1084 *snes_ctx = dm_field->
snesCtx.get();
1090 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1092 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1093 const_cast<boost::shared_ptr<MoFEM::SnesCtx> &
>(snes_ctx) = dm_field->
snesCtx;
1098 boost::shared_ptr<MoFEM::SnesCtx> snes_ctx) {
1099 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1101 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1110 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1112 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1121 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1123 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1129 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1131 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1137 const boost::shared_ptr<MoFEM::TsCtx> &
ts_ctx) {
1138 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1140 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1141 const_cast<boost::shared_ptr<MoFEM::TsCtx> &
>(
ts_ctx) = dm_field->
tsCtx;
1146 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1148 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1154 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1156 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1164 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1166 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1169 CHKERR VecSetDM(g_ptr, dm);
1174 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1176 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1184 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1186 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1187 if (strcmp(dm->mattype, MATMPIAIJ) == 0) {
1189 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(dm_field->
problemName,
1191 }
else if (strcmp(dm->mattype, MATAIJ) == 0) {
1193 ->createSeqAIJWithArrays<PetscLocalIdx_mi_tag>(dm_field->
problemName,
1195 }
else if (strcmp(dm->mattype, MATAIJCUSPARSE) == 0) {
1197 ->createMPIAIJCUSPARSEWithArrays<PetscGlobalIdx_mi_tag>(
1199 }
else if (strcmp(dm->mattype, MATSEQAIJCUSPARSE) == 0) {
1201 ->createSeqAIJCUSPARSEWithArrays<PetscLocalIdx_mi_tag>(
1205 "Matrix type not implemented");
1212 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1214 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1215 if (strcmp(dm->mattype, MATMPIAIJ) == 0) {
1217 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(dm_field->
problemName,
1219 }
else if (strcmp(dm->mattype, MATAIJ) == 0) {
1221 ->createSeqAIJWithArrays<PetscLocalIdx_mi_tag>(dm_field->
problemName,
1223 }
else if (strcmp(dm->mattype, MATAIJCUSPARSE) == 0) {
1225 ->createMPIAIJCUSPARSEWithArrays<PetscGlobalIdx_mi_tag>(
1227 }
else if (strcmp(dm->mattype, MATSEQAIJCUSPARSE) == 0) {
1229 ->createSeqAIJCUSPARSEWithArrays<PetscLocalIdx_mi_tag>(
1233 "Matrix type not implemented");
1239#if PETSC_VERSION_GE(3, 7, 0)
1242#elif PETSC_VERSION_GE(3, 5, 3)
1248 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1250 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1251#if PETSC_VERSION_GE(3, 5, 3)
1252 ierr = PetscOptionsHead(PetscOptionsObject,
"DMMoFEM Options");
1255 ierr = PetscOptionsHead(
"DMMoFEM Options");
1258 ierr = PetscOptionsBool(
"-dm_is_partitioned",
1259 "set if mesh is partitioned (works which native MOAB "
1260 "file format, i.e. h5m",
1268 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1271 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1315 PetscValidHeaderSpecific(subdm, DM_CLASSID, 1);
1319 DMCtx *subdm_field =
static_cast<DMCtx *
>(subdm->data);
1324 map<std::string, boost::shared_ptr<Range>> *entity_map_row =
nullptr;
1325 map<std::string, boost::shared_ptr<Range>> *entity_map_col =
nullptr;
1335 subdm_field->
isSquareMatrix == PETSC_TRUE, entity_map_row, entity_map_col,
1342 0, subdm_field->
sIze,
1363 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1365 CHKERR VecGhostUpdateBegin(
g, INSERT_VALUES, SCATTER_FORWARD);
1371 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1374 CHKERR VecGhostUpdateEnd(
g, INSERT_VALUES, SCATTER_FORWARD);
1376 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1380 double *array_loc, *array_glob;
1381 CHKERR VecGetArray(
l, &array_loc);
1382 CHKERR VecGetArray(
g, &array_glob);
1385 cblas_dcopy(nb_dofs + nb_ghost, array_glob, 1, array_loc, 1);
1388 cblas_daxpy(nb_dofs + nb_ghost, 1, array_glob, 1, array_loc, 1);
1393 CHKERR VecRestoreArray(
l, &array_loc);
1394 CHKERR VecRestoreArray(
g, &array_glob);
1401 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1404 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1408 double *array_loc, *array_glob;
1409 CHKERR VecGetArray(
l, &array_loc);
1410 CHKERR VecGetArray(
g, &array_glob);
1413 cblas_dcopy(nb_dofs + nb_ghost, array_loc, 1, array_glob, 1);
1416 cblas_daxpy(nb_dofs + nb_ghost, 1, array_loc, 1, array_glob, 1);
1421 CHKERR VecRestoreArray(
l, &array_loc);
1422 CHKERR VecRestoreArray(
g, &array_glob);
1434 char ***fieldNames, IS **fields) {
1435 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1448 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1450 Field_multiIndex::iterator fit, hi_fit;
1451 fit = fields_ptr->begin();
1452 hi_fit = fields_ptr->end();
1453 *numFields = std::distance(fit, hi_fit);
1456 CHKERR PetscMalloc1(*numFields, fieldNames);
1459 CHKERR PetscMalloc1(*numFields, fields);
1462 for (
int f = 0; fit != hi_fit; fit++, f++) {
1464 CHKERR PetscStrallocpy(fit->get()->getName().c_str(),
1465 (
char **)&(*fieldNames)[f]);
1469 ->isCreateProblemFieldAndRank(
1471 fit->get()->getNbOfCoeffs(), &(*fields)[f]);
1480 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1482 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
1490 PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
1492 DMCtx *dm_field =
static_cast<DMCtx *
>(dm->data);
Discrete manager interface for MoFEM.
if(!static_cast< bool >(ifstream(param_file)))
#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 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 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 DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
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 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
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 DMoFEMMeshToGlobalVector(DM dm, Vec g, InsertMode mode, ScatterMode scatter_mode)
set ghosted vector values on all existing mesh entities
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 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 jacobina 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)
PetscErrorCode DMMoFEMGetDestroyProblem(DM dm, PetscBool *destroy_problem)
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.
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 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.
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 Jaconian 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.
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 struture.
PetscErrorCode DMMoFEMDuplicateDMCtx(DM dm, DM dm_duplicate)
Duplicate internal data struture.
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
PETSc Discrete Manager data structure.
std::string problemName
Problem name.
const Problem * problemPtr
pinter to problem data structure
std::vector< std::string > rowCompPrb
boost::shared_ptr< SnesCtx > snesCtx
data structure SNES
boost::shared_ptr< TsCtx > tsCtx
data structure for TS solver
PetscBool isSquareMatrix
true if rows equals to cols
PetscBool isPartitioned
true if read mesh is on parts
PetscBool isProblemBuild
True if problem is build.
Interface * mField_ptr
MoFEM interface.
boost::shared_ptr< KspCtx > kspCtx
data structure KSP
std::vector< std::string > colCompPrb
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
std::vector< std::string > colFields
PetscBool destroyProblem
If true destroy problem with DM.
std::vector< std::string > rowFields
std::map< std::string, boost::shared_ptr< Range > > mapTypeRow
const Problem * problemMainOfSubPtr
pinter to main problem to sub-problem
std::map< std::string, boost::shared_ptr< Range > > mapTypeCol
Deprecated interface functions.
Data structure to exchange data between mofem and User Loop Methods on entities.
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.
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 refernce to pointer of interface.
Vector manager is used to create vectors \mofem_vectors.