v0.14.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SetUpSchurImpl Struct Reference
Inheritance diagram for SetUpSchurImpl:
[legend]
Collaboration diagram for SetUpSchurImpl:
[legend]

Public Member Functions

 SetUpSchurImpl (MoFEM::Interface &m_field)
 
virtual ~SetUpSchurImpl ()=default
 
MoFEMErrorCode setUp (SmartPetscObj< KSP >)
 
 SetUpSchurImpl (MoFEM::Interface &m_field, SmartPetscObj< DM > sub_dm, SmartPetscObj< IS > field_split_is, SmartPetscObj< AO > ao_up)
 
virtual ~SetUpSchurImpl ()
 
MoFEMErrorCode setUp (TS solver)
 
MoFEMErrorCode preProc ()
 
MoFEMErrorCode postProc ()
 
 SetUpSchurImpl (MoFEM::Interface &m_field)
 
virtual ~SetUpSchurImpl ()
 
MoFEMErrorCode setUp (SmartPetscObj< TS > solver)
 
 SetUpSchurImpl (MoFEM::Interface &m_field)
 
virtual ~SetUpSchurImpl ()
 
MoFEMErrorCode setUp (SmartPetscObj< TS > solver)
 
 SetUpSchurImpl (MoFEM::Interface &m_field)
 
virtual ~SetUpSchurImpl ()=default
 
MoFEMErrorCode setUp (SmartPetscObj< KSP > solver)
 
 SetUpSchurImpl (MoFEM::Interface &m_field, EshelbianCore *ep_core_ptr)
 
virtual ~SetUpSchurImpl ()
 
MoFEMErrorCode setUp (TS ts)
 
MoFEMErrorCode preProc ()
 
MoFEMErrorCode postProc ()
 

Private Member Functions

MoFEMErrorCode createSubDM ()
 
MoFEMErrorCode setOperator ()
 
MoFEMErrorCode setPC (PC pc)
 
MoFEMErrorCode setDiagonalPC (PC pc)
 
MoFEMErrorCode setOperator ()
 
MoFEMErrorCode setPC (PC pc)
 
SmartPetscObj< DM > createSubDM ()
 
MoFEMErrorCode setEntities ()
 
MoFEMErrorCode createSubDM ()
 
MoFEMErrorCode setOperator ()
 
MoFEMErrorCode setPC (PC pc)
 
MoFEMErrorCode setDiagonalPC (PC pc)
 

Private Attributes

MoFEM::InterfacemField
 
SmartPetscObj< Mat > S
 
SmartPetscObj< DM > subDM
 field split sub dm More...
 
SmartPetscObj< IS > fieldSplitIS
 IS for split Schur block. More...
 
SmartPetscObj< AO > aoSchur
 
SmartPetscObj< DM > schurDM
 
SmartPetscObj< DM > blockDM
 
Range volEnts
 
Range subEnts
 
EshelbianCore * epCorePtr
 
boost::shared_ptr< std::vector< boost::weak_ptr< NumeredDofEntity > > > piolaZeroDofsVec
 
boost::shared_ptr< std::vector< unsigned char > > piolaZeroDofsMarker
 

Additional Inherited Members

- Static Public Member Functions inherited from SetUpSchur
static boost::shared_ptr< SetUpSchurcreateSetUpSchur (MoFEM::Interface &m_field)
 
static boost::shared_ptr< SetUpSchurcreateSetUpSchur (MoFEM::Interface &m_field, SmartPetscObj< DM > sub_dm, SmartPetscObj< IS > field_split_it, SmartPetscObj< AO > ao_map)
 Create data structure for handling Schur complement. More...
 
static boost::shared_ptr< SetUpSchurcreateSetUpSchur (MoFEM::Interface &m_field)
 
static boost::shared_ptr< SetUpSchurcreateSetUpSchur (MoFEM::Interface &m_field)
 
static boost::shared_ptr< SetUpSchurcreateSetUpSchur (MoFEM::Interface &m_field)
 
- Protected Member Functions inherited from SetUpSchur
 SetUpSchur ()=default
 
virtual ~SetUpSchur ()=default
 
 SetUpSchur ()=default
 
 SetUpSchur ()=default
 
 SetUpSchur ()=default
 
 SetUpSchur ()=default
 

Detailed Description

Examples
plastic.cpp, and test_broken_space.cpp.

Definition at line 515 of file test_broken_space.cpp.

Constructor & Destructor Documentation

◆ SetUpSchurImpl() [1/6]

SetUpSchurImpl::SetUpSchurImpl ( MoFEM::Interface m_field)
inline
Examples
plastic.cpp, and test_broken_space.cpp.

Definition at line 517 of file test_broken_space.cpp.

517 : SetUpSchur(), mField(m_field) {}

◆ ~SetUpSchurImpl() [1/6]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
virtualdefault

◆ SetUpSchurImpl() [2/6]

SetUpSchurImpl::SetUpSchurImpl ( MoFEM::Interface m_field,
SmartPetscObj< DM >  sub_dm,
SmartPetscObj< IS >  field_split_is,
SmartPetscObj< AO >  ao_up 
)
inline

Definition at line 1464 of file plastic.cpp.

1466  : SetUpSchur(), mField(m_field), subDM(sub_dm),
1467  fieldSplitIS(field_split_is), aoSchur(ao_up) {
1468  if (S) {
1470  "Is expected that schur matrix is not "
1471  "allocated. This is "
1472  "possible only is PC is set up twice");
1473  }
1474  }

◆ ~SetUpSchurImpl() [2/6]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
inlinevirtual

Definition at line 1475 of file plastic.cpp.

1475 { S.reset(); }

◆ SetUpSchurImpl() [3/6]

SetUpSchurImpl::SetUpSchurImpl ( MoFEM::Interface m_field)
inline

Definition at line 989 of file contact.cpp.

989 : SetUpSchur(), mField(m_field) {}

◆ ~SetUpSchurImpl() [3/6]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
inlinevirtual

