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, 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< AO > aoUp
 
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, 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
 
 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/7]

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/7]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
virtualdefault

◆ SetUpSchurImpl() [2/7]

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

Definition at line 1285 of file plastic.cpp.

1287  : SetUpSchur(), mField(m_field), subDM(sub_dm),
1288  fieldSplitIS(field_split_is), aoSchur(ao_up) {
1289  if (S) {
1292  "Is expected that schur matrix is not allocated. This is "
1293  "possible only is PC is set up twice");
1294  }
1295  }

◆ ~SetUpSchurImpl() [2/7]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
inlinevirtual

Definition at line 1296 of file plastic.cpp.

1296 { S.reset(); }

◆ SetUpSchurImpl() [3/7]

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

Definition at line 1273 of file plasticity_old_schur.cpp.

1275  : SetUpSchur(), mField(m_field), subDM(sub_dm),
1276  fieldSplitIS(field_split_is), aoUp(ao_up) {
1277  if (S) {
1280  "Is expected that schur matrix is not allocated. This is "
1281  "possible only is PC is set up twice");
1282  }
1283  }

◆ ~SetUpSchurImpl() [3/7]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
inlinevirtual

Definition at line 1284 of file plasticity_old_schur.cpp.

1284  {
1285 #ifdef ADD_CONTACT
1286  A.reset();
1287  P.reset();
1288 #endif // ADD_CONTACT
1289  S.reset();
1290  }

◆ SetUpSchurImpl() [4/7]

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

Definition at line 989 of file contact.cpp.

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

◆ ~SetUpSchurImpl() [4/7]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
inlinevirtual

Definition at line 991 of file contact.cpp.

991 {}

◆ SetUpSchurImpl() [5/7]

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

Definition at line 935 of file incompressible_elasticity.cpp.

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

◆ ~SetUpSchurImpl() [5/7]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
inlinevirtual

Definition at line 936 of file incompressible_elasticity.cpp.

936 { S.reset(); }

◆ SetUpSchurImpl() [6/7]

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

Definition at line 886 of file elastic.cpp.

886  : SetUpSchur(), mField(m_field) {
887  if (S) {
890  "Is expected that schur matrix is not allocated. This is "
891  "possible only is PC is set up twice");
892  }
893  }

◆ ~SetUpSchurImpl() [6/7]

virtual SetUpSchurImpl::~SetUpSchurImpl ( )
virtualdefault

◆ SetUpSchurImpl() [7/7]

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() [7/7]

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/3]

MoFEMErrorCode SetUpSchurImpl::postProc ( )

◆ postProc() [2/3]

MoFEMErrorCode SetUpSchurImpl::postProc ( )

◆ postProc() [3/3]

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

◆ preProc() [1/3]

MoFEMErrorCode SetUpSchurImpl::preProc ( )

◆ preProc() [2/3]

MoFEMErrorCode SetUpSchurImpl::preProc ( )

◆ preProc() [3/3]

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 960 of file elastic.cpp.

960  {
962  auto simple = mField.getInterface<Simple>();
963  CHKERR mField.get_moab().get_entities_by_dimension(simple->getMeshset(),
964  SPACE_DIM, volEnts);
965  CHKERR mField.get_moab().get_entities_by_handle(simple->getMeshset(),
966  subEnts);
967  subEnts = subtract(subEnts, volEnts);
969 };

◆ 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/7]

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

Implements SetUpSchur.

◆ setUp() [2/7]

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/7]

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

Implements SetUpSchur.

◆ setUp() [4/7]

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/7]

MoFEMErrorCode SetUpSchurImpl::setUp ( TS  solver)
virtual

Implements SetUpSchur.

◆ setUp() [6/7]

MoFEMErrorCode SetUpSchurImpl::setUp ( TS  solver)
virtual

Implements SetUpSchur.

Definition at line 1311 of file plastic.cpp.

