![Logo](MoFEMLogo.png) |
| v0.14.0
|
◆ SetUpSchurImpl() [1/7]
◆ ~SetUpSchurImpl() [1/7]
virtual SetUpSchurImpl::~SetUpSchurImpl |
( |
| ) |
|
|
virtualdefault |
◆ SetUpSchurImpl() [2/7]
SetUpSchurImpl::SetUpSchurImpl |
( |
MoFEM::Interface & |
m_field, |
|
|
SmartPetscObj< Mat > |
m, |
|
|
SmartPetscObj< Mat > |
p, |
|
|
EshelbianCore * |
ep_core_ptr |
|
) |
| |
|
inline |
Definition at line 11 of file SetUpSchurImpl.cpp.
17 "Is expected that schur matrix is not allocated. This is "
18 "possible only is PC is set up twice");
◆ ~SetUpSchurImpl() [2/7]
virtual SetUpSchurImpl::~SetUpSchurImpl |
( |
| ) |
|
|
inlinevirtual |
◆ SetUpSchurImpl() [3/7]
Definition at line 1285 of file plastic.cpp.
1292 "Is expected that schur matrix is not allocated. This is "
1293 "possible only is PC is set up twice");
◆ ~SetUpSchurImpl() [3/7]
virtual SetUpSchurImpl::~SetUpSchurImpl |
( |
| ) |
|
|
inlinevirtual |
◆ SetUpSchurImpl() [4/7]
Definition at line 1273 of file plasticity_old_schur.cpp.
1280 "Is expected that schur matrix is not allocated. This is "
1281 "possible only is PC is set up twice");
◆ ~SetUpSchurImpl() [4/7]
virtual SetUpSchurImpl::~SetUpSchurImpl |
( |
| ) |
|
|
inlinevirtual |
◆ SetUpSchurImpl() [5/7]
◆ ~SetUpSchurImpl() [5/7]
virtual SetUpSchurImpl::~SetUpSchurImpl |
( |
| ) |
|
|
inlinevirtual |
◆ SetUpSchurImpl() [6/7]
◆ ~SetUpSchurImpl() [6/7]
virtual SetUpSchurImpl::~SetUpSchurImpl |
( |
| ) |
|
|
inlinevirtual |
◆ SetUpSchurImpl() [7/7]
Definition at line 884 of file elastic.cpp.
888 "Is expected that schur matrix is not allocated. This is "
889 "possible only is PC is set up twice");
◆ ~SetUpSchurImpl() [7/7]
virtual SetUpSchurImpl::~SetUpSchurImpl |
( |
| ) |
|
|
virtualdefault |
◆ createSubDM() [1/3]
◆ createSubDM() [2/3]
◆ createSubDM() [3/3]
Definition at line 1056 of file contact.cpp.
1060 auto create_dm = [&](
const char *name,
const char *
field_name) {
1062 auto create_dm_imp = [&]() {
1074 "Error in creating schurDM. It is possible that schurDM is "
1082 schurDM = create_dm(
"SCHUR",
"U");
1083 blockDM = create_dm(
"BLOCK",
"SIGMA");
1087 auto get_nested_mat_data = [&](
auto schur_dm,
auto block_dm) {
1093 simple->getDomainFEName(),
1097 {
"U",
"U"}, {
"SIGMA",
"U"}, {
"U",
"SIGMA"}, {
"SIGMA",
"SIGMA"}
1107 {
"SIGMA"}, {
nullptr}, true
1117 "Only BLOCK_SCHUR is implemented");
◆ postProc() [1/3]
MoFEMErrorCode SetUpSchurImpl::postProc |
( |
| ) |
|
- Examples
- plastic.cpp.
Definition at line 213 of file SetUpSchurImpl.cpp.
216 MOFEM_LOG(
"EP", Sev::verbose) <<
"Assemble Schur";
217 CHKERR MatAssemblyBegin(
S, MAT_FINAL_ASSEMBLY);
218 CHKERR MatAssemblyEnd(
S, MAT_FINAL_ASSEMBLY);
220 CHKERR MatAssemblyBegin(
M, MAT_FINAL_ASSEMBLY);
221 CHKERR MatAssemblyEnd(
M, MAT_FINAL_ASSEMBLY);
222 CHKERR MatAssemblyBegin(
P, MAT_FINAL_ASSEMBLY);
223 CHKERR MatAssemblyEnd(
P, MAT_FINAL_ASSEMBLY);
224 CHKERR MatAXPY(
P, 1,
M, SAME_NONZERO_PATTERN);
◆ postProc() [2/3]
◆ postProc() [3/3]
◆ preProc() [1/3]
MoFEMErrorCode SetUpSchurImpl::preProc |
( |
| ) |
|
◆ preProc() [2/3]
◆ preProc() [3/3]
◆ setDiagonalPC() [1/2]
◆ setDiagonalPC() [2/2]
Definition at line 1213 of file contact.cpp.
1216 CHKERR PCFieldSplitSchurGetSubKSP(pc, PETSC_NULL, &subksp);
1217 auto get_pc = [](
auto ksp) {
1219 CHKERR KSPGetPC(ksp, &pc_raw);
1223 CHKERR PetscFree(subksp);
◆ setEntities()
◆ setOperator() [1/3]
◆ setOperator() [2/3]
◆ setOperator() [3/3]
Definition at line 1123 of file contact.cpp.
1126 double eps_stab = 1e-4;
1132 using OpMassStab = B::OpMass<3, SPACE_DIM * SPACE_DIM>;
1138 boost::shared_ptr<BlockStructure> block_data;
1146 pip->getOpBoundaryLhsPipeline().push_back(
1147 new OpMassStab(
"SIGMA",
"SIGMA",
1148 [eps_stab](
double,
double,
double) {
return eps_stab; }));
1149 pip->getOpBoundaryLhsPipeline().push_back(
1158 pip->getOpDomainLhsPipeline().push_back(
1165 auto pre_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
1166 auto post_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
1168 pre_proc_schur_lhs_ptr->preProcessHook = [
this]() {
1171 MOFEM_LOG(
"CONTACT", Sev::verbose) <<
"Lhs Assemble Begin";
1175 post_proc_schur_lhs_ptr->postProcessHook = [
this, ao_up,
1176 post_proc_schur_lhs_ptr]() {
1178 MOFEM_LOG(
"CONTACT", Sev::verbose) <<
"Lhs Assemble End";
1179 auto print_mat_norm = [
this](
auto a, std::string prefix) {
1182 CHKERR MatNorm(
a, NORM_FROBENIUS, &nrm);
1183 MOFEM_LOG(
"CONTACT", Sev::noisy) << prefix <<
" norm = " << nrm;
1186 CHKERR MatAssemblyBegin(
S, MAT_FINAL_ASSEMBLY);
1187 CHKERR MatAssemblyEnd(
S, MAT_FINAL_ASSEMBLY);
1189 mField, post_proc_schur_lhs_ptr, 1,
S, ao_up)();
1191 CHKERR print_mat_norm(
S,
"S");
1193 MOFEM_LOG(
"CONTACT", Sev::verbose) <<
"Lhs Assemble Finish";
1198 ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_schur_lhs_ptr);
1199 ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_schur_lhs_ptr);
◆ setPC() [1/3]
◆ setPC() [2/3]
◆ setPC() [3/3]
Definition at line 1204 of file contact.cpp.
1208 CHKERR PCFieldSplitSetIS(pc, NULL, block_is);
1209 CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER,
S);
◆ setUp() [1/7]
MoFEMErrorCode SetUpSchurImpl::setUp |
( |
KSP |
solver | ) |
|
Definition at line 39 of file SetUpSchurImpl.cpp.
42 auto get_ents_by_dim = [&](
int dim) {
48 std::vector<std::string> schur_field_list{
61 std::vector<std::string> field_list{
epCorePtr->piolaStress,
64 auto create_schur_dm = [&](SmartPetscObj<DM> &dm_sub) {
75 auto faces_ptr = boost::make_shared<Range>(get_ents_by_dim(
SPACE_DIM - 1));
76 std::vector<boost::shared_ptr<Range>> dm_range_list{faces_ptr,
nullptr};
78 if (field_list.size() != dm_range_list.size()) {
80 "Both ranges should have the same size");
84 for (
auto f : field_list) {
85 MOFEM_LOG(
"EP", Sev::inform) <<
"Add schur field: " <<
f;
94 auto create_a00_is = [&](SmartPetscObj<IS> &is_a00) {
97 std::vector<SmartPetscObj<IS>> is_vec;
98 std::vector<Range *> range_list_ptr(schur_field_list.size(),
nullptr);
99 range_list_ptr.back() = &vols;
102 for (
auto f : schur_field_list) {
103 SmartPetscObj<IS> is;
106 range_list_ptr[r_idx]);
107 is_vec.push_back(is);
112 for (
auto i = 1;
i < is_vec.size(); ++
i) {
114 CHKERR ISExpand(is_a00, is_vec[
i], &is_union_raw);
115 is_a00 = SmartPetscObj<IS>(is_union_raw);
123 CHKERR KSPSetFromOptions(solver);
124 CHKERR KSPGetPC(solver, &pc);
125 PetscBool is_pcfs = PETSC_FALSE;
126 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
129 SmartPetscObj<DM> schur_dm, a00_dm;
130 CHKERR create_schur_dm(schur_dm);
136 "Is expected that schur matrix is not allocated. This is "
137 "possible only is PC is set up twice");
142 auto set_ops = [&]() {
144 auto range_ptr = boost::make_shared<Range>(get_ents_by_dim(
SPACE_DIM));
145 std::vector<boost::shared_ptr<Range>> ranges_list(schur_field_list.size(),
147 ranges_list.back() = range_ptr;
148 std::vector<SmartPetscObj<AO>> ao_list(schur_field_list.size(),
149 SmartPetscObj<AO>());
150 std::vector<SmartPetscObj<Mat>> mat_list(schur_field_list.size(),
151 SmartPetscObj<Mat>());
152 std::vector<bool> symm_list(schur_field_list.size(),
false);
156 ao_list.back() =
aoUp;
159 const bool symmetric_system =
162 epCorePtr->elasticFeLhs->getOpPtrVector().push_front(
163 new OpSchurAssembleBegin());
164 epCorePtr->elasticFeLhs->getOpPtrVector().push_back(
165 new OpSchurAssembleEnd<SCHUR_DGESV>(schur_field_list, ranges_list,
166 ao_list, mat_list, symm_list,
168 epCorePtr->elasticBcLhs->getOpPtrVector().push_front(
169 new OpSchurAssembleBegin());
170 epCorePtr->elasticBcLhs->getOpPtrVector().push_back(
171 new OpSchurAssembleEnd<SCHUR_DGESV>(schur_field_list, ranges_list,
172 ao_list, mat_list, symm_list,
178 auto set_pc = [&]() {
181 CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER,
S);
189 epCorePtr->elasticFeLhs->getOpPtrVector().push_front(
190 new OpSchurAssembleBegin());
191 epCorePtr->elasticFeLhs->getOpPtrVector().push_back(
192 new OpSchurAssembleEnd<SCHUR_DGESV>({}, {}, {}, {}, {}));
193 epCorePtr->elasticBcLhs->getOpPtrVector().push_front(
194 new OpSchurAssembleBegin());
195 epCorePtr->elasticBcLhs->getOpPtrVector().push_back(
196 new OpSchurAssembleEnd<SCHUR_DGESV>({}, {}, {}, {}, {}));
◆ setUp() [2/7]
◆ setUp() [3/7]
Implements SetUpSchur.
- Examples
- plastic.cpp, and test_broken_space.cpp.
Definition at line 525 of file test_broken_space.cpp.
530 CHKERR KSPSetFromOptions(ksp);
532 CHKERR KSPGetPC(ksp, &pc);
534 PetscBool is_pcfs = PETSC_FALSE;
535 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
538 MOFEM_LOG(
"AT", Sev::inform) <<
"Setup Schur pc";
540 auto create_sub_dm = [&]() {
543 auto create_dm = [&](
545 std::string problem_name,
546 std::vector<std::string> fe_names,
547 std::vector<std::string> fields,
553 auto create_dm_imp = [&]() {
557 for (
auto fe : fe_names) {
561 for (
auto field : fields) {
570 "Error in creating schurDM. It is possible that schurDM is "
575 auto schur_dm = create_dm(
579 {
simple->getDomainFEName(),
simple->getSkeletonFEName()},
585 auto block_dm = create_dm(
589 {
simple->getDomainFEName(),
simple->getSkeletonFEName()},
595 return std::make_tuple(schur_dm, block_dm);
598 auto get_nested_mat_data = [&](
auto schur_dm,
auto block_dm) {
606 simple->getDomainFEName(),
610 {
"BROKEN",
"BROKEN"},
621 simple->getSkeletonFEName(),
625 {
"BROKEN",
"HYBRID"}, {
"HYBRID",
"BROKEN"}
637 {schur_dm, block_dm}, block_mat_data,
639 {
"BROKEN",
"U"}, {
nullptr,
nullptr}, true
644 auto set_ops = [&](
auto schur_dm) {
649 boost::shared_ptr<BlockStructure> block_data;
652 pip_mng->getOpDomainLhsPipeline().push_front(
654 pip_mng->getOpDomainLhsPipeline().push_back(
662 auto pre_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
663 auto post_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
665 pre_proc_schur_lhs_ptr->preProcessHook = [
this]() {
668 MOFEM_LOG(
"AT", Sev::verbose) <<
"Lhs Assemble Begin";
672 post_proc_schur_lhs_ptr->postProcessHook = [
this, ao_up,
673 post_proc_schur_lhs_ptr]() {
675 MOFEM_LOG(
"AT", Sev::verbose) <<
"Lhs Assemble End";
676 CHKERR MatAssemblyBegin(
S, MAT_FINAL_ASSEMBLY);
677 CHKERR MatAssemblyEnd(
S, MAT_FINAL_ASSEMBLY);
678 MOFEM_LOG(
"AT", Sev::verbose) <<
"Lhs Assemble Finish";
683 ksp_ctx_ptr->getPreProcSetOperators().push_front(pre_proc_schur_lhs_ptr);
684 ksp_ctx_ptr->getPostProcSetOperators().push_back(post_proc_schur_lhs_ptr);
689 auto set_pc = [&](
auto pc,
auto block_dm) {
691 auto block_is =
getDMSubData(block_dm)->getSmartRowIs();
692 CHKERR PCFieldSplitSetIS(pc, NULL, block_is);
693 CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER,
S);
697 auto set_diagonal_pc = [&](
auto pc,
auto schur_dm) {
705 CHKERR PCFieldSplitSchurGetSubKSP(pc, PETSC_NULL, &subksp);
706 auto get_pc = [](
auto ksp) {
708 CHKERR KSPGetPC(ksp, &pc_raw);
713 auto set_pc_p_mg = [&](
auto dm,
auto pc) {
717 PetscBool same = PETSC_FALSE;
718 PetscObjectTypeCompare((PetscObject)pc, PCMG, &same);
723 CHKERR PCSetFromOptions(pc);
728 CHKERR set_pc_p_mg(schur_dm, get_pc(subksp[1]));
734 auto [schur_dm, block_dm] = create_sub_dm();
735 auto nested_mat_data = get_nested_mat_data(schur_dm, block_dm);
738 CHKERR MatSetDM(
S, PETSC_NULL);
744 CHKERR set_pc(pc, block_dm);
746 CHKERR KSPGetDM(ksp, &solver_dm);
747 CHKERR DMSetMatType(solver_dm, MATSHELL);
750 CHKERR set_diagonal_pc(pc, schur_dm);
754 "PC is not set to PCFIELDSPLIT");
◆ setUp() [4/7]
◆ setUp() [5/7]
Implements SetUpSchur.
Definition at line 979 of file contact.cpp.
985 CHKERR TSGetSNES(solver, &snes);
987 CHKERR SNESGetKSP(snes, &ksp);
988 CHKERR KSPSetFromOptions(ksp);
991 CHKERR KSPGetPC(ksp, &pc);
993 PetscBool is_pcfs = PETSC_FALSE;
994 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
997 MOFEM_LOG(
"CONTACT", Sev::inform) <<
"Setup Schur pc";
1002 "It is expected that Schur matrix is not allocated. This is "
1003 "possible only if PC is set up twice");
1015 CHKERR TSGetDM(solver, &solver_dm);
1016 CHKERR DMSetMatType(solver_dm, MATSHELL);
1023 auto swap_assemble = [](TS ts, PetscReal
t,
Vec u,
Vec u_t, PetscReal
a,
1024 Mat
A, Mat B,
void *ctx) {
1027 CHKERR TSSetIJacobian(solver,
A,
P, swap_assemble, ts_ctx_ptr.get());
1029 auto swap_assemble = [](TS ts, PetscReal
t,
Vec u,
Vec u_t,
Vec utt,
1030 PetscReal
a, PetscReal aa, Mat
A, Mat B,
1034 CHKERR TSSetI2Jacobian(solver,
A,
P, swap_assemble, ts_ctx_ptr.get());
1045 MOFEM_LOG(
"CONTACT", Sev::inform) <<
"No Schur PC";
1047 pip->getOpBoundaryLhsPipeline().push_back(
1050 pip->getOpDomainLhsPipeline().push_back(
◆ setUp() [6/7]
◆ setUp() [7/7]
Implements SetUpSchur.
Definition at line 1311 of file plastic.cpp.
1317 CHKERR TSGetSNES(solver, &snes);
1319 CHKERR SNESGetKSP(snes, &ksp);
1320 CHKERR KSPSetFromOptions(ksp);
1323 CHKERR KSPSetFromOptions(ksp);
1324 CHKERR KSPGetPC(ksp, &pc);
1325 PetscBool is_pcfs = PETSC_FALSE;
1326 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
1331 "Is expected that schur matrix is not allocated. This is "
1332 "possible only is PC is set up twice");
1340 CHKERR TSGetDM(solver, &solver_dm);
1341 CHKERR DMSetMatType(solver_dm, MATSHELL);
1348 auto swap_assemble = [](TS ts, PetscReal
t,
Vec u,
Vec u_t, PetscReal
a,
1349 Mat
A, Mat B,
void *ctx) {
1352 CHKERR TSSetIJacobian(solver,
A,
P, swap_assemble, ts_ctx_ptr.get());
1354 auto swap_assemble = [](TS ts, PetscReal
t,
Vec u,
Vec u_t,
Vec utt,
1355 PetscReal
a, PetscReal aa, Mat
A, Mat B,
1359 CHKERR TSSetI2Jacobian(solver,
A,
P, swap_assemble, ts_ctx_ptr.get());
1363 auto set_ops = [&]() {
1367 boost::shared_ptr<BlockStructure> block_data;
1372 pip_mng->getOpBoundaryLhsPipeline().push_front(
1381 pip_mng->getOpDomainLhsPipeline().push_front(
1391 double eps_stab = 1e-4;
1397 using OpMassStab = B::OpMass<3, SPACE_DIM * SPACE_DIM>;
1400 pip_mng->getOpBoundaryLhsPipeline().push_front(
1402 pip_mng->getOpBoundaryLhsPipeline().push_back(
1403 new OpMassStab(
"SIGMA",
"SIGMA", [eps_stab](
double,
double,
double) {
1408 {
"SIGMA",
"EP",
"TAU"}, {
nullptr,
nullptr,
nullptr},
1411 {
false,
false,
false},
false, block_data
1415 pip_mng->getOpDomainLhsPipeline().push_front(
1419 {
"SIGMA",
"EP",
"TAU"}, {
nullptr,
nullptr,
nullptr},
1422 {
false,
false,
false},
false, block_data
1425 #endif // ADD_CONTACT
1429 auto set_assemble_elems = [&]() {
1431 auto schur_asmb_pre_proc = boost::make_shared<FEMethod>();
1432 schur_asmb_pre_proc->preProcessHook = [
this]() {
1435 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"Lhs Assemble Begin";
1438 auto schur_asmb_post_proc = boost::make_shared<FEMethod>();
1440 schur_asmb_post_proc->postProcessHook = [
this, schur_asmb_post_proc]() {
1442 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"Lhs Assemble End";
1445 CHKERR MatAssemblyBegin(
S, MAT_FINAL_ASSEMBLY);
1446 CHKERR MatAssemblyEnd(
S, MAT_FINAL_ASSEMBLY);
1453 ts_ctx_ptr->getPreProcessIJacobian().push_front(schur_asmb_pre_proc);
1454 ts_ctx_ptr->getPostProcessIJacobian().push_front(schur_asmb_post_proc);
1458 auto set_pc = [&]() {
1461 CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER,
S);
1465 auto set_diagonal_pc = [&]() {
1468 CHKERR PCFieldSplitSchurGetSubKSP(pc, PETSC_NULL, &subksp);
1469 auto get_pc = [](
auto ksp) {
1471 CHKERR KSPGetPC(ksp, &pc_raw);
1475 CHKERR PetscFree(subksp);
1481 CHKERR set_assemble_elems();
1485 CHKERR set_diagonal_pc();
1488 pip_mng->getOpBoundaryLhsPipeline().push_front(
1490 pip_mng->getOpBoundaryLhsPipeline().push_back(
1493 pip_mng->getOpDomainLhsPipeline().push_back(
◆ aoSchur
◆ aoUp
SmartPetscObj< AO > SetUpSchurImpl::aoUp |
|
private |
◆ blockDM
◆ epCorePtr
EshelbianCore* SetUpSchurImpl::epCorePtr |
|
private |
◆ fieldSplitIS
◆ isA00
SmartPetscObj<IS> SetUpSchurImpl::isA00 |
|
private |
◆ isShift
SmartPetscObj<IS> SetUpSchurImpl::isShift |
|
private |
SmartPetscObj<Mat> SetUpSchurImpl::M |
|
private |
◆ mField
SmartPetscObj<Mat> SetUpSchurImpl::P |
|
private |
◆ schurDM
◆ subDM
◆ subEnts
Range SetUpSchurImpl::subEnts |
|
private |
◆ volEnts
Range SetUpSchurImpl::volEnts |
|
private |
The documentation for this struct was generated from the following files:
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
MoFEMErrorCode DMMoFEMGetBlocMatData(DM dm, boost::shared_ptr< BlockStructure > &)
Get data for block mat.
SmartPetscObj< IS > fieldSplitIS
IS for split Schur block.
auto createAOMappingIS(IS isapp, IS ispetsc)
Creates an application mapping using two index sets.
PetscErrorCode DMMoFEMAddSubFieldCol(DM dm, const char field_name[])
SmartPetscObj< AO > aoSchur
Specialization for DisplacementCubitBcData.
virtual MPI_Comm & get_comm() const =0
EshelbianCore * epCorePtr
boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx > createPCMGSetUpViaApproxOrdersCtx(DM dm, Mat A, bool use_shell_mat)
createPCMGSetUpViaApproxOrdersCtx
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
PetscErrorCode DMMoFEMSetSquareProblem(DM dm, PetscBool square_problem)
set squared problem
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
SmartPetscObj< IS > isA00
MoFEMErrorCode setPC(PC pc)
PipelineManager interface.
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.
Simple interface for fast problem set-up.
auto getDMSubData(DM dm)
Get sub problem data structure.
SmartPetscObj< DM > schurDM
MoFEMErrorCode createSubDM()
SmartPetscObj< DM > subDM
field split sub dm
auto createDMMatrix(DM dm)
Get smart matrix from DM.
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
auto createDMBlockMat(DM dm)
SmartPetscObj< DM > blockDM
#define CHKERR
Inline error check.
OpSchurAssembleBase * createOpSchurAssembleEnd(std::vector< std::string > fields_name, std::vector< boost::shared_ptr< Range >> field_ents, std::vector< SmartPetscObj< AO >> sequence_of_aos, std::vector< SmartPetscObj< Mat >> sequence_of_mats, std::vector< bool > sym_schur, bool symm_op, boost::shared_ptr< BlockStructure > diag_blocks)
Construct a new Op Schur Assemble End object.
virtual moab::Interface & get_moab()=0
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
auto createDMHybridisedL2Matrix(DM dm)
Get smart hybridised L2 matrix from DM.
PetscBool is_quasi_static
void simple(double P1[], double P2[], double P3[], double c[], const int N)
#define NBEDGE_L2(P)
Number of base functions on edge fro L2 space.
PetscErrorCode DMMoFEMCreateSubDM(DM subdm, DM dm, const char problem_name[])
Must be called by user to set Sub DM MoFEM data structures.
MoFEM::Interface & mField
OpSchurAssembleBase * createOpSchurAssembleBegin()
auto createDMNestSchurMat(DM dm)
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.
constexpr int SPACE_DIM
[Define dimension]
MoFEMErrorCode setOperator()
constexpr double t
plate stiffness
FTensor::Index< 'i', SPACE_DIM > i
constexpr auto field_name
MoFEMErrorCode setSchurMatSolvePC(SmartPetscObj< PC > pc)
MoFEMErrorCode setSchurA00MatSolvePC(SmartPetscObj< PC > pc)
Set PC for A00 block.
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
#define MOFEM_LOG(channel, severity)
Log.
#define NBFACETRI_L2(P)
Number of base functions on triangle for L2 space.
const FTensor::Tensor2< T, Dim, Dim > Vec
@ MOFEM_DATA_INCONSISTENCY
FTensor::Index< 'm', 3 > m
@ MOFEM_ATOM_TEST_INVALID
MoFEMErrorCode DMMoFEMSetNestSchurData(DM dm, boost::shared_ptr< NestSchurData >)
boost::shared_ptr< BlockStructure > createBlockMatStructure(DM dm, SchurFEOpsFEandFields schur_fe_op_vec)
Create a Mat Diag Blocks object.
MoFEMErrorCode PCMGSetUpViaApproxOrders(PC pc, boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx > ctx, int verb)
Function build MG structure.
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[])
intrusive_ptr for managing petsc objects
MoFEMErrorCode setDiagonalPC(PC pc)
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
boost::shared_ptr< NestSchurData > getNestSchurData(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.
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)