Definition at line 991 of file contact.cpp.

991 {}

◆ SetUpSchurImpl() [4/6]

SetUpSchurImpl::SetUpSchurImpl ( MoFEM::Interface m_field)
inline

Definition at line 935 of file incompressible_elasticity.cpp.

935 : SetUpSchur(), mField(m_field) {}

◆ ~SetUpSchurImpl() [4/6]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
inlinevirtual

Definition at line 936 of file incompressible_elasticity.cpp.

936 { S.reset(); }

◆ SetUpSchurImpl() [5/6]

SetUpSchurImpl::SetUpSchurImpl ( MoFEM::Interface m_field)
inline

Definition at line 927 of file elastic.cpp.

927  : SetUpSchur(), mField(m_field) {
928  if (S) {
931  "Is expected that schur matrix is not allocated. This is "
932  "possible only is PC is set up twice");
933  }
934  }

◆ ~SetUpSchurImpl() [5/6]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
virtualdefault

◆ SetUpSchurImpl() [6/6]

SetUpSchurImpl::SetUpSchurImpl ( MoFEM::Interface m_field,
EshelbianCore *  ep_core_ptr 
)
inline

Definition at line 11 of file SetUpSchurImpl.cpp.

12  : SetUpSchur(), mField(m_field), epCorePtr(ep_core_ptr) {}

◆ ~SetUpSchurImpl() [6/6]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
inlinevirtual

Definition at line 13 of file SetUpSchurImpl.cpp.

13 {}

Member Function Documentation

◆ createSubDM() [1/3]

MoFEMErrorCode SetUpSchurImpl::createSubDM ( )
private

◆ createSubDM() [2/3]

SmartPetscObj<DM> SetUpSchurImpl::createSubDM ( )
private

◆ createSubDM() [3/3]

MoFEMErrorCode SetUpSchurImpl::createSubDM ( )
private

Definition at line 1083 of file contact.cpp.

1083  {
1085  auto simple = mField.getInterface<Simple>();
1086 
1087  auto create_dm = [&](const char *name, const char *field_name, auto dm_type) {
1088  auto dm = createDM(mField.get_comm(), dm_type);
1089  auto create_dm_imp = [&]() {
1091  CHKERR DMMoFEMCreateSubDM(dm, simple->getDM(), name);
1092  CHKERR DMMoFEMSetSquareProblem(dm, PETSC_TRUE);
1093  CHKERR DMMoFEMAddElement(dm, simple->getDomainFEName());
1096  CHKERR DMSetUp(dm);
1098  };
1100  create_dm_imp(),
1101  "Error in creating schurDM. It is possible that schurDM is "
1102  "already created");
1103  return dm;
1104  };
1105 
1106  // Note: here we can make block with bubbles of "U" and "SIGMA" fields. See
1107  // vec-0 where bubbles are added.
1108 
1109  schurDM = create_dm("SCHUR", "U", "DMMOFEM_MG");
1110  blockDM = create_dm("BLOCK", "SIGMA", "DMMOFEM");
1111 
1112  if constexpr (AT == AssemblyType::BLOCK_SCHUR) {
1113 
1114  auto get_nested_mat_data = [&](auto schur_dm, auto block_dm) {
1115  auto block_mat_data = createBlockMatStructure(
1116  simple->getDM(),
1117 
1118  {{
1119 
1120  simple->getDomainFEName(),
1121 
1122  {
1123 
1124  {"U", "U"}, {"SIGMA", "U"}, {"U", "SIGMA"}, {"SIGMA", "SIGMA"}
1125 
1126  }}}
1127 
1128  );
1129 
1131 
1132  {schur_dm, block_dm}, block_mat_data,
1133 
1134  {"SIGMA"}, {nullptr}, true
1135 
1136  );
1137  };
1138 
1139  auto nested_mat_data = get_nested_mat_data(schurDM, blockDM);
1140  CHKERR DMMoFEMSetNestSchurData(simple->getDM(), nested_mat_data);
1141 
1142  } else {
1143  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1144  "Only BLOCK_SCHUR is implemented");
1145  }
1146 
1148 }

◆ postProc() [1/2]

MoFEMErrorCode SetUpSchurImpl::postProc ( )

◆ postProc() [2/2]

MoFEMErrorCode SetUpSchurImpl::postProc ( )
Examples
plastic.cpp.

◆ preProc() [1/2]

MoFEMErrorCode SetUpSchurImpl::preProc ( )

◆ preProc() [2/2]

MoFEMErrorCode SetUpSchurImpl::preProc ( )
Examples
plastic.cpp.

◆ setDiagonalPC() [1/2]

MoFEMErrorCode SetUpSchurImpl::setDiagonalPC ( PC  pc)
private

◆ setDiagonalPC() [2/2]

MoFEMErrorCode SetUpSchurImpl::setDiagonalPC ( PC  pc)
private

Definition at line 1235 of file contact.cpp.

1235  {
1237  KSP *subksp;
1238  CHKERR PCFieldSplitSchurGetSubKSP(pc, PETSC_NULL, &subksp);
1239  auto get_pc = [](auto ksp) {
1240  PC pc_raw;
1241  CHKERR KSPGetPC(ksp, &pc_raw);
1242  return SmartPetscObj<PC>(pc_raw, true); // bump reference
1243  };
1244  CHKERR setSchurA00MatSolvePC(get_pc(subksp[0]));
1245 
1246  auto set_pc_p_mg = [](auto dm, auto pc, auto S) {
1248  CHKERR PCSetDM(pc, dm);
1249  PetscBool same = PETSC_FALSE;
1250  PetscObjectTypeCompare((PetscObject)pc, PCMG, &same);
1251  if (same) {
1253  pc, createPCMGSetUpViaApproxOrdersCtx(dm, S, true));
1254  CHKERR PCSetFromOptions(pc);
1255  }
1257  };
1258 
1259  CHKERR set_pc_p_mg(schurDM, get_pc(subksp[1]), S);
1260 
1261  CHKERR PetscFree(subksp);
1263 }