1311  {
1313  auto simple = mField.getInterface<Simple>();
1314  auto pip_mng = mField.getInterface<PipelineManager>();
1315 
1316  SNES snes;
1317  CHKERR TSGetSNES(solver, &snes);
1318  KSP ksp;
1319  CHKERR SNESGetKSP(snes, &ksp);
1320  CHKERR KSPSetFromOptions(ksp);
1321 
1322  PC pc;
1323  CHKERR KSPGetPC(ksp, &pc);
1324  PetscBool is_pcfs = PETSC_FALSE;
1325  PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
1326  if (is_pcfs) {
1327  if (S) {
1330  "Is expected that schur matrix is not allocated. This is "
1331  "possible only is PC is set up twice");
1332  }
1333 
1334  S = createDMMatrix(subDM);
1335  CHKERR MatSetBlockSize(S, SPACE_DIM);
1336 
1337  // Set DM to use shell block matrix
1338  DM solver_dm;
1339  CHKERR TSGetDM(solver, &solver_dm);
1340  CHKERR DMSetMatType(solver_dm, MATSHELL);
1341 
1342  auto ts_ctx_ptr = getDMTsCtx(solver_dm);
1343  auto A = createDMBlockMat(simple->getDM());
1344  auto P = createDMNestSchurMat(simple->getDM());
1345 
1346  if (is_quasi_static == PETSC_TRUE) {
1347  auto swap_assemble = [](TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a,
1348  Mat A, Mat B, void *ctx) {
1349  return TsSetIJacobian(ts, t, u, u_t, a, B, A, ctx);
1350  };
1351  CHKERR TSSetIJacobian(solver, A, P, swap_assemble, ts_ctx_ptr.get());
1352  } else {
1353  auto swap_assemble = [](TS ts, PetscReal t, Vec u, Vec u_t, Vec utt,
1354  PetscReal a, PetscReal aa, Mat A, Mat B,
1355  void *ctx) {
1356  return TsSetI2Jacobian(ts, t, u, u_t, utt, a, aa, B, A, ctx);
1357  };
1358  CHKERR TSSetI2Jacobian(solver, A, P, swap_assemble, ts_ctx_ptr.get());
1359  }
1360  CHKERR KSPSetOperators(ksp, A, P);
1361 
1362  auto set_ops = [&]() {
1364  auto pip_mng = mField.getInterface<PipelineManager>();
1365 
1366 #ifndef ADD_CONTACT
1367  // Boundary
1368  pip_mng->getOpBoundaryLhsPipeline().push_front(
1370  pip_mng->getOpBoundaryLhsPipeline().push_back(createOpSchurAssembleEnd(
1371 
1372  {"EP", "TAU"}, {nullptr, nullptr}, aoSchur, S, false, false
1373 
1374  ));
1375  // Domain
1376  pip_mng->getOpDomainLhsPipeline().push_front(
1378  pip_mng->getOpDomainLhsPipeline().push_back(createOpSchurAssembleEnd(
1379 
1380  {"EP", "TAU"}, {nullptr, nullptr}, aoSchur, S, false, false
1381 
1382  ));
1383 #else
1384 
1385  double eps_stab = 1e-4;
1386  CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-eps_stab", &eps_stab,
1387  PETSC_NULL);
1388 
1391  using OpMassStab = B::OpMass<3, SPACE_DIM * SPACE_DIM>;
1392 
1393  // Boundary
1394  pip_mng->getOpBoundaryLhsPipeline().push_front(
1396  pip_mng->getOpBoundaryLhsPipeline().push_back(
1397  new OpMassStab("SIGMA", "SIGMA", [eps_stab](double, double, double) {
1398  return eps_stab;
1399  }));
1400  pip_mng->getOpBoundaryLhsPipeline().push_back(createOpSchurAssembleEnd(
1401 
1402  {"SIGMA", "EP", "TAU"}, {nullptr, nullptr, nullptr}, aoSchur, S,
1403  false, false
1404 
1405  ));
1406  // Domain
1407  pip_mng->getOpDomainLhsPipeline().push_front(
1409  pip_mng->getOpDomainLhsPipeline().push_back(createOpSchurAssembleEnd(
1410 
1411  {"SIGMA", "EP", "TAU"}, {nullptr, nullptr, nullptr}, aoSchur, S,
1412  false, false
1413 
1414  ));
1415 #endif // ADD_CONTACT
1417  };
1418 
1419  auto set_assemble_elems = [&]() {
1421  auto schur_asmb_pre_proc = boost::make_shared<FEMethod>();
1422  schur_asmb_pre_proc->preProcessHook = [this]() {
1424  CHKERR MatZeroEntries(S);
1425  MOFEM_LOG("TIMER", Sev::verbose) << "Lhs Assemble Begin";
1427  };
1428  auto schur_asmb_post_proc = boost::make_shared<FEMethod>();
1429 
1430  schur_asmb_post_proc->postProcessHook = [this, schur_asmb_post_proc]() {
1432  MOFEM_LOG("TIMER", Sev::verbose) << "Lhs Assemble End";
1433 
1434  // Apply essential constrains to Schur complement
1435  CHKERR MatAssemblyBegin(S, MAT_FINAL_ASSEMBLY);
1436  CHKERR MatAssemblyEnd(S, MAT_FINAL_ASSEMBLY);
1438  mField, schur_asmb_post_proc, 1, S, aoSchur)();
1439 
1441  };
1442  auto ts_ctx_ptr = getDMTsCtx(simple->getDM());
1443  ts_ctx_ptr->getPreProcessIJacobian().push_front(schur_asmb_pre_proc);
1444  ts_ctx_ptr->getPostProcessIJacobian().push_front(schur_asmb_post_proc);
1446  };
1447 
1448  auto set_pc = [&]() {
1450  CHKERR PCFieldSplitSetIS(pc, NULL, fieldSplitIS);
1451  CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER, S);
1453  };
1454 
1455  auto set_diagonal_pc = [&]() {
1457  KSP *subksp;
1458  CHKERR PCFieldSplitSchurGetSubKSP(pc, PETSC_NULL, &subksp);
1459  auto get_pc = [](auto ksp) {
1460  PC pc_raw;
1461  CHKERR KSPGetPC(ksp, &pc_raw);
1462  return SmartPetscObj<PC>(pc_raw, true); // bump reference
1463  };
1464  CHKERR setSchurA00MatSolvePC(get_pc(subksp[0]));
1465  CHKERR PetscFree(subksp);
1467  };
1468 
1469  CHKERR set_ops();
1470  CHKERR set_pc();
1471  CHKERR set_assemble_elems();
1472 
1473  CHKERR TSSetUp(solver);
1474  CHKERR KSPSetUp(ksp);
1475  CHKERR set_diagonal_pc();
1476 
1477  } else {
1478  pip_mng->getOpBoundaryLhsPipeline().push_front(
1480  pip_mng->getOpBoundaryLhsPipeline().push_back(
1481  createOpSchurAssembleEnd({}, {}));
1482  pip_mng->getOpDomainLhsPipeline().push_front(createOpSchurAssembleBegin());
1483  pip_mng->getOpDomainLhsPipeline().push_back(
1484  createOpSchurAssembleEnd({}, {}));
1485  }
1486 
1487  // fieldSplitIS.reset();
1488  // aoSchur.reset();
1490 }

◆ setUp() [7/7]

MoFEMErrorCode SetUpSchurImpl::setUp ( TS  ts)
virtual

Implements SetUpSchur.

Member Data Documentation

◆ aoSchur

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

Definition at line 1308 of file plastic.cpp.

◆ aoUp

SmartPetscObj<AO> SetUpSchurImpl::aoUp
private

Definition at line 1306 of file plasticity_old_schur.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 1307 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 1306 of file plastic.cpp.

◆ subEnts

Range SetUpSchurImpl::subEnts
private

Definition at line 912 of file elastic.cpp.

◆ volEnts

Range SetUpSchurImpl::volEnts
private

Definition at line 911 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
SetUpSchurImpl::fieldSplitIS
SmartPetscObj< IS > fieldSplitIS
IS for split Schur block.
Definition: plastic.cpp:1307
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:1308
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:1306
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:911
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
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:912
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
SetUpSchurImpl::aoUp
SmartPetscObj< AO > aoUp
Definition: plasticity_old_schur.cpp:1306
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