23 #ifndef EXECUTABLE_DIMENSION
24 #define EXECUTABLE_DIMENSION 3
31 using namespace MoFEM;
67 GAUSS>::OpSource<1, SPACE_DIM>;
72 GAUSS>::OpGradSymTensorGrad<1, SPACE_DIM, SPACE_DIM, 0>;
86 GAUSS>::OpGradTensorGrad<1, SPACE_DIM, SPACE_DIM, 1>;
115 GAUSS>::OpMixDivTimesScalar<SPACE_DIM>;
129 GAUSS>::OpBaseTimesVector<3, 3, 1>;
136 GAUSS>::OpMixDivTimesU<3, 1, 2>;
153 GAUSS>::OpSource<1, 1>;
223 boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
224 boost::shared_ptr<PostProcEle> postProcFe;
225 boost::shared_ptr<DomainEle> reactionFe;
226 boost::shared_ptr<DomainEle> feAxiatorRhs;
227 boost::shared_ptr<DomainEle> feAxiatorLhs;
235 boost::shared_ptr<std::vector<unsigned char>> boundaryMarker;
236 boost::shared_ptr<std::vector<unsigned char>> reactionMarker;
238 std::vector<FTensor::Tensor1<double, 3>> bodyForces;
242 double operator()(
const double,
const double,
const double) {
257 CHKERR createCommonData();
298 auto get_command_line_parameters = [&]() {
338 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Hardening " <<
H;
339 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Viscous hardening " <<
visH;
340 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Saturation yield stress " <<
Qinf;
341 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Saturation exponent " <<
b_iso;
346 PetscBool is_scale = PETSC_TRUE;
364 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Scaled Hardening " <<
H;
365 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Scaled Viscous hardening " <<
visH;
367 <<
"Scaled Saturation yield stress " <<
Qinf;
375 auto set_matrial_stiffness = [&]() {
391 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
392 *commonPlasticDataPtr->mDPtr);
393 auto t_D_axiator = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
394 *commonPlasticDataPtr->mDPtr_Axiator);
395 auto t_D_deviator = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
396 *commonPlasticDataPtr->mDPtr_Deviator);
398 constexpr
double third = boost::math::constants::third<double>();
399 t_D_axiator(
i,
j,
k,
l) =
A *
402 t_D_deviator(
i,
j,
k,
l) =
404 t_D(
i,
j,
k,
l) = t_D_axiator(
i,
j,
k,
l) + t_D_deviator(
i,
j,
k,
l);
409 commonPlasticDataPtr = boost::make_shared<PlasticThermalOps::CommonData>();
411 commonPlasticDataPtr->mDPtr = boost::make_shared<MatrixDouble>();
412 commonPlasticDataPtr->mDPtr->resize(size_symm * size_symm, 1);
413 commonPlasticDataPtr->mDPtr_Axiator = boost::make_shared<MatrixDouble>();
414 commonPlasticDataPtr->mDPtr_Axiator->resize(size_symm * size_symm, 1);
415 commonPlasticDataPtr->mDPtr_Deviator = boost::make_shared<MatrixDouble>();
416 commonPlasticDataPtr->mDPtr_Deviator->resize(size_symm * size_symm, 1);
418 commonPlasticDataPtr->mGradPtr = boost::make_shared<MatrixDouble>();
419 commonPlasticDataPtr->mStrainPtr = boost::make_shared<MatrixDouble>();
420 commonPlasticDataPtr->mStressPtr = boost::make_shared<MatrixDouble>();
422 CHKERR get_command_line_parameters();
423 CHKERR set_matrial_stiffness();
437 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_X",
439 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Y",
441 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Z",
443 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
444 "REMOVE_ALL",
"U", 0, 3);
445 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
446 "ZERO_FLUX",
"FLUX", 0, 1);
448 PetscBool zero_fix_skin_flux = PETSC_TRUE;
450 &zero_fix_skin_flux, PETSC_NULL);
451 if (zero_fix_skin_flux) {
453 CHKERR mField.get_moab().get_entities_by_dimension(0,
SPACE_DIM, faces);
454 Skinner skin(&mField.get_moab());
456 CHKERR skin.find_skin(0, faces,
false, skin_ents);
457 ParallelComm *pcomm =
461 "Communicator not created");
462 CHKERR pcomm->filter_pstatus(skin_ents,
463 PSTATUS_SHARED | PSTATUS_MULTISHARED,
464 PSTATUS_NOT, -1, &skin_ents);
465 CHKERR prb_mng->removeDofsOnEntities(
simple->getProblemName(),
"FLUX",
469 CHKERR bc_mng->pushMarkDOFsOnEntities(
simple->getProblemName(),
"FIX_X",
"U",
471 CHKERR bc_mng->pushMarkDOFsOnEntities(
simple->getProblemName(),
"FIX_Y",
"U",
473 CHKERR bc_mng->pushMarkDOFsOnEntities(
simple->getProblemName(),
"FIX_Z",
"U",
475 CHKERR bc_mng->pushMarkDOFsOnEntities(
simple->getProblemName(),
"FIX_ALL",
478 auto &bc_map = bc_mng->getBcMapByBlockName();
479 boundaryMarker = bc_mng->getMergedBlocksMarker(vector<string>{
"FIX_"});
481 CHKERR bc_mng->pushMarkDOFsOnEntities(
simple->getProblemName(),
"REACTION",
483 for (
auto b : bc_map) {
484 MOFEM_LOG(
"EXAMPLE", Sev::verbose) <<
"Marker " <<
b.first;
490 std::string reaction_block_set;
491 for (
auto bc : bc_map) {
492 if (bc_mng->checkBlock(bc,
"REACTION")) {
493 reaction_block_set = bc.first;
498 if (
auto bc = bc_mng->popMarkDOFsOnEntities(reaction_block_set)) {
499 reactionMarker = bc->getBcMarkersPtr();
503 CHKERR mField.get_moab().get_entities_by_type(0, MBVERTEX, nodes,
true);
505 ProblemsManager::MarkOP::AND, nodes,
509 MOFEM_LOG(
"EXAMPLE", Sev::warning) <<
"REACTION blockset does not exist";
512 if (!reactionMarker) {
513 MOFEM_LOG(
"EXAMPLE", Sev::warning) <<
"REACTION blockset does not exist";
527 auto integration_rule_deviator = [](
int o_row,
int o_col,
int approx_order) {
534 feAxiatorRhs = boost::make_shared<DomainEle>(mField);
535 feAxiatorLhs = boost::make_shared<DomainEle>(mField);
539 feAxiatorRhs->getRuleHook = integration_rule_axiator;
540 feAxiatorLhs->getRuleHook = integration_rule_axiator;
542 feThermalRhs = boost::make_shared<DomainEle>(mField);
543 feThermalLhs = boost::make_shared<DomainEle>(mField);
547 feThermalRhs->getRuleHook = integration_rule_thermal;
548 feThermalLhs->getRuleHook = integration_rule_thermal;
550 auto add_domain_base_ops = [&](
auto &pipeline) {
554 auto det_ptr = boost::make_shared<VectorDouble>();
555 auto jac_ptr = boost::make_shared<MatrixDouble>();
556 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
567 "TAU", commonPlasticDataPtr->getPlasticTauDotPtr()));
569 "EP", commonPlasticDataPtr->getPlasticStrainPtr()));
571 "EP", commonPlasticDataPtr->getPlasticStrainDotPtr()));
573 "U", commonPlasticDataPtr->mGradPtr));
575 "TAU", commonPlasticDataPtr->getPlasticTauPtr()));
578 "T", commonPlasticDataPtr->getTempValPtr()));
580 "T", commonPlasticDataPtr->getTempValDotPtr()));
582 "FLUX", commonPlasticDataPtr->getTempDivFluxPtr()));
584 "FLUX", commonPlasticDataPtr->getTempFluxValPtr()));
589 auto add_domain_stress_ops = [&](
auto &pipeline,
auto m_D_ptr) {
593 "U", commonPlasticDataPtr->mGradPtr, commonPlasticDataPtr->mStrainPtr));
597 if (m_D_ptr != commonPlasticDataPtr->mDPtr_Axiator)
604 auto add_domain_ops_lhs_mechanical = [&](
auto &pipeline,
auto m_D_ptr) {
606 pipeline.push_back(
new OpSetBc(
"U",
true, boundaryMarker));
608 pipeline.push_back(
new OpKCauchy(
"U",
"U", m_D_ptr));
610 "U",
"EP", commonPlasticDataPtr, m_D_ptr));
616 auto add_domain_ops_rhs_mechanical = [&](
auto &pipeline) {
618 pipeline.push_back(
new OpSetBc(
"U",
true, boundaryMarker));
621 const std::string block_name =
"BODY_FORCE";
622 if (it->getName().compare(0, block_name.size(), block_name) == 0) {
623 std::vector<double> attr;
624 CHKERR it->getAttributes(attr);
625 if (attr.size() == 3) {
626 bodyForces.push_back(
630 "Should be three atributes in BODYFORCE blockset, but is %d",
636 auto get_body_force = [
this](
const double,
const double,
const double) {
641 auto fe_domain_rhs = pipeline_mng->getDomainRhsFE();
642 const auto time = fe_domain_rhs->ts_t;
644 for (
auto &t_b : bodyForces)
645 t_source(
i) += (
scale * t_b(
i)) * time;
649 pipeline.push_back(
new OpBodyForce(
"U", get_body_force));
659 auto add_domain_ops_lhs_constrain = [&](
auto &pipeline,
auto m_D_ptr) {
661 pipeline.push_back(
new OpSetBc(
"U",
true, boundaryMarker));
664 "EP",
"U", commonPlasticDataPtr, m_D_ptr));
666 "TAU",
"U", commonPlasticDataPtr, m_D_ptr));
669 "EP",
"EP", commonPlasticDataPtr, m_D_ptr));
673 "TAU",
"EP", commonPlasticDataPtr, m_D_ptr));
678 "TAU",
"T", commonPlasticDataPtr));
680 "T",
"EP", commonPlasticDataPtr));
686 auto add_domain_ops_rhs_constrain = [&](
auto &pipeline) {
688 pipeline.push_back(
new OpSetBc(
"U",
true, boundaryMarker));
696 "T", commonPlasticDataPtr));
701 auto add_boundary_ops_lhs_mechanical = [&](
auto &pipeline) {
703 auto &bc_map = mField.getInterface<
BcManager>()->getBcMapByBlockName();
704 for (
auto bc : bc_map) {
705 if (bc_mng->checkBlock(bc,
"FIX_")) {
707 new OpSetBc(
"U",
false, bc.second->getBcMarkersPtr()));
709 "U",
"U", [](
double,
double,
double) {
return 1.; },
710 bc.second->getBcEntsPtr()));
717 auto add_boundary_ops_rhs_mechanical = [&](
auto &pipeline) {
720 auto get_time = [&](double, double, double) {
723 return fe_domain_rhs->ts_t;
726 auto get_time_scaled = [&](double, double, double) {
729 return fe_domain_rhs->ts_t *
scale;
732 auto get_minus_time = [&](double, double, double) {
735 return -fe_domain_rhs->ts_t;
738 auto time_scaled = [&](double, double, double) {
746 return fe_domain_rhs->ts_t;
750 pipeline.push_back(
new OpSetBc(
"U",
true, boundaryMarker));
753 if (it->getName().compare(0, 5,
"FORCE") == 0) {
755 std::vector<double> attr_vec;
756 CHKERR it->getMeshsetIdEntitiesByDimension(
757 mField.get_moab(),
SPACE_DIM - 1, force_edges,
true);
758 it->getAttributes(attr_vec);
761 "Wrong size of boundary attributes vector. Set right block "
763 auto force_vec_ptr = boost::make_shared<MatrixDouble>(
SPACE_DIM, 1);
764 std::copy(&attr_vec[0], &attr_vec[
SPACE_DIM],
765 force_vec_ptr->data().begin());
768 boost::make_shared<Range>(force_edges)));
774 auto u_mat_ptr = boost::make_shared<MatrixDouble>();
779 if (bc_mng->checkBlock(bc,
"FIX_")) {
781 new OpSetBc(
"U",
false, bc.second->getBcMarkersPtr()));
782 auto attr_vec = boost::make_shared<MatrixDouble>(
SPACE_DIM, 1);
784 if (bc.second->bcAttributes.size() <
SPACE_DIM)
786 "Wrong size of boundary attributes vector. Set right block "
787 "size attributes. Size of attributes %d",
788 bc.second->bcAttributes.size());
789 std::copy(&bc.second->bcAttributes[0],
791 attr_vec->data().begin());
793 pipeline.push_back(
new OpBoundaryVec(
"U", attr_vec, time_scaled,
794 bc.second->getBcEntsPtr()));
796 "U", u_mat_ptr, [](
double,
double,
double) {
return 1.; },
797 bc.second->getBcEntsPtr()));
806 auto add_domain_ops_lhs_thermal = [&](
auto &pipeline,
auto &fe) {
808 auto resistance = [](
const double,
const double,
const double) {
811 auto capacity = [&](
const double,
const double,
const double) {
814 auto unity = []() {
return 1; };
815 pipeline.push_back(
new OpHdivHdiv(
"FLUX",
"FLUX", resistance));
816 pipeline.push_back(
new OpHdivT(
"FLUX",
"T", unity,
true));
817 pipeline.push_back(
new OpCapacity(
"T",
"T", capacity));
821 auto add_domain_ops_rhs_thermal = [&](
auto &pipeline) {
823 auto resistance = [](
const double,
const double,
const double) {
826 auto capacity = [&](
const double,
const double,
const double) {
829 auto unity = [](
const double,
const double,
const double) {
return 1; };
831 "FLUX", commonPlasticDataPtr->getTempFluxValPtr(), resistance));
833 new OpHDivTemp(
"FLUX", commonPlasticDataPtr->getTempValPtr(), unity));
835 "T", commonPlasticDataPtr->getTempDivFluxPtr(), unity));
842 "T", commonPlasticDataPtr->getTempValDotPtr(), capacity));
846 auto add_boundary_ops_rhs_thermal = [&](
auto &pipeline,
auto &fe) {
856 const std::string block_name =
"TEMPERATURE";
857 if (it->getName().compare(0, block_name.size(), block_name) == 0) {
859 std::vector<double> attr_vec;
860 CHKERR it->getMeshsetIdEntitiesByDimension(
861 mField.get_moab(),
SPACE_DIM - 1, temp_edges,
true);
862 it->getAttributes(attr_vec);
863 if (attr_vec.size() != 1)
865 "Should be one attribute");
867 <<
"Set temerature " << attr_vec[0] <<
" on ents:\n"
869 bcTemperatureFunctions.push_back(BcTempFun(attr_vec[0], fe));
872 boost::make_shared<Range>(temp_edges)));
879 CHKERR add_domain_base_ops(pipeline_mng->getOpDomainLhsPipeline());
880 CHKERR add_domain_stress_ops(pipeline_mng->getOpDomainLhsPipeline(),
881 commonPlasticDataPtr->mDPtr_Deviator);
882 CHKERR add_domain_ops_lhs_mechanical(pipeline_mng->getOpDomainLhsPipeline(),
883 commonPlasticDataPtr->mDPtr_Deviator);
884 CHKERR add_domain_ops_lhs_constrain(pipeline_mng->getOpDomainLhsPipeline(),
885 commonPlasticDataPtr->mDPtr_Deviator);
886 CHKERR add_boundary_ops_lhs_mechanical(
887 pipeline_mng->getOpBoundaryLhsPipeline());
890 CHKERR add_domain_base_ops(feAxiatorLhs->getOpPtrVector());
891 CHKERR add_domain_ops_lhs_mechanical(feAxiatorLhs->getOpPtrVector(),
892 commonPlasticDataPtr->mDPtr_Axiator);
894 CHKERR add_domain_base_ops(feThermalLhs->getOpPtrVector());
895 CHKERR add_domain_ops_lhs_thermal(feThermalLhs->getOpPtrVector(),
899 CHKERR add_domain_base_ops(pipeline_mng->getOpDomainRhsPipeline());
900 CHKERR add_domain_stress_ops(pipeline_mng->getOpDomainRhsPipeline(),
901 commonPlasticDataPtr->mDPtr_Deviator);
902 CHKERR add_domain_ops_rhs_mechanical(pipeline_mng->getOpDomainRhsPipeline());
903 CHKERR add_domain_ops_rhs_constrain(pipeline_mng->getOpDomainRhsPipeline());
904 CHKERR add_boundary_ops_rhs_mechanical(
905 pipeline_mng->getOpBoundaryRhsPipeline());
908 CHKERR add_domain_base_ops(feAxiatorRhs->getOpPtrVector());
909 CHKERR add_domain_stress_ops(feAxiatorRhs->getOpPtrVector(),
910 commonPlasticDataPtr->mDPtr_Axiator);
911 CHKERR add_domain_ops_rhs_mechanical(feAxiatorRhs->getOpPtrVector());
914 CHKERR add_domain_base_ops(feThermalRhs->getOpPtrVector());
915 CHKERR add_domain_ops_rhs_thermal(feThermalRhs->getOpPtrVector());
917 add_boundary_ops_rhs_thermal(pipeline_mng->getOpBoundaryRhsPipeline(),
918 *pipeline_mng->getBoundaryRhsFE());
920 CHKERR pipeline_mng->setDomainRhsIntegrationRule(integration_rule_deviator);
921 CHKERR pipeline_mng->setDomainLhsIntegrationRule(integration_rule_deviator);
923 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(integration_rule_bc);
924 CHKERR pipeline_mng->setBoundaryRhsIntegrationRule(integration_rule_bc);
926 auto create_reaction_pipeline = [&](
auto &pipeline) {
929 if (reactionMarker) {
932 auto det_ptr = boost::make_shared<VectorDouble>();
933 auto jac_ptr = boost::make_shared<MatrixDouble>();
934 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
943 "U", commonPlasticDataPtr->mGradPtr));
945 "EP", commonPlasticDataPtr->getPlasticStrainPtr()));
948 commonPlasticDataPtr->mStrainPtr));
950 commonPlasticDataPtr->mDPtr, 1));
951 pipeline.push_back(
new OpSetBc(
"U",
false, reactionMarker));
963 reactionFe = boost::make_shared<DomainEle>(mField);
964 reactionFe->getRuleHook = integration_rule_deviator;
966 CHKERR create_reaction_pipeline(reactionFe->getOpPtrVector());
980 auto set_section_monitor = [&](
auto solver) {
983 CHKERR TSGetSNES(solver, &snes);
984 PetscViewerAndFormat *vf;
985 CHKERR PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD,
986 PETSC_VIEWER_DEFAULT, &vf);
989 (
MoFEMErrorCode(*)(SNES, PetscInt, PetscReal,
void *))SNESMonitorFields,
994 auto create_post_process_element = [&]() {
996 postProcFe = boost::make_shared<PostProcEle>(mField);
997 postProcFe->generateReferenceElementMesh();
999 auto det_ptr = boost::make_shared<VectorDouble>();
1000 auto jac_ptr = boost::make_shared<MatrixDouble>();
1001 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
1002 postProcFe->getOpPtrVector().push_back(
1004 postProcFe->getOpPtrVector().push_back(
1006 postProcFe->getOpPtrVector().push_back(
1010 postProcFe->getOpPtrVector().push_back(
1012 "U", commonPlasticDataPtr->mGradPtr));
1014 "TAU", commonPlasticDataPtr->getPlasticTauPtr()));
1015 postProcFe->getOpPtrVector().push_back(
1017 "EP", commonPlasticDataPtr->getPlasticStrainPtr()));
1019 "T", commonPlasticDataPtr->getTempValPtr()));
1022 "U", commonPlasticDataPtr->mGradPtr, commonPlasticDataPtr->mStrainPtr));
1024 "U", commonPlasticDataPtr, commonPlasticDataPtr->mDPtr,
scale));
1025 postProcFe->getOpPtrVector().push_back(
1027 "U", postProcFe->postProcMesh, postProcFe->mapGaussPts,
1028 commonPlasticDataPtr->mStrainPtr,
1029 commonPlasticDataPtr->mStressPtr));
1031 postProcFe->getOpPtrVector().push_back(
1033 postProcFe->getOpPtrVector().push_back(
1035 postProcFe->mapGaussPts, commonPlasticDataPtr));
1036 postProcFe->addFieldValuesPostProc(
"U");
1040 auto scatter_create = [&](
auto D,
auto coeff) {
1042 CHKERR is_manager->isCreateProblemFieldAndRank(
simple->getProblemName(),
1043 ROW,
"U", coeff, coeff, is);
1045 CHKERR ISGetLocalSize(is, &loc_size);
1047 CHKERR VecCreateMPI(mField.get_comm(), loc_size, PETSC_DETERMINE, &
v);
1049 CHKERR VecScatterCreate(
D, is,
v, PETSC_NULL, &scatter);
1054 auto set_time_monitor = [&](
auto dm,
auto solver) {
1056 boost::shared_ptr<Monitor> monitor_ptr(
new Monitor(
1057 dm, postProcFe, reactionFe, uXScatter, uYScatter, uZScatter));
1058 boost::shared_ptr<ForcesAndSourcesCore>
null;
1060 monitor_ptr,
null,
null);
1064 auto dm =
simple->getDM();
1067 boost::shared_ptr<FEMethod>
null;
1077 CHKERR create_post_process_element();
1078 uXScatter = scatter_create(
D, 0);
1079 uYScatter = scatter_create(
D, 1);
1081 uZScatter = scatter_create(
D, 2);
1083 auto solver = pipeline_mng->createTSIM();
1085 CHKERR TSSetSolution(solver,
D);
1086 CHKERR set_section_monitor(solver);
1087 CHKERR set_time_monitor(dm, solver);
1088 CHKERR TSSetSolution(solver,
D);
1089 CHKERR TSSetFromOptions(solver);
1091 CHKERR TSSolve(solver, NULL);
1093 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
1094 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
1106 const char param_file[] =
"param_file.petsc";
1110 auto core_log = logging::core::get();
1119 DMType dm_name =
"DMMOFEM";
ForcesAndSourcesCore::UserDataOperator UserDataOperator
void simple(double P1[], double P2[], double P3[], double c[], const int N)
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
Kronecker Delta class symmetric.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMass
constexpr double shear_modulus_G
constexpr double bulk_modulus_K
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, SPACE_DIM > OpBodyForce
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpInertiaForce
#define CATCH_ERRORS
Catch errors.
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ L2
field with C-1 continuity
@ HCURL
field with continuous tangents
@ HDIV
field with continuous normal traction
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalarField< 1, 1 > OpBaseTimesScalarField
void temp(int x, int y=10)
auto smartCreateDMVector
Get smart vector from DM.
PetscErrorCode DMMoFEMTSSetIFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set TS implicit function evaluation function
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMMoFEMTSSetIJacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
FaceElementForcesAndSourcesCoreSwitch< 0 > FaceElementForcesAndSourcesCore
Face finite element default.
VolumeElementForcesAndSourcesCoreSwitch< 0 > VolumeElementForcesAndSourcesCore
Volume finite element default.
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 _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
FTensor::Index< 'i', SPACE_DIM > i
double v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
const FTensor::Tensor2< T, Dim, Dim > Vec
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
OpSetInvJacHcurlFaceImpl< 2 > OpSetInvJacHcurlFace
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
Set Monitor To TS solver.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
OpSetContravariantPiolaTransformOnFace2DImpl< 2 > OpSetContravariantPiolaTransformOnFace2D
OpCalculateScalarFieldValuesFromPetscVecImpl< PetscData::CTX_SET_X_T > OpCalculateScalarFieldValuesDot
DeprecatedCoreInterface Interface
const double D
diffusivity
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForcePiola
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, 1 > OpKPiola
[Only used for dynamics]
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForceCauchy
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 0 > OpBoundaryVec
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 > OpKCauchy
[Body force]
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpBoundaryInternal
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpBoundaryMass
[Only used with Hencky/nonlinear material]
static constexpr int approx_order
OpBaseImpl< PETSC, EdgeEleOp > OpBase
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
PipelineManager::FaceEle DomainEle
BcTempFun(double v, FEMethod &fe)
double operator()(const double, const double, const double)
std::vector< BcTempFun > bcTemperatureFunctions
boost::shared_ptr< PlasticThermalOps::CommonData > commonPlasticDataPtr
boost::shared_ptr< DomainEle > feThermalRhs
boost::shared_ptr< DomainEle > feThermalLhs
MoFEMErrorCode createCommonData()
Example(MoFEM::Interface &m_field)
MoFEMErrorCode runProblem()
MoFEMErrorCode setupProblem()
Simple interface for fast problem set-up.
BcMapByBlockName & getBcMapByBlockName()
Get the bc map.
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.
default operator for EDGE element
Data on single entity (This is passed as argument to DataOperator::doWork)
structure for User Loop Methods on finite elements
default operator for TRI element
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.
Get vector field for H-div approximation.
Calculate divergence of vector field.
Get value at integration points for scalar field.
Calculate symmetric tensor field rates ant integratio pts.
Calculate symmetric tensor field values at integration pts.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Get values at integration pts for tensor filed rank 1, i.e. vector field.
Make Hdiv space from Hcurl space in 2d.
Scale base functions by inverses of measure of element.
Set indices on entities on finite element.
PipelineManager interface.
MoFEM::FaceElementForcesAndSourcesCore FaceEle
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
boost::shared_ptr< FEMethod > & getBoundaryRhsFE()
Problem manager is used to build and partition problems.
Simple interface for fast problem set-up.
intrusive_ptr for managing petsc objects
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Volume finite element with switches.
VolumeElementForcesAndSourcesCoreBase::UserDataOperator UserDataOperator
int main(int argc, char *argv[])
EntitiesFieldData::EntData EntData
static char help[]
[Solve]
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForceCauchy
#define EXECUTABLE_DIMENSION
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesScalar< SPACE_DIM > OpHdivT
Integrate Lhs div of base of flux time base of temperature (FLUX x T) and transpose of it,...
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 3, 3, 1 > OpHdivFlux
Integrating Rhs flux base (1/k) flux (FLUX)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalarField< 1 > OpBaseDotT
Integrate Rhs base of temerature time heat capacity times heat rate (T)
int number_of_cycles_in_total_time
double fraction_of_dissipation
long double hardening(long double tau, double temp)
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 0 > OpBoundaryVec
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpHeatSource
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 > OpCapacity
Integrate Lhs base of temerature times (heat capacity) times base of temperature (T x T)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpMixDivTimesU< 3, 1, 2 > OpHDivTemp
Integrate Rhs div flux base times temperature (T)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 3, 3 > OpHdivHdiv
Integrate Lhs base of flux (1/k) base of flux (FLUX x FLUX)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 > OpKCauchy
[Body force]
long double hardening_dtau(long double tau, double temp)
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpBoundaryInternal
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpNormalMixVecTimesScalar< SPACE_DIM > OpTemperatureBC
long double hardening_dtemp(long double tau, double temp)
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpBoundaryMass
[Only used with Hencky/nonlinear material]
OpBaseDotT OpBaseDivFlux
Integrate Rhs base of temerature times divergenc of flux (T)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, SPACE_DIM > OpBodyForce
[Body force]
constexpr EntityType boundary_ent