◆ setEntities()

MoFEMErrorCode SetUpSchurImpl::setEntities ( )
private

Definition at line 1001 of file elastic.cpp.

1001  {
1003  auto simple = mField.getInterface<Simple>();
1004  CHKERR mField.get_moab().get_entities_by_dimension(simple->getMeshset(),
1005  SPACE_DIM, volEnts);
1006  CHKERR mField.get_moab().get_entities_by_handle(simple->getMeshset(),
1007  subEnts);
1008  subEnts = subtract(subEnts, volEnts);
1010 };

◆ setOperator() [1/3]

MoFEMErrorCode SetUpSchurImpl::setOperator ( )
private

◆ setOperator() [2/3]

MoFEMErrorCode SetUpSchurImpl::setOperator ( )
private

◆ setOperator() [3/3]

MoFEMErrorCode SetUpSchurImpl::setOperator ( )
private

Definition at line 1150 of file contact.cpp.

1150  {
1152 
1153  double eps_stab = 1e-4;
1154  CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-eps_stab", &eps_stab,
1155  PETSC_NULL);
1156 
1159  using OpMassStab = B::OpMass<3, SPACE_DIM * SPACE_DIM>;
1160 
1161  auto simple = mField.getInterface<Simple>();
1162  auto pip = mField.getInterface<PipelineManager>();
1163 
1164  auto dm_is = getDMSubData(schurDM)->getSmartRowIs();
1165  auto ao_up = createAOMappingIS(dm_is, PETSC_NULL);
1166 
1167  // Boundary
1168  pip->getOpBoundaryLhsPipeline().push_front(createOpSchurAssembleBegin());
1169  pip->getOpBoundaryLhsPipeline().push_back(
1170  new OpMassStab("SIGMA", "SIGMA",
1171  [eps_stab](double, double, double) { return eps_stab; }));
1172  pip->getOpBoundaryLhsPipeline().push_back(
1173 
1174  createOpSchurAssembleEnd({"SIGMA"}, {nullptr}, ao_up, S, false, false)
1175 
1176  );
1177 
1178  // Domain
1179  pip->getOpDomainLhsPipeline().push_front(createOpSchurAssembleBegin());
1180  pip->getOpDomainLhsPipeline().push_back(
1181 
1182  createOpSchurAssembleEnd({"SIGMA"}, {nullptr}, ao_up, S, false,
1183  false)
1184 
1185  );
1186 
1187  auto pre_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
1188  auto post_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
1189 
1190  pre_proc_schur_lhs_ptr->preProcessHook = [this]() {
1192  CHKERR MatZeroEntries(S);
1193  MOFEM_LOG("CONTACT", Sev::verbose) << "Lhs Assemble Begin";
1195  };
1196 
1197  post_proc_schur_lhs_ptr->postProcessHook = [this, ao_up,
1198  post_proc_schur_lhs_ptr]() {
1200  MOFEM_LOG("CONTACT", Sev::verbose) << "Lhs Assemble End";
1201  auto print_mat_norm = [this](auto a, std::string prefix) {
1203  double nrm;
1204  CHKERR MatNorm(a, NORM_FROBENIUS, &nrm);
1205  MOFEM_LOG("CONTACT", Sev::noisy) << prefix << " norm = " << nrm;
1207  };
1208  CHKERR MatAssemblyBegin(S, MAT_FINAL_ASSEMBLY);
1209  CHKERR MatAssemblyEnd(S, MAT_FINAL_ASSEMBLY);
1211  mField, post_proc_schur_lhs_ptr, 1, S, ao_up)();
1212 #ifndef NDEBUG
1213  CHKERR print_mat_norm(S, "S");
1214 #endif // NDEBUG
1215  MOFEM_LOG("CONTACT", Sev::verbose) << "Lhs Assemble Finish";
1217  };
1218 
1219  auto ts_ctx_ptr = getDMTsCtx(simple->getDM());
1220  ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_schur_lhs_ptr);
1221  ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_schur_lhs_ptr);
1222 
1224 }

◆ setPC() [1/3]

MoFEMErrorCode SetUpSchurImpl::setPC ( PC  pc)
private

◆ setPC() [2/3]

MoFEMErrorCode SetUpSchurImpl::setPC ( PC  pc)
private

◆ setPC() [3/3]

MoFEMErrorCode SetUpSchurImpl::setPC ( PC  pc)
private

Definition at line 1226 of file contact.cpp.

1226  {
1228  auto simple = mField.getInterface<Simple>();
1229  auto block_is = getDMSubData(blockDM)->getSmartRowIs();
1230  CHKERR PCFieldSplitSetIS(pc, NULL, block_is);
1231  CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER, S);
1233 }

◆ setUp() [1/6]

MoFEMErrorCode SetUpSchurImpl::setUp ( SmartPetscObj< KSP >  solver)
virtual

Implements SetUpSchur.

◆ setUp() [2/6]

MoFEMErrorCode SetUpSchurImpl::setUp ( SmartPetscObj< KSP >  ksp)
virtual

Implements SetUpSchur.

Examples
plastic.cpp, and test_broken_space.cpp.

Definition at line 528 of file test_broken_space.cpp.

