22 ? AssemblyType::BLOCK_SCHUR
26 IntegrationType::GAUSS;
129 enum bases { AINSWORTH, DEMKOWICZ, LASBASETOPT };
130 const char *list_bases[LASBASETOPT] = {
"ainsworth",
"demkowicz"};
131 PetscInt choice_base_value = AINSWORTH;
133 LASBASETOPT, &choice_base_value, PETSC_NULLPTR);
136 switch (choice_base_value) {
140 <<
"Set AINSWORTH_LEGENDRE_BASE for displacements";
145 <<
"Set DEMKOWICZ_JACOBI_BASE for displacements";
164 auto project_ho_geometry = [&]() {
168 CHKERR project_ho_geometry();
183 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_X",
185 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Y",
187 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Z",
189 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
190 "REMOVE_ALL",
"U", 0, 3);
192 simple->getProblemName(),
"U");
208 auto integration_rule_bc = [](int, int,
int approx_order) {
214 CHKERR pip->setBoundaryRhsIntegrationRule(integration_rule_bc);
215 CHKERR pip->setBoundaryLhsIntegrationRule(integration_rule_bc);
219 pip->getOpDomainLhsPipeline(), {H1},
"GEOMETRY");
221 pip->getOpDomainRhsPipeline(), {H1},
"GEOMETRY");
223 pip->getOpBoundaryRhsPipeline(), {NOSPACE},
"GEOMETRY");
225 pip->getOpBoundaryLhsPipeline(), {NOSPACE},
"GEOMETRY");
230 mField, pip->getOpDomainLhsPipeline(),
"U",
"MAT_ELASTIC", Sev::verbose);
235 mField, pip->getOpDomainRhsPipeline(),
"U",
"MAT_ELASTIC", Sev::verbose);
239 pip->getOpDomainRhsPipeline(),
mField,
"U", Sev::inform);
245 pip->getOpBoundaryRhsPipeline(),
mField,
"U", -1, Sev::inform);
248 pip->getOpBoundaryLhsPipeline(),
mField,
"U", Sev::verbose);
255 static boost::shared_ptr<SetUpSchur>
268 auto solver = pip->createKSP();
269 CHKERR KSPSetFromOptions(solver);
271 auto dm =
simple->getDM();
275 auto set_essential_bc = [&]() {
280 auto pre_proc_rhs = boost::make_shared<FEMethod>();
281 auto post_proc_rhs = boost::make_shared<FEMethod>();
282 auto post_proc_lhs = boost::make_shared<FEMethod>();
284 auto get_pre_proc_hook = [&]() {
288 pre_proc_rhs->preProcessHook = get_pre_proc_hook();
290 auto get_post_proc_hook_rhs = [
this, post_proc_rhs]() {
294 post_proc_rhs, 1.)();
298 auto get_post_proc_hook_lhs = [
this, post_proc_lhs]() {
302 post_proc_lhs, 1.)();
306 post_proc_rhs->postProcessHook = get_post_proc_hook_rhs;
307 post_proc_lhs->postProcessHook = get_post_proc_hook_lhs;
309 ksp_ctx_ptr->getPreProcComputeRhs().push_front(pre_proc_rhs);
310 ksp_ctx_ptr->getPostProcComputeRhs().push_back(post_proc_rhs);
311 ksp_ctx_ptr->getPostProcSetOperators().push_back(post_proc_lhs);
315 auto setup_and_solve = [&]() {
317 BOOST_LOG_SCOPED_THREAD_ATTR(
"Timeline", attrs::timer());
318 MOFEM_LOG(
"TIMER", Sev::inform) <<
"KSPSetUp";
320 MOFEM_LOG(
"TIMER", Sev::inform) <<
"KSPSetUp <= Done";
321 MOFEM_LOG(
"TIMER", Sev::inform) <<
"KSPSolve";
323 MOFEM_LOG(
"TIMER", Sev::inform) <<
"KSPSolve <= Done";
330 CHKERR set_essential_bc();
332 if (A == AssemblyType::BLOCK_SCHUR || A == AssemblyType::SCHUR) {
334 CHKERR schur_ptr->setUp(solver);
340 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
341 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
344 auto evaluate_field_at_the_point = [&]() {
348 std::array<double, 3> field_eval_coords{0.0, 0.0, 0.0};
351 field_eval_coords.data(), &coords_dim,
357 auto field_eval_data =
361 ->buildTree<SPACE_DIM>(field_eval_data,
simple->getDomainFEName());
363 field_eval_data->setEvalPoints(field_eval_coords.data(), 1);
364 auto no_rule = [](int, int, int) {
return -1; };
365 auto field_eval_fe_ptr = field_eval_data->feMethodPtr.lock();
366 field_eval_fe_ptr->getRuleHook = no_rule;
368 field_eval_fe_ptr->getOpPtrVector().push_back(
372 ->evalFEAtThePoint<SPACE_DIM>(
373 field_eval_coords.data(), 1e-12,
simple->getProblemName(),
374 simple->getDomainFEName(), field_eval_data,
382 <<
"U_X: " << t_disp(0) <<
" U_Y: " << t_disp(1);
385 <<
"U_X: " << t_disp(0) <<
" U_Y: " << t_disp(1)
386 <<
" U_Z: " << t_disp(2);
394 CHKERR evaluate_field_at_the_point();
405 auto det_ptr = boost::make_shared<VectorDouble>();
406 auto jac_ptr = boost::make_shared<MatrixDouble>();
407 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
409 pip->getDomainRhsFE().reset();
410 pip->getDomainLhsFE().reset();
411 pip->getBoundaryRhsFE().reset();
412 pip->getBoundaryLhsFE().reset();
416 auto post_proc_mesh = boost::make_shared<moab::Core>();
417 auto post_proc_begin = boost::make_shared<PostProcBrokenMeshInMoabBaseBegin>(
419 auto post_proc_end = boost::make_shared<PostProcBrokenMeshInMoabBaseEnd>(
424 auto calculate_stress_ops = [&](
auto &pip) {
430 mField, pip,
"U",
"MAT_ELASTIC", Sev::verbose);
433 auto u_ptr = boost::make_shared<MatrixDouble>();
435 auto x_ptr = boost::make_shared<MatrixDouble>();
440 return boost::make_tuple(u_ptr, x_ptr, common_ptr->getMatStrain(),
441 common_ptr->getMatCauchyStress());
444 auto get_tag_id_on_pmesh = [&](
bool post_proc_skin) {
448 "MAT_ELASTIC", 1, MB_TYPE_INTEGER, tag_mat,
449 MB_TAG_CREAT | MB_TAG_SPARSE, &def_val_int);
450 auto meshset_vec_ptr =
452 std::regex((boost::format(
"%s(.*)") %
"MAT_ELASTIC").str()));
455 std::unique_ptr<Skinner> skin_ptr;
456 if (post_proc_skin) {
458 auto boundary_meshset =
simple->getBoundaryMeshSet();
463 for (
auto m : meshset_vec_ptr) {
467 int const id =
m->getMeshsetId();
468 ents_3d = ents_3d.subset_by_dimension(
SPACE_DIM);
469 if (post_proc_skin) {
471 CHKERR skin_ptr->find_skin(0, ents_3d,
false, skin_faces);
472 ents_3d = intersect(skin_ents, skin_faces);
480 auto post_proc_domain = [&](
auto post_proc_mesh) {
482 boost::make_shared<PostProcEleDomain>(
mField, post_proc_mesh);
485 auto [u_ptr, x_ptr, mat_strain_ptr, mat_stress_ptr] =
486 calculate_stress_ops(post_proc_fe->getOpPtrVector());
488 post_proc_fe->getOpPtrVector().push_back(
492 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
496 {{
"U", u_ptr}, {
"GEOMETRY", x_ptr}},
500 {{
"STRAIN", mat_strain_ptr}, {
"STRESS", mat_stress_ptr}}
506 post_proc_fe->setTagsToTransfer({get_tag_id_on_pmesh(
false)});
510 auto post_proc_boundary = [&](
auto post_proc_mesh) {
512 boost::make_shared<PostProcEleBdy>(mField, post_proc_mesh);
514 post_proc_fe->getOpPtrVector(), {},
"GEOMETRY");
518 auto [u_ptr, x_ptr, mat_strain_ptr, mat_stress_ptr] =
519 calculate_stress_ops(op_loop_side->getOpPtrVector());
520 post_proc_fe->getOpPtrVector().push_back(op_loop_side);
521 auto mat_traction_ptr = boost::make_shared<MatrixDouble>();
522 post_proc_fe->getOpPtrVector().push_back(
528 post_proc_fe->getOpPtrVector().push_back(
532 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
536 {{
"U", u_ptr}, {
"GEOMETRY", x_ptr}, {
"T", mat_traction_ptr}},
540 {{
"STRAIN", mat_strain_ptr}, {
"STRESS", mat_stress_ptr}}
546 post_proc_fe->setTagsToTransfer({get_tag_id_on_pmesh(
true)});
550 PetscBool post_proc_skin_only = PETSC_FALSE;
552 post_proc_skin_only = PETSC_TRUE;
554 &post_proc_skin_only, PETSC_NULLPTR);
556 if (post_proc_skin_only == PETSC_FALSE) {
557 pip->getDomainRhsFE() = post_proc_domain(post_proc_mesh);
559 pip->getBoundaryRhsFE() = post_proc_boundary(post_proc_mesh);
563 post_proc_begin->getFEMethod());
564 CHKERR pip->loopFiniteElements();
566 post_proc_end->getFEMethod());
568 CHKERR post_proc_end->writeFile(
"out_elastic.h5m");
579 pip->getDomainRhsFE().reset();
580 pip->getDomainLhsFE().reset();
581 pip->getBoundaryRhsFE().reset();
582 pip->getBoundaryLhsFE().reset();
584 auto integration_rule = [](int, int,
int p_data) {
return 2 * p_data + 1; };
589 pip->getOpDomainRhsPipeline(), {H1},
"GEOMETRY");
591 pip->getOpBoundaryRhsPipeline(), {},
"GEOMETRY");
595 mField, pip->getOpDomainRhsPipeline(),
"U",
"MAT_ELASTIC", Sev::verbose);
598 pip->getOpDomainRhsPipeline(),
mField,
"U", Sev::verbose);
601 pip->getOpBoundaryRhsPipeline(),
mField,
"U", -1, Sev::verbose);
603 auto dm =
simple->getDM();
605 CHKERR VecSetDM(res, PETSC_NULLPTR);
607 pip->getDomainRhsFE()->f = res;
608 pip->getBoundaryRhsFE()->f = res;
610 CHKERR VecZeroEntries(res);
612 CHKERR pip->loopFiniteElements();
615 CHKERR VecGhostUpdateBegin(res, ADD_VALUES, SCATTER_REVERSE);
616 CHKERR VecGhostUpdateEnd(res, ADD_VALUES, SCATTER_REVERSE);
617 CHKERR VecAssemblyBegin(res);
618 CHKERR VecAssemblyEnd(res);
620 auto zero_residual_at_constrains = [&]() {
622 auto fe_post_proc_ptr = boost::make_shared<FEMethod>();
623 auto get_post_proc_hook_rhs = [&]() {
626 mField, fe_post_proc_ptr, res)();
628 mField, fe_post_proc_ptr, 0, res)();
631 fe_post_proc_ptr->postProcessHook = get_post_proc_hook_rhs;
636 CHKERR zero_residual_at_constrains();
639 CHKERR VecNorm(res, NORM_2, &nrm2);
641 MOFEM_LOG_C(
"WORLD", Sev::inform,
"residual = %3.4e\n", nrm2);
646 auto post_proc_residual = [&](
auto dm,
auto f_res,
auto out_name) {
649 boost::make_shared<PostProcBrokenMeshInMoab<DomainEle>>(
mField);
651 auto u_vec = boost::make_shared<MatrixDouble>();
652 post_proc_fe->getOpPtrVector().push_back(
654 post_proc_fe->getOpPtrVector().push_back(
658 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
670 post_proc_fe->writeFile(out_name);
674 CHKERR post_proc_residual(
simple->getDM(), res,
"res.h5m");
676 constexpr double eps = 1e-8;
679 "Residual is not zero");
682 if (!vectorFieldPtr || vectorFieldPtr->size1() == 0) {
684 "atom test %d failed: Field Evaluator did not provide result",
688 double Ux_ref = 0.46;
689 double Uy_ref = -0.015;
690 constexpr double eps = 1e-8;
691 if (fabs(t_disp(0) - Ux_ref) >
eps || fabs(t_disp(1) - Uy_ref) >
eps) {
693 "atom test %d failed: Ux_ref = %3.6e, computed = %3.6e, Uy_ref "
695 test, Ux_ref, t_disp(0), Uy_ref);
704int main(
int argc,
char *argv[]) {
707 const char param_file[] =
"param_file.petsc";
710 auto core_log = logging::core::get();
722 DMType dm_name =
"DMMOFEM";
724 DMType dm_name_mg =
"DMMOFEM_MG";
729 moab::Core mb_instance;
730 moab::Interface &moab = mb_instance;
754 "Is expected that schur matrix is not allocated. This is "
755 "possible only is PC is set up twice");
783 CHKERR KSPGetPC(solver, &pc);
784 PetscBool is_pcfs = PETSC_FALSE;
785 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
790 "Is expected that schur matrix is not allocated. This is "
791 "possible only is PC is set up twice");
798 CHKERR MatSetDM(
S, PETSC_NULLPTR);
800 CHKERR MatSetOption(
S, MAT_SYMMETRIC, PETSC_TRUE);
805 if constexpr (A == AssemblyType::BLOCK_SCHUR) {
808 CHKERR KSPGetDM(solver, &solver_dm);
809 CHKERR DMSetMatType(solver_dm, MATSHELL);
838 auto create_dm = [&](
const char *name,
auto &ents,
auto dm_type) {
840 auto create_dm_imp = [&]() {
845 auto sub_ents_ptr = boost::make_shared<Range>(ents);
853 "Error in creating schurDM. It is possible that schurDM is "
861 if constexpr (A == AssemblyType::BLOCK_SCHUR) {
863 auto get_nested_mat_data = [&]() -> boost::shared_ptr<NestSchurData> {
864 auto block_mat_data =
869 simple->getDomainFEName(),
881 {
"U"}, {boost::make_shared<Range>(
volEnts)}
886 auto nested_mat_data = get_nested_mat_data();
904 {
"U"}, {boost::make_shared<Range>(
volEnts)}, ao_up,
S,
true,
true));
908 {
"U"}, {boost::make_shared<Range>(
volEnts)}, ao_up,
S,
true,
true));
910 auto pre_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
911 auto post_proc_schur_lhs_ptr = boost::make_shared<FEMethod>();
913 pre_proc_schur_lhs_ptr->preProcessHook = [
this]() {
918 MOFEM_LOG(
"TIMER", Sev::inform) <<
"Lhs Assemble Begin";
922 post_proc_schur_lhs_ptr->postProcessHook = [
this, post_proc_schur_lhs_ptr,
925 CHKERR MatAssemblyBegin(
S, MAT_FINAL_ASSEMBLY);
926 CHKERR MatAssemblyEnd(
S, MAT_FINAL_ASSEMBLY);
928 mField, post_proc_schur_lhs_ptr, 1,
S, ao_up)();
929 MOFEM_LOG(
"TIMER", Sev::inform) <<
"Lhs Assemble End";
934 ksp_ctx_ptr->getPreProcSetOperators().push_front(pre_proc_schur_lhs_ptr);
935 ksp_ctx_ptr->getPostProcSetOperators().push_back(post_proc_schur_lhs_ptr);
946 CHKERR PCFieldSplitSetIS(pc, NULL, vol_is);
947 CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER,
S);
954 auto get_pc = [](
auto ksp) {
956 CHKERR KSPGetPC(ksp, &pc_raw);
960 if constexpr (A == AssemblyType::BLOCK_SCHUR) {
964 CHKERR PCSetOperators(pc, A, P);
967 CHKERR PCFieldSplitSchurGetSubKSP(pc, PETSC_NULLPTR, &subksp);
970 auto set_pc_p_mg = [](
auto dm,
auto pc,
auto S) {
973 PetscBool same = PETSC_FALSE;
974 PetscObjectTypeCompare((PetscObject)pc, PCMG, &same);
976 MOFEM_LOG(
"TIMER", Sev::inform) <<
"Set up MG";
979 CHKERR PCSetFromOptions(pc);
984 auto set_pc_ksp = [&](
auto dm,
auto pc,
auto S) {
986 PetscBool same = PETSC_FALSE;
987 PetscObjectTypeCompare((PetscObject)pc, PCKSP, &same);
989 MOFEM_LOG(
"TIMER", Sev::inform) <<
"Set up inner KSP for PCKSP";
990 CHKERR PCSetFromOptions(pc);
992 CHKERR PCKSPGetKSP(pc, &inner_ksp);
993 CHKERR KSPSetFromOptions(inner_ksp);
995 CHKERR KSPGetPC(inner_ksp, &inner_pc);
996 CHKERR PCSetFromOptions(inner_pc);
997 CHKERR set_pc_p_mg(dm, inner_pc,
S);
1005 CHKERR PetscFree(subksp);
1010boost::shared_ptr<SetUpSchur>
1012 return boost::shared_ptr<SetUpSchur>(
new SetUpSchurImpl(m_field));
Calculate traction for linear problem.
Implementation of elastic spring bc.
Natural boundary condition applying pressure from fluid.
Implementation of Hookes operator Hookes for linear elastic problems in MoFEM.
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
#define MOFEM_LOG_C(channel, severity, format,...)
Implementation of natural boundary conditions.
Boundary conditions in domain, i.e. body forces.
void simple(double P1[], double P2[], double P3[], double c[], const int N)
PetscBool is_plane_strain
constexpr int SPACE_DIM
[Define dimension]
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
[Define dimension]
#define CATCH_ERRORS
Catch errors.
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PostProcEleByDim< SPACE_DIM >::PostProcEleDomain PostProcEleDomain
PostProcEleByDim< SPACE_DIM >::PostProcEleBdy PostProcEleBdy
static char help[]
[Check]
PetscBool is_plane_strain
constexpr int SPACE_DIM
[Define dimension]
constexpr double poisson_ratio
constexpr double shear_modulus_G
constexpr IntegrationType I
constexpr double bulk_modulus_K
constexpr double young_modulus
PetscErrorCode DMMoFEMCreateSubDM(DM subdm, DM dm, const char problem_name[])
Must be called by user to set Sub DM MoFEM data structures.
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
PetscErrorCode DMMoFEMSetSquareProblem(DM dm, PetscBool square_problem)
set squared problem
PetscErrorCode DMoFEMPostProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[])
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
MoFEMErrorCode DMRegister_MGViaApproxOrders(const char sname[])
Register DM for Multi-Grid via approximation orders.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
auto createDMVector(DM dm)
Get smart vector from DM.
PetscErrorCode DMMoFEMAddSubFieldCol(DM dm, const char field_name[])
auto createDMMatrix(DM dm)
Get smart matrix from DM.
PetscErrorCode DMoFEMPreProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
MoFEMErrorCode opFactoryDomainLhs(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, boost::shared_ptr< HookeOps::CommonData > common_ptr, Sev sev)
Assemble domain LHS K factory (LHS first overload) Initializes and pushes operators to assemble the L...
auto commonDataFactory(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, std::string block_name, Sev sev, double scale=1)
MoFEMErrorCode opFactoryDomainRhs(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, boost::shared_ptr< HookeOps::CommonData > common_ptr, Sev sev, bool is_non_linear=false)
Factory function to create and push internal force operators for the domain RHS. (RHS first overload)...
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
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.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
MoFEMErrorCode setSchurA00MatSolvePC(SmartPetscObj< PC > pc)
Set PC for A00 block.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx > createPCMGSetUpViaApproxOrdersCtx(DM dm, Mat A, bool use_shell_mat)
createPCMGSetUpViaApproxOrdersCtx
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
auto getDMSubData(DM dm)
Get sub problem data structure.
FTensor::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 1 (vector) form data matrix.
MoFEMErrorCode PCMGSetUpViaApproxOrders(PC pc, boost::shared_ptr< PCMGSetUpViaApproxOrdersCtx > ctx, int verb)
Function build MG structure.
boost::shared_ptr< BlockStructure > createBlockMatStructure(DM dm, SchurFEOpsFEandFields schur_fe_op_vec)
Create a Mat Diag Blocks object.
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.
auto createAOMappingIS(IS isapp, IS ispetsc)
Creates an application mapping using two index sets.
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
MoFEMErrorCode DMMoFEMSetNestSchurData(DM dm, boost::shared_ptr< NestSchurData >)
auto createDMNestSchurMat(DM dm)
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
OpSchurAssembleBase * createOpSchurAssembleBegin()
auto createDMBlockMat(DM dm)
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
#define EXECUTABLE_DIMENSION
PetscBool do_eval_field
Evaluate field.
ElementsAndOps< SPACE_DIM >::SideEle SideEle
static constexpr int approx_order
FTensor::Index< 'm', 3 > m
MoFEMErrorCode boundaryCondition()
MoFEMErrorCode assembleSystem()
MoFEMErrorCode readMesh()
FieldApproximationBase base
MoFEMErrorCode checkResults()
MoFEMErrorCode solveSystem()
Example(MoFEM::Interface &m_field)
MoFEMErrorCode runProblem()
MoFEM::Interface & mField
MoFEMErrorCode setupProblem()
MoFEMErrorCode outputResults()
boost::shared_ptr< MatrixDouble > vectorFieldPtr
Add operators pushing bases from local to physical configuration.
Simple interface for fast problem set-up.
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
Definition of the displacement bc data structure.
Data on single entity (This is passed as argument to DataOperator::doWork)
Class (Function) to enforce essential constrains on the left hand side diagonal.
Class (Function) to enforce essential constrains on the right hand side diagonal.
Class (Function) to calculate residual side diagonal.
Class (Function) to enforce essential constrains.
Field evaluator interface.
Section manager is used to create indexes and sections.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
Interface for managing meshsets containing materials and boundary conditions.
Get values at integration pts for tensor field rank 1, i.e. vector field.
Element used to execute operators on side of the element.
Post post-proc data at points from hash maps.
PipelineManager interface.
MoFEMErrorCode setDomainRhsIntegrationRule(RuleHookFun rule)
Projection of edge entities with one mid-node on hierarchical basis.
Simple interface for fast problem set-up.
MoFEMErrorCode getOptions()
get options
intrusive_ptr for managing petsc objects
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
PipelineManager::ElementsAndOpsByDim< 3 >::FaceSideEle SideEle
MoFEMErrorCode setUp(SmartPetscObj< KSP > solver)
virtual ~SetUpSchurImpl()=default
MoFEMErrorCode createSubDM()
MoFEMErrorCode setDiagonalPC(PC pc)
SetUpSchurImpl(MoFEM::Interface &m_field)
SmartPetscObj< DM > schurDM
MoFEMErrorCode setEntities()
MoFEMErrorCode setUp(SmartPetscObj< KSP >)
SmartPetscObj< DM > blockDM
MoFEMErrorCode setPC(PC pc)
MoFEMErrorCode setOperator()
MoFEM::Interface & mField
[Push operators to pipeline]
virtual MoFEMErrorCode setUp(SmartPetscObj< KSP > solver)=0
static boost::shared_ptr< SetUpSchur > createSetUpSchur(MoFEM::Interface &m_field)
static boost::shared_ptr< SetUpSchur > createSetUpSchur(MoFEM::Interface &m_field)