528  {
530  auto simple = mField.getInterface<Simple>();
531  auto pip_mng = mField.getInterface<PipelineManager>();
532 
533  CHKERR KSPSetFromOptions(ksp);
534  PC pc;
535  CHKERR KSPGetPC(ksp, &pc);
536 
537  PetscBool is_pcfs = PETSC_FALSE;
538  PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
539  if (is_pcfs) {
540 
541  MOFEM_LOG("AT", Sev::inform) << "Setup Schur pc";
542 
543  auto create_sub_dm = [&]() {
544  auto simple = mField.getInterface<Simple>();
545 
546  auto create_dm = [&](
547 
548  std::string problem_name,
549  std::vector<std::string> fe_names,
550  std::vector<std::string> fields,
551 
552  auto dm_type
553 
554  ) {
555  auto dm = createDM(mField.get_comm(), dm_type);
556  auto create_dm_imp = [&]() {
558  CHKERR DMMoFEMCreateSubDM(dm, simple->getDM(), problem_name.c_str());
559  CHKERR DMMoFEMSetSquareProblem(dm, PETSC_TRUE);
560  for (auto fe : fe_names) {
561  CHKERR DMMoFEMAddElement(dm, fe);
562  }
563  CHKERR DMMoFEMAddElement(dm, simple->getSkeletonFEName());
564  for (auto field : fields) {
565  CHKERR DMMoFEMAddSubFieldRow(dm, field);
566  CHKERR DMMoFEMAddSubFieldCol(dm, field);
567  }
568  CHKERR DMSetUp(dm);
570  };
572  create_dm_imp(),
573  "Error in creating schurDM. It is possible that schurDM is "
574  "already created");
575  return dm;
576  };
577 
578  auto schur_dm = create_dm(
579 
580  "SCHUR",
581 
582  {simple->getDomainFEName(), simple->getSkeletonFEName()},
583 
584  {"HYBRID"},
585 
586  "DMMOFEM_MG");
587 
588  auto block_dm = create_dm(
589 
590  "BLOCK",
591 
592  {simple->getDomainFEName(), simple->getSkeletonFEName()},
593 
594  {"BROKEN", "U"},
595 
596  "DMMOFEM");
597 
598  return std::make_tuple(schur_dm, block_dm);
599  };
600 
601  auto get_nested_mat_data = [&](auto schur_dm, auto block_dm) {
602  auto block_mat_data = createBlockMatStructure(
603  simple->getDM(),
604 
605  {
606 
607  {
608 
609  simple->getDomainFEName(),
610 
611  {
612 
613  {"BROKEN", "BROKEN"},
614  {"U", "U"},
615  {"BROKEN", "U"},
616  {"U", "BROKEN"}
617 
618  }
619 
620  },
621 
622  {
623 
624  simple->getSkeletonFEName(),
625 
626  {
627 
628  {"BROKEN", "HYBRID"}, {"HYBRID", "BROKEN"}
629 
630  }
631 
632  }
633 
634  }
635 
636  );
637 
639 
640  {schur_dm, block_dm}, block_mat_data,
641 
642  {"BROKEN", "U"}, {nullptr, nullptr}, true
643 
644  );
645  };
646 
647  auto set_ops = [&](auto schur_dm) {
649  auto dm_is = getDMSubData(schur_dm)->getSmartRowIs();
650  auto ao_up = createAOMappingIS(dm_is, PETSC_NULL);
651 
652  boost::shared_ptr<BlockStructure> block_data;
653  CHKERR DMMoFEMGetBlocMatData(simple->getDM(), block_data);
654 
655  pip_mng->getOpDomainLhsPipeline().push_front(
657  pip_mng->getOpDomainLhsPipeline().push_back(
658 
659  createOpSchurAssembleEnd({"BROKEN", "U"}, {nullptr, nullptr}, ao_up,
660  S, true, true)
661 
662  );
663 
664  auto pre_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
665  auto post_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
666 
667  pre_proc_schur_lhs_ptr->preProcessHook = [this]() {
669  CHKERR MatZeroEntries(S);
670  MOFEM_LOG("AT", Sev::verbose) << "Lhs Assemble Begin";
672  };
673 
674  post_proc_schur_lhs_ptr->postProcessHook = [this, ao_up,
675  post_proc_schur_lhs_ptr]() {
677  MOFEM_LOG("AT", Sev::verbose) << "Lhs Assemble End";
678  CHKERR MatAssemblyBegin(S, MAT_FINAL_ASSEMBLY);
679  CHKERR MatAssemblyEnd(S, MAT_FINAL_ASSEMBLY);
680  MOFEM_LOG("AT", Sev::verbose) << "Lhs Assemble Finish";
682  };
683 
684  auto ksp_ctx_ptr = getDMKspCtx(simple->getDM());
685  ksp_ctx_ptr->getPreProcSetOperators().push_front(pre_proc_schur_lhs_ptr);
686  ksp_ctx_ptr->getPostProcSetOperators().push_back(post_proc_schur_lhs_ptr);
687 
689  };
690 
691  auto set_pc = [&](auto pc, auto block_dm) {
693  auto block_is = getDMSubData(block_dm)->getSmartRowIs();
694  CHKERR PCFieldSplitSetIS(pc, NULL, block_is);
695  CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER, S);
697  };
698 
699  auto set_diagonal_pc = [&](auto pc, auto schur_dm) {
701 
702  if (AT == BLOCK_SCHUR) {
703  auto A = createDMBlockMat(simple->getDM());
704  auto P = createDMNestSchurMat(simple->getDM());
705  CHKERR PCSetOperators(pc, A, P);
706  }
707 
708  KSP *subksp;
709  CHKERR PCFieldSplitSchurGetSubKSP(pc, PETSC_NULL, &subksp);
710  auto get_pc = [](auto ksp) {
711  PC pc_raw;
712  CHKERR KSPGetPC(ksp, &pc_raw);
713  return pc_raw;
714  };
715  CHKERR setSchurA00MatSolvePC(SmartPetscObj<PC>(get_pc(subksp[0]), true));
716 
717  auto set_pc_p_mg = [&](auto dm, auto pc) {
719 
720  CHKERR PCSetDM(pc, dm);
721  PetscBool same = PETSC_FALSE;
722  PetscObjectTypeCompare((PetscObject)pc, PCMG, &same);
723  if (same) {
724  // By default do not use shell mg mat. Implementation of SOR is slow.
726  pc, createPCMGSetUpViaApproxOrdersCtx(dm, S, false));
727  CHKERR PCSetFromOptions(pc);
728  }
730  };
731 
732  CHKERR set_pc_p_mg(schur_dm, get_pc(subksp[1]));
733 
734  CHKERR PetscFree(subksp);
736  };
737 
738  auto [schur_dm, block_dm] = create_sub_dm();
739  if (AT == BLOCK_SCHUR) {
740  auto nested_mat_data = get_nested_mat_data(schur_dm, block_dm);
741  CHKERR DMMoFEMSetNestSchurData(simple->getDM(), nested_mat_data);
742  }
743  S = createDMHybridisedL2Matrix(schur_dm);
744  CHKERR MatSetDM(S, PETSC_NULL);
745  int bs = (SPACE_DIM == 2) ? NBEDGE_L2(approx_order - 1)
746  : NBFACETRI_L2(approx_order - 1);
747  CHKERR MatSetBlockSize(S, bs);
748 
749  CHKERR set_ops(schur_dm);
750  CHKERR set_pc(pc, block_dm);
751  DM solver_dm;
752  CHKERR KSPGetDM(ksp, &solver_dm);
753  if (AT == BLOCK_SCHUR)
754  CHKERR DMSetMatType(solver_dm, MATSHELL);
755 
756  CHKERR KSPSetUp(ksp);
757  if (AT == BLOCK_SCHUR)
758  CHKERR set_diagonal_pc(pc, schur_dm);
759 
760  } else {
761  SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
762  "PC is not set to PCFIELDSPLIT");
763  }
765 }

◆ setUp() [3/6]

MoFEMErrorCode SetUpSchurImpl::setUp ( SmartPetscObj< TS >  solver)
virtual

Implements SetUpSchur.

◆ setUp() [4/6]

MoFEMErrorCode SetUpSchurImpl::setUp ( SmartPetscObj< TS >  solver)
virtual

Implements SetUpSchur.

Definition at line 1008 of file contact.cpp.

1008  {
1010  auto simple = mField.getInterface<Simple>();
1011  auto pip = mField.getInterface<PipelineManager>();
1012 
1013  SNES snes;
1014  CHKERR TSGetSNES(solver, &snes);
1015  KSP ksp;
1016  CHKERR SNESGetKSP(snes, &ksp);
1017  CHKERR KSPSetFromOptions(ksp);
1018 
1019  PC pc;
1020  CHKERR KSPGetPC(ksp, &pc);
1021 
1022  PetscBool is_pcfs = PETSC_FALSE;
1023  PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
1024  if (is_pcfs) {
1025 
1026  MOFEM_LOG("CONTACT", Sev::inform) << "Setup Schur pc";
1027 
1028  if (S) {
1031  "It is expected that Schur matrix is not allocated. This is "
1032  "possible only if PC is set up twice");
1033  }
1034 
1035  CHKERR createSubDM();
1036 
1037  // Add data to DM storage
1039  CHKERR MatSetBlockSize(S, SPACE_DIM);
1040  // CHKERR MatSetOption(S, MAT_SYMMETRIC, PETSC_TRUE);
1041 
1042  // Set DM to use shell block matrix
1043  DM solver_dm;
1044  CHKERR TSGetDM(solver, &solver_dm);
1045  CHKERR DMSetMatType(solver_dm, MATSHELL);
1046 
1047  auto ts_ctx_ptr = getDMTsCtx(solver_dm);
1048  auto A = createDMBlockMat(simple->getDM());
1049  auto P = createDMNestSchurMat(simple->getDM());
1050 
1051  if (is_quasi_static == PETSC_TRUE) {
1052  auto swap_assemble = [](TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a,
1053  Mat A, Mat B, void *ctx) {
1054  return TsSetIJacobian(ts, t, u, u_t, a, B, A, ctx);
1055  };
1056  CHKERR TSSetIJacobian(solver, A, P, swap_assemble, ts_ctx_ptr.get());
1057  } else {
1058  auto swap_assemble = [](TS ts, PetscReal t, Vec u, Vec u_t, Vec utt,
1059  PetscReal a, PetscReal aa, Mat A, Mat B,
1060  void *ctx) {
1061  return TsSetI2Jacobian(ts, t, u, u_t, utt, a, aa, B, A, ctx);
1062  };
1063  CHKERR TSSetI2Jacobian(solver, A, P, swap_assemble, ts_ctx_ptr.get());
1064  }
1065  CHKERR KSPSetOperators(ksp, A, P);
1066 
1067  CHKERR setOperator();
1068  CHKERR setPC(pc);
1069  CHKERR TSSetUp(solver);
1070  CHKERR KSPSetUp(ksp);
1071  CHKERR setDiagonalPC(pc);
1072 
1073  } else {
1074  MOFEM_LOG("CONTACT", Sev::inform) << "No Schur PC";
1075  pip->getOpBoundaryLhsPipeline().push_front(createOpSchurAssembleBegin());
1076  pip->getOpBoundaryLhsPipeline().push_back(createOpSchurAssembleEnd({}, {}));
1077  pip->getOpDomainLhsPipeline().push_front(createOpSchurAssembleBegin());
1078  pip->getOpDomainLhsPipeline().push_back(createOpSchurAssembleEnd({}, {}));
1079  }
1081 }

◆ setUp() [5/6]

MoFEMErrorCode SetUpSchurImpl::setUp ( TS  solver)
virtual

Implements SetUpSchur.

Definition at line 1490 of file plastic.cpp.

1490  {
1492  auto simple = mField.getInterface<Simple>();
1493  auto pip_mng = mField.getInterface<PipelineManager>();
1494 
1495  SNES snes;
1496  CHKERR TSGetSNES(solver, &snes);
1497  KSP ksp;
1498  CHKERR SNESGetKSP(snes, &ksp);
1499  CHKERR KSPSetFromOptions(ksp);
1500 
1501  PC pc;
1502  CHKERR KSPGetPC(ksp, &pc);
1503  PetscBool is_pcfs = PETSC_FALSE;
1504  PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
1505  if (is_pcfs) {
1506  if (S) {
1508  "Is expected that schur matrix is not "
1509  "allocated. This is "
1510  "possible only is PC is set up twice");
1511  }
1512 
1513  S = createDMMatrix(subDM);
1514  CHKERR MatSetBlockSize(S, SPACE_DIM);
1515 
1516  // Set DM to use shell block matrix
1517  DM solver_dm;
1518  CHKERR TSGetDM(solver, &solver_dm);
1519  CHKERR DMSetMatType(solver_dm, MATSHELL);
1520 
1521  auto ts_ctx_ptr = getDMTsCtx(solver_dm);
1522  auto A = createDMBlockMat(simple->getDM());
1523  auto P = createDMNestSchurMat(simple->getDM());
1524 
1525  if (is_quasi_static == PETSC_TRUE) {
1526  auto swap_assemble = [](TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a,
1527  Mat A, Mat B, void *ctx) {
1528  return TsSetIJacobian(ts, t, u, u_t, a, B, A, ctx);
1529  };
1530  CHKERR TSSetIJacobian(solver, A, P, swap_assemble, ts_ctx_ptr.get());
1531  } else {
1532  auto swap_assemble = [](TS ts, PetscReal t, Vec u, Vec u_t, Vec utt,
1533  PetscReal a, PetscReal aa, Mat A, Mat B,
1534  void *ctx) {
1535  return TsSetI2Jacobian(ts, t, u, u_t, utt, a, aa, B, A, ctx);
1536  };
1537  CHKERR TSSetI2Jacobian(solver, A, P, swap_assemble, ts_ctx_ptr.get());
1538  }
1539  CHKERR KSPSetOperators(ksp, A, P);
1540 
1541  auto set_ops = [&]() {
1543  auto pip_mng = mField.getInterface<PipelineManager>();
1544 
1545 #ifndef ADD_CONTACT
1546  // Boundary
1547  pip_mng->getOpBoundaryLhsPipeline().push_front(
1549  pip_mng->getOpBoundaryLhsPipeline().push_back(createOpSchurAssembleEnd(
1550 
1551  {"EP", "TAU"}, {nullptr, nullptr}, aoSchur, S, false, false
1552 
1553  ));
1554  // Domain
1555  pip_mng->getOpDomainLhsPipeline().push_front(
1557  pip_mng->getOpDomainLhsPipeline().push_back(createOpSchurAssembleEnd(
1558 
1559  {"EP", "TAU"}, {nullptr, nullptr}, aoSchur, S, false, false
1560 
1561  ));
1562 #else
1563 
1564  double eps_stab = 1e-4;
1565  CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-eps_stab", &eps_stab,
1566  PETSC_NULL);
1567 
1570  using OpMassStab = B::OpMass<3, SPACE_DIM * SPACE_DIM>;
1571 
1572  // Boundary
1573  pip_mng->getOpBoundaryLhsPipeline().push_front(
1575  pip_mng->getOpBoundaryLhsPipeline().push_back(
1576  new OpMassStab("SIGMA", "SIGMA", [eps_stab](double, double, double) {
1577  return eps_stab;
1578  }));
1579  pip_mng->getOpBoundaryLhsPipeline().push_back(createOpSchurAssembleEnd(
1580 
1581  {"SIGMA", "EP", "TAU"}, {nullptr, nullptr, nullptr}, aoSchur, S,
1582  false, false
1583 
1584  ));
1585  // Domain
1586  pip_mng->getOpDomainLhsPipeline().push_front(
1588  pip_mng->getOpDomainLhsPipeline().push_back(createOpSchurAssembleEnd(
1589 
1590  {"SIGMA", "EP", "TAU"}, {nullptr, nullptr, nullptr}, aoSchur, S,
1591  false, false
1592 
1593  ));
1594 #endif // ADD_CONTACT
1596  };
1597 
1598  auto set_assemble_elems = [&]() {
1600  auto schur_asmb_pre_proc = boost::make_shared<FEMethod>();
1601  schur_asmb_pre_proc->preProcessHook = [this]() {
1603  CHKERR MatZeroEntries(S);
1604  MOFEM_LOG("TIMER", Sev::verbose) << "Lhs Assemble Begin";
1606  };
1607  auto schur_asmb_post_proc = boost::make_shared<FEMethod>();
1608 
1609  schur_asmb_post_proc->postProcessHook = [this, schur_asmb_post_proc]() {
1611  MOFEM_LOG("TIMER", Sev::verbose) << "Lhs Assemble End";
1612 
1613  // Apply essential constrains to Schur complement
1614  CHKERR MatAssemblyBegin(S, MAT_FINAL_ASSEMBLY);
1615  CHKERR MatAssemblyEnd(S, MAT_FINAL_ASSEMBLY);
1617  mField, schur_asmb_post_proc, 1, S, aoSchur)();
1618 
1620  };
1621  auto ts_ctx_ptr = getDMTsCtx(simple->getDM());
1622  ts_ctx_ptr->getPreProcessIJacobian().push_front(schur_asmb_pre_proc);
1623  ts_ctx_ptr->getPostProcessIJacobian().push_front(schur_asmb_post_proc);
1625  };
1626 
1627  auto set_pc = [&]() {
1629  CHKERR PCFieldSplitSetIS(pc, NULL, fieldSplitIS);
1630  CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER, S);
1632  };
1633 
1634  auto set_diagonal_pc = [&]() {
1636  KSP *subksp;
1637  CHKERR PCFieldSplitSchurGetSubKSP(pc, PETSC_NULL, &subksp);
1638  auto get_pc = [](auto ksp) {
1639  PC pc_raw;
1640  CHKERR KSPGetPC(ksp, &pc_raw);
1641  return SmartPetscObj<PC>(pc_raw,
1642  true); // bump reference
1643  };
1644  CHKERR setSchurA00MatSolvePC(get_pc(subksp[0]));
1645  CHKERR PetscFree(subksp);
1647  };
1648 
1649  CHKERR set_ops();
1650  CHKERR set_pc();
1651  CHKERR set_assemble_elems();
1652 
1653  CHKERR TSSetUp(solver);
1654  CHKERR KSPSetUp(ksp);
1655  CHKERR set_diagonal_pc();
1656 
1657  } else {
1658  pip_mng->getOpBoundaryLhsPipeline().push_front(
1660  pip_mng->getOpBoundaryLhsPipeline().push_back(
1661  createOpSchurAssembleEnd({}, {}));
1662  pip_mng->getOpDomainLhsPipeline().push_front(createOpSchurAssembleBegin());
1663  pip_mng->getOpDomainLhsPipeline().push_back(
1664  createOpSchurAssembleEnd({}, {}));
1665  }
1666 
1667  // fieldSplitIS.reset();
1668  // aoSchur.reset();
1670 }

◆ setUp() [6/6]

MoFEMErrorCode SetUpSchurImpl::setUp ( TS  ts)
virtual

Implements SetUpSchur.

Member Data Documentation

◆ aoSchur

SmartPetscObj<AO> SetUpSchurImpl::aoSchur
private
Examples
plastic.cpp.

Definition at line 1487 of file plastic.cpp.

◆ blockDM

SmartPetscObj< DM > SetUpSchurImpl::blockDM
private

Definition at line 1005 of file contact.cpp.

◆ epCorePtr

EshelbianCore* SetUpSchurImpl::epCorePtr
private

Definition at line 21 of file SetUpSchurImpl.cpp.

◆ fieldSplitIS

SmartPetscObj<IS> SetUpSchurImpl::fieldSplitIS
private

IS for split Schur block.

Examples
plastic.cpp.

Definition at line 1486 of file plastic.cpp.

◆ mField

MoFEM::Interface & SetUpSchurImpl::mField
private
Examples
plastic.cpp, and test_broken_space.cpp.

Definition at line 524 of file test_broken_space.cpp.

◆ piolaZeroDofsMarker

boost::shared_ptr<std::vector<unsigned char> > SetUpSchurImpl::piolaZeroDofsMarker
private

Definition at line 28 of file SetUpSchurImpl.cpp.

◆ piolaZeroDofsVec

boost::shared_ptr<std::vector<boost::weak_ptr<NumeredDofEntity> > > SetUpSchurImpl::piolaZeroDofsVec
private

Definition at line 26 of file SetUpSchurImpl.cpp.

◆ S

SmartPetscObj< Mat > SetUpSchurImpl::S
private
Examples
plastic.cpp, and test_broken_space.cpp.

Definition at line 525 of file test_broken_space.cpp.

◆ schurDM

SmartPetscObj< DM > SetUpSchurImpl::schurDM
private

Definition at line 1004 of file contact.cpp.

◆ subDM

SmartPetscObj< DM > SetUpSchurImpl::subDM
private

field split sub dm

Examples
plastic.cpp.

Definition at line 1485 of file plastic.cpp.

◆ subEnts

Range SetUpSchurImpl::subEnts
private

Definition at line 953 of file elastic.cpp.

◆ volEnts

Range SetUpSchurImpl::volEnts
private

Definition at line 952 of file elastic.cpp.


The documentation for this struct was generated from the following files:
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::DMMoFEMGetBlocMatData
MoFEMErrorCode DMMoFEMGetBlocMatData(DM dm, boost::shared_ptr< BlockStructure > &)
Get data for block mat.
Definition: DMMoFEM.cpp:1542
SPACE_DIM
constexpr int SPACE_DIM
Definition: test_broken_space.cpp:27
MoFEM::createAOMappingIS
auto createAOMappingIS(IS isapp, IS ispetsc)
Creates an application mapping using two index sets.
Definition: PetscSmartObj.hpp:318
MoFEM::DMMoFEMAddSubFieldCol
PetscErrorCode DMMoFEMAddSubFieldCol(DM dm, const char field_name[])
Definition: DMMoFEM.cpp:280
SetUpSchurImpl::aoSchur
SmartPetscObj< AO > aoSchur
Definition: plastic.cpp:1487
MoFEM::EssentialPostProcLhs< DisplacementCubitBcData >
Specialization for DisplacementCubitBcData.
Definition: EssentialDisplacementCubitBcData.hpp:134
MoFEM::BLOCK_PRECONDITIONER_SCHUR
@ BLOCK_PRECONDITIONER_SCHUR
Definition: FormsIntegrators.hpp:109
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
SetUpSchurImpl::epCorePtr
EshelbianCore * epCorePtr
Definition: SetUpSchurImpl.cpp:21
MoFEM::createPCMGSetUpViaApproxOrdersCtx
boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx > createPCMGSetUpViaApproxOrdersCtx(DM dm, Mat A, bool use_shell_mat)
createPCMGSetUpViaApproxOrdersCtx
Definition: PCMGSetUpViaApproxOrders.cpp:630
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
MoFEM::DMMoFEMSetSquareProblem
PetscErrorCode DMMoFEMSetSquareProblem(DM dm, PetscBool square_problem)
set squared problem
Definition: DMMoFEM.cpp:456
MoFEM::getDMKspCtx
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
Definition: DMMoFEM.hpp:1113
SetUpSchurImpl::setPC
MoFEMErrorCode setPC(PC pc)
Definition: contact.cpp:1226
MoFEM::PipelineManager
PipelineManager interface.
Definition: PipelineManager.hpp:24
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
MoFEM::TsSetI2Jacobian
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.
Definition: TsCtx.cpp:511
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
MoFEM::getDMSubData
auto getDMSubData(DM dm)
Get sub problem data structure.
Definition: DMMoFEM.hpp:1157
SetUpSchurImpl::schurDM
SmartPetscObj< DM > schurDM
Definition: contact.cpp:1004
SetUpSchurImpl::createSubDM
MoFEMErrorCode createSubDM()
Definition: contact.cpp:1083
SetUpSchurImpl::subDM
SmartPetscObj< DM > subDM
field split sub dm
Definition: plastic.cpp:1485
MoFEM::createDMMatrix
auto createDMMatrix(DM dm)
Get smart matrix from DM.
Definition: DMMoFEM.hpp:1056
MoFEM::DMMoFEMAddElement
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
Definition: DMMoFEM.cpp:497
MoFEM::createDMBlockMat
auto createDMBlockMat(DM dm)
Definition: DMMoFEM.hpp:1076
SPACE_DIM
constexpr int SPACE_DIM
Definition: contact.cpp:55
SetUpSchurImpl::volEnts
Range volEnts
Definition: elastic.cpp:952
SetUpSchurImpl::blockDM
SmartPetscObj< DM > blockDM
Definition: contact.cpp:1005
MoFEM::createOpSchurAssembleEnd
OpSchurAssembleBase * createOpSchurAssembleEnd(std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range >> field_ents, SmartPetscObj< AO > ao, SmartPetscObj< Mat > schur, bool sym_schur, bool symm_op)
Construct a new Op Schur Assemble End object.
Definition: Schur.cpp:2186
AT
constexpr AssemblyType AT
Definition: test_broken_space.cpp:20
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
SetUpSchurImpl::S
SmartPetscObj< Mat > S
Definition: test_broken_space.cpp:525
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM::createDM
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
Definition: PetscSmartObj.hpp:141
a
constexpr double a
Definition: approx_sphere.cpp:30
SetUpSchurImpl::fieldSplitIS
SmartPetscObj< IS > fieldSplitIS
IS for split Schur block.
Definition: plastic.cpp:1486
SPACE_DIM
constexpr int SPACE_DIM
Definition: plastic.cpp:40
MoFEM::createDMHybridisedL2Matrix
auto createDMHybridisedL2Matrix(DM dm)
Get smart hybridised L2 matrix from DM.
Definition: DMMoFEM.hpp:1069
SetUpSchurImpl::subEnts
Range subEnts
Definition: elastic.cpp:953
is_quasi_static
PetscBool is_quasi_static
Definition: plastic.cpp:139
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
NBEDGE_L2
#define NBEDGE_L2(P)
Number of base functions on edge from L2 space.
Definition: h1_hdiv_hcurl_l2.h:48
MoFEM::DMMoFEMCreateSubDM
PetscErrorCode DMMoFEMCreateSubDM(DM subdm, DM dm, const char problem_name[])
Must be called by user to set Sub DM MoFEM data structures.
Definition: DMMoFEM.cpp:215
MoFEM::FormsIntegrators::Assembly
Assembly methods.
Definition: FormsIntegrators.hpp:317
SetUpSchurImpl::mField
MoFEM::Interface & mField
Definition: test_broken_space.cpp:524
EshelbianPlasticity::P
@ P
Definition: EshelbianContact.cpp:197
MoFEM::createOpSchurAssembleBegin
OpSchurAssembleBase * createOpSchurAssembleBegin()
Definition: Schur.cpp:2181
MoFEM::createDMNestSchurMat
auto createDMNestSchurMat(DM dm)
Definition: DMMoFEM.hpp:1083
MoFEM::TsSetIJacobian
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.
Definition: TsCtx.cpp:165
SPACE_DIM
constexpr int SPACE_DIM
[Define dimension]
Definition: elastic.cpp:18
SetUpSchurImpl::setOperator
MoFEMErrorCode setOperator()
Definition: contact.cpp:1150
t
constexpr double t
plate stiffness
Definition: plate.cpp:58
BiLinearForm
SetUpSchur::SetUpSchur
SetUpSchur()=default
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MoFEM::setSchurA00MatSolvePC
MoFEMErrorCode setSchurA00MatSolvePC(SmartPetscObj< PC > pc)
Set PC for A00 block.
Definition: Schur.cpp:2223
is_quasi_static
PetscBool is_quasi_static
[Operators used for contact]
Definition: contact.cpp:78
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
NBFACETRI_L2
#define NBFACETRI_L2(P)
Number of base functions on triangle for L2 space.
Definition: h1_hdiv_hcurl_l2.h:42
approx_order
int approx_order
Definition: test_broken_space.cpp:50
MoFEM::createSchurNestedMatrixStruture
boost::shared_ptr< NestSchurData > createSchurNestedMatrixStruture(std::pair< SmartPetscObj< DM >, SmartPetscObj< DM >> dms, boost::shared_ptr< BlockStructure > block_mat_data_ptr, std::vector< std::string > fields_names, std::vector< boost::shared_ptr< Range >> field_ents, bool add_preconditioner_block)
Get the Schur Nest Mat Array object.
Definition: Schur.cpp:1944
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::BLOCK_SCHUR
@ BLOCK_SCHUR
Definition: FormsIntegrators.hpp:108
MOFEM_ATOM_TEST_INVALID
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:40
MoFEM::DMMoFEMSetNestSchurData
MoFEMErrorCode DMMoFEMSetNestSchurData(DM dm, boost::shared_ptr< NestSchurData >)
Definition: DMMoFEM.cpp:1562
MoFEM::createBlockMatStructure
boost::shared_ptr< BlockStructure > createBlockMatStructure(DM dm, SchurFEOpsFEandFields schur_fe_op_vec)
Create a Mat Diag Blocks object.
Definition: Schur.cpp:1009
MoFEM::PCMGSetUpViaApproxOrders
MoFEMErrorCode PCMGSetUpViaApproxOrders(PC pc, boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx > ctx, int verb)
Function build MG structure.
Definition: PCMGSetUpViaApproxOrders.cpp:634
MoFEM::PetscOptionsGetScalar
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:162
MoFEM::DMMoFEMAddSubFieldRow
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[])
Definition: DMMoFEM.cpp:238
MoFEM::SmartPetscObj
intrusive_ptr for managing petsc objects
Definition: PetscSmartObj.hpp:82
SetUpSchurImpl::setDiagonalPC
MoFEMErrorCode setDiagonalPC(PC pc)
Definition: contact.cpp:1235
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
AT
constexpr AssemblyType AT
Definition: contact.cpp:36
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEM::getDMTsCtx
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition: DMMoFEM.hpp:1141
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359