|
| v0.14.0
|
[Example]
More...
◆ BoundingBox
Enumerator |
---|
CENTER_X | |
CENTER_Y | |
MAX_X | |
MAX_Y | |
MIN_X | |
MIN_Y | |
LAST_BB | |
Definition at line 98 of file phase.cpp.
◆ Example() [1/14]
◆ Example() [2/14]
◆ Example() [3/14]
◆ Example() [4/14]
◆ Example() [5/14]
◆ Example() [6/14]
◆ Example() [7/14]
◆ Example() [8/14]
◆ Example() [9/14]
◆ Example() [10/14]
◆ Example() [11/14]
◆ Example() [12/14]
◆ Example() [13/14]
◆ Example() [14/14]
◆ addMatBlockOps()
[Calculate elasticity tensor]
[Calculate elasticity tensor]
Definition at line 114 of file elastic.cpp.
121 OpMatBlocks(std::string
field_name, boost::shared_ptr<MatrixDouble>
m,
124 std::vector<const CubitMeshSets *> meshset_vec_ptr)
128 std::fill(&(doEntities[MBEDGE]), &(doEntities[MBMAXTYPE]),
false);
130 "Can not get data from block");
137 for (
auto &b : blockData) {
139 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
145 CHKERR getMatDPtr(
matDPtr, bulkModulusKDefault, shearModulusGDefault);
150 boost::shared_ptr<MatrixDouble>
matDPtr;
154 double shearModulusG;
158 double bulkModulusKDefault;
159 double shearModulusGDefault;
160 std::vector<BlockData> blockData;
164 std::vector<const CubitMeshSets *> meshset_vec_ptr,
168 for (
auto m : meshset_vec_ptr) {
170 std::vector<double> block_data;
171 CHKERR m->getAttributes(block_data);
172 if (block_data.size() < 2) {
174 "Expected that block has two attributes");
176 auto get_block_ents = [&]() {
179 m_field.
get_moab().get_entities_by_handle(
m->meshset, ents,
true);
198 MoFEMErrorCode getMatDPtr(boost::shared_ptr<MatrixDouble> mat_D_ptr,
202 auto set_material_stiffness = [&]() {
213 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*mat_D_ptr);
222 set_material_stiffness();
227 pipeline.push_back(
new OpMatBlocks(
233 (boost::format(
"%s(.*)") % block_name).str()
◆ assembleSystem() [1/10]
◆ assembleSystem() [2/10]
◆ assembleSystem() [3/10]
◆ assembleSystem() [4/10]
◆ assembleSystem() [5/10]
◆ assembleSystem() [6/10]
◆ assembleSystem() [7/10]
◆ assembleSystem() [8/10]
◆ assembleSystem() [9/10]
◆ assembleSystem() [10/10]
[Push operators to pipeline]
[Boundary condition]
[Applying essential BC]
[Push operators to pipeline]
[Integration rule]
[Integration rule]
[Push domain stiffness matrix to pipeline]
[Push domain stiffness matrix to pipeline]
[Push Internal forces]
[Push Internal forces]
[Push Body forces]
[Push Body forces]
[Push natural boundary conditions]
[Push natural boundary conditions]
- Examples
- dynamic_first_order_con_law.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, plot_base.cpp, and shallow_wave.cpp.
Definition at line 647 of file dynamic_first_order_con_law.cpp.
662 auto get_time_scale = [
this](
const double time) {
663 return sin(time *
omega * M_PI);
666 auto apply_rhs = [&](
auto &pip) {
673 auto mat_v_grad_ptr = boost::make_shared<MatrixDouble>();
675 "V", mat_v_grad_ptr));
677 auto gravity_vector_ptr = boost::make_shared<MatrixDouble>();
678 gravity_vector_ptr->resize(
SPACE_DIM, 1);
679 auto set_body_force = [&]() {
682 auto t_force = getFTensor1FromMat<SPACE_DIM, 0>(*gravity_vector_ptr);
683 double unit_weight = 0.;
688 t_force(1) = -unit_weight;
690 t_force(2) = unit_weight;
696 pip.push_back(
new OpBodyForce(
"V", gravity_vector_ptr,
697 [](
double,
double,
double) {
return 1.; }));
700 auto mat_H_tensor_ptr = boost::make_shared<MatrixDouble>();
702 "F", mat_H_tensor_ptr));
719 auto mat_dot_F_tensor_ptr = boost::make_shared<MatrixDouble>();
721 "F_dot", mat_dot_F_tensor_ptr));
724 auto mat_x_grad_ptr = boost::make_shared<MatrixDouble>();
726 "x_2", mat_x_grad_ptr));
728 auto mat_F_tensor_ptr = boost::make_shared<MatrixDouble>();
730 mat_F_tensor_ptr, mat_H_tensor_ptr));
732 auto mat_F_stab_ptr = boost::make_shared<MatrixDouble>();
734 mat_F_tensor_ptr, mat_F_stab_ptr, mat_dot_F_tensor_ptr, tau, xi,
735 mat_x_grad_ptr, mat_v_grad_ptr));
737 PetscBool is_linear_elasticity = PETSC_TRUE;
739 &is_linear_elasticity, PETSC_NULL);
741 auto mat_P_stab_ptr = boost::make_shared<MatrixDouble>();
742 if (is_linear_elasticity) {
747 auto inv_F = boost::make_shared<MatrixDouble>();
748 auto det_ptr = boost::make_shared<VectorDouble>();
756 mat_F_stab_ptr, inv_F, det_ptr));
765 CHKERR apply_rhs(pipeline_mng->getOpDomainExplicitRhsPipeline());
◆ assembleSystemFlux()
◆ assembleSystemIntensity()
[Calculate flux on boundary]
[Push operators to pipeline]
- Examples
- phase.cpp.
Definition at line 433 of file phase.cpp.
439 pipeline_mng->getDomainRhsFE().reset();
440 pipeline_mng->getBoundaryRhsFE().reset();
443 pipeline_mng->setDomainLhsIntegrationRule(rule_vol);
444 pipeline_mng->setDomainRhsIntegrationRule(rule_vol);
446 auto det_ptr = boost::make_shared<VectorDouble>();
447 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
448 auto jac_ptr = boost::make_shared<MatrixDouble>();
450 pipeline_mng->getOpDomainLhsPipeline().push_back(
452 pipeline_mng->getOpDomainLhsPipeline().push_back(
455 pipeline_mng->getOpDomainLhsPipeline().push_back(
457 pipeline_mng->getOpDomainLhsPipeline().push_back(
461 pipeline_mng->getOpDomainLhsPipeline().push_back(
463 auto unity = []() {
return 1; };
464 pipeline_mng->getOpDomainLhsPipeline().push_back(
465 new OpHdivU(
"S",
"PHI", unity,
true));
468 pipeline_mng->getOpDomainRhsPipeline().push_back(
◆ bC() [1/2]
◆ bC() [2/2]
[Create common data]
[Boundary condition]
- Examples
- plastic.cpp.
Definition at line 555 of file plastic.cpp.
562 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_X",
564 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Y",
566 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Z",
568 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
569 "REMOVE_ALL",
"U", 0, 3);
572 for (
auto b : {
"FIX_X",
"REMOVE_X"})
573 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
574 "SIGMA", 0, 0,
false,
true);
575 for (
auto b : {
"FIX_Y",
"REMOVE_Y"})
576 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
577 "SIGMA", 1, 1,
false,
true);
578 for (
auto b : {
"FIX_Z",
"REMOVE_Z"})
579 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
580 "SIGMA", 2, 2,
false,
true);
581 for (
auto b : {
"FIX_ALL",
"REMOVE_ALL"})
582 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
583 "SIGMA", 0, 3,
false,
true);
584 CHKERR bc_mng->removeBlockDOFsOnEntities(
585 simple->getProblemName(),
"NO_CONTACT",
"SIGMA", 0, 3,
false,
true);
589 simple->getProblemName(),
"U");
591 auto &bc_map = bc_mng->getBcMapByBlockName();
592 for (
auto bc : bc_map)
593 MOFEM_LOG(
"PLASTICITY", Sev::verbose) <<
"Marker " << bc.first;
◆ boundaryCondition() [1/10]
◆ boundaryCondition() [2/10]
◆ boundaryCondition() [3/10]
◆ boundaryCondition() [4/10]
◆ boundaryCondition() [5/10]
◆ boundaryCondition() [6/10]
◆ boundaryCondition() [7/10]
◆ boundaryCondition() [8/10]
◆ boundaryCondition() [9/10]
◆ boundaryCondition() [10/10]
[Set up problem]
[Create common data]
[Boundary condition]
[Applying essential BC]
[Define gravity vector]
- Examples
- dynamic_first_order_con_law.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, plot_base.cpp, and shallow_wave.cpp.
Definition at line 536 of file dynamic_first_order_con_law.cpp.
542 auto time_scale = boost::make_shared<TimeScale>();
544 PetscBool sin_time_function = PETSC_FALSE;
546 &sin_time_function, PETSC_NULL);
548 if (sin_time_function)
549 time_scale = boost::make_shared<DynamicFirstOrderConsSinusTimeScale>();
551 time_scale = boost::make_shared<DynamicFirstOrderConsConstantTimeScale>();
553 pipeline_mng->getBoundaryExplicitRhsFE().reset();
555 pipeline_mng->getOpBoundaryExplicitRhsPipeline(), {NOSPACE},
"GEOMETRY");
558 pipeline_mng->getOpBoundaryExplicitRhsPipeline(),
mField,
"V",
559 {time_scale},
"FORCE", Sev::inform);
569 simple->getProblemName(),
"V");
571 auto get_pre_proc_hook = [&]() {
573 mField, pipeline_mng->getDomainExplicitRhsFE(), {time_scale});
575 pipeline_mng->getDomainExplicitRhsFE()->preProcessHook = get_pre_proc_hook();
◆ calculateFlux()
[Set up problem]
[Calculate flux on boundary]
- Examples
- phase.cpp.
Definition at line 402 of file phase.cpp.
407 pipeline_mng->getDomainRhsFE().reset();
408 pipeline_mng->getBoundaryRhsFE().reset();
411 pipeline_mng->setBoundaryRhsIntegrationRule(rule_vol);
413 auto flux_ptr = boost::make_shared<MatrixDouble>();
414 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
416 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
418 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
419 new BoundaryOp(flux_ptr, calc_flux));
422 CHKERR pipeline_mng->loopFiniteElements();
423 double global_flux_assembeld = 0;
424 MPI_Allreduce(&calc_flux, &global_flux_assembeld, 1, MPI_DOUBLE, MPI_SUM,
426 calc_flux = global_flux_assembeld;
◆ checkResults() [1/12]
◆ checkResults() [2/12]
◆ checkResults() [3/12]
◆ checkResults() [4/12]
◆ checkResults() [5/12]
◆ checkResults() [6/12]
◆ checkResults() [7/12]
◆ checkResults() [8/12]
◆ checkResults() [9/12]
◆ checkResults() [10/12]
◆ checkResults() [11/12]
◆ checkResults() [12/12]
◆ createCommonData() [1/8]
◆ createCommonData() [2/8]
◆ createCommonData() [3/8]
◆ createCommonData() [4/8]
◆ createCommonData() [5/8]
◆ createCommonData() [6/8]
◆ createCommonData() [7/8]
[Set up problem]
[Set integration rule]
[Create common data]
< true if tau order is set
< true if tau order is set
- Examples
- eigen_elastic.cpp, heat_method.cpp, plastic.cpp, plot_base.cpp, and shallow_wave.cpp.
Definition at line 447 of file plastic.cpp.
450 auto get_command_line_parameters = [&]() {
475 PetscBool tau_order_is_set;
478 PetscBool ep_order_is_set;
491 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Hardening " <<
H;
492 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Viscous hardening " <<
visH;
493 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Saturation yield stress " <<
Qinf;
494 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Saturation exponent " <<
b_iso;
495 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Kinematic hardening " <<
C1_k;
500 if (tau_order_is_set == PETSC_FALSE)
502 if (ep_order_is_set == PETSC_FALSE)
505 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Approximation order " <<
order;
507 <<
"Ep approximation order " <<
ep_order;
509 <<
"Tau approximation order " <<
tau_order;
511 <<
"Geometry approximation order " <<
geom_order;
513 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Density " <<
rho;
516 PetscBool is_scale = PETSC_TRUE;
530 #endif // ADD_CONTACT
540 CHKERR get_command_line_parameters();
544 sdfPythonPtr = boost::make_shared<ContactOps::SDFPython>();
545 CHKERR sdfPythonPtr->sdfInit(
"sdf.py");
546 ContactOps::sdfPythonWeakPtr = sdfPythonPtr;
548 #endif // ADD_CONTACT
◆ createCommonData() [8/8]
◆ getCoordsInImage()
std::pair< int, int > Example::getCoordsInImage |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
|
staticprivate |
- Examples
- phase.cpp.
Definition at line 131 of file phase.cpp.
138 const auto p = std::make_pair<int, int>(std::round(x), std::round(y));
141 if (p.first < 0 && p.first >=
m.size1())
143 if (p.second < 0 && p.second >=
m.size2())
◆ gettingNorms()
[Solve]
[Getting norms]
- Examples
- nonlinear_elastic.cpp.
Definition at line 383 of file nonlinear_elastic.cpp.
387 auto dm =
simple->getDM();
393 CHKERR VecNorm(T, NORM_2, &nrm2);
394 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Solution norm " << nrm2;
396 auto post_proc_norm_fe = boost::make_shared<DomainEle>(
mField);
398 auto post_proc_norm_rule_hook = [](
int,
int,
int p) ->
int {
return 2 * p; };
399 post_proc_norm_fe->getRuleHook = post_proc_norm_rule_hook;
402 post_proc_norm_fe->getOpPtrVector(), {H1});
404 enum NORMS { U_NORM_L2 = 0, PIOLA_NORM, LAST_NORM };
408 CHKERR VecZeroEntries(norms_vec);
410 auto u_ptr = boost::make_shared<MatrixDouble>();
411 post_proc_norm_fe->getOpPtrVector().push_back(
414 post_proc_norm_fe->getOpPtrVector().push_back(
417 auto common_ptr = commonDataFactory<SPACE_DIM, GAUSS, DomainEleOp>(
418 mField, post_proc_norm_fe->getOpPtrVector(),
"U",
"MAT_ELASTIC",
421 post_proc_norm_fe->getOpPtrVector().push_back(
423 common_ptr->getMatFirstPiolaStress(), norms_vec, PIOLA_NORM));
428 CHKERR VecAssemblyBegin(norms_vec);
429 CHKERR VecAssemblyEnd(norms_vec);
434 CHKERR VecGetArrayRead(norms_vec, &norms);
436 <<
"norm_u: " << std::scientific << std::sqrt(norms[U_NORM_L2]);
438 <<
"norm_piola: " << std::scientific << std::sqrt(norms[PIOLA_NORM]);
439 CHKERR VecRestoreArrayRead(norms_vec, &norms);
◆ integrateElements()
◆ integrationRule()
static int Example::integrationRule |
( |
int |
, |
|
|
int |
, |
|
|
int |
p_data |
|
) |
| |
|
inlinestaticprivate |
◆ kspSolve()
[Push operators to pipeline]
[Solve]
Definition at line 230 of file radiation.cpp.
237 CHKERR TSSetDuration(ts, PETSC_DEFAULT, ftime);
238 CHKERR TSSetFromOptions(ts);
239 CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_MATCHSTEP);
246 CHKERR TSGetTime(ts, &ftime);
248 PetscInt steps, snesfails, rejects, nonlinits, linits;
249 CHKERR TSGetTimeStepNumber(ts, &steps);
250 CHKERR TSGetSNESFailures(ts, &snesfails);
251 CHKERR TSGetStepRejections(ts, &rejects);
252 CHKERR TSGetSNESIterations(ts, &nonlinits);
253 CHKERR TSGetKSPIterations(ts, &linits);
255 "steps %d (%d rejected, %d SNES fails), ftime %g, nonlinits "
257 steps, rejects, snesfails, ftime, nonlinits, linits);
◆ lhsFlux()
◆ OPs() [1/2]
◆ OPs() [2/2]
[Boundary condition]
[Push operators to pipeline]
[Only used for dynamics]
[Only used for dynamics]
[Only used for dynamics]
[Only used for dynamics]
- Examples
- plastic.cpp.
Definition at line 600 of file plastic.cpp.
606 auto integration_rule_bc = [](
int,
int,
int ao) {
return 2 * ao; };
610 auto add_boundary_ops_lhs_mechanical = [&](
auto &pip) {
619 pip,
mField,
"U", Sev::inform);
623 ContactOps::opFactoryBoundaryLhs<SPACE_DIM, AT, GAUSS, BoundaryEleOp>(
626 ContactOps::opFactoryBoundaryToDomainLhs<SPACE_DIM, AT, IT, DomainEle>(
627 mField, pip,
simple->getDomainFEName(),
"SIGMA",
"U",
"GEOMETRY",
629 #endif // ADD_CONTACT
634 auto add_boundary_ops_rhs_mechanical = [&](
auto &pip) {
643 pip,
mField,
"U", {boost::make_shared<ScaledTimeScale>()}, Sev::inform);
646 CHKERR ContactOps::opFactoryBoundaryRhs<SPACE_DIM, AT, IT, BoundaryEleOp>(
648 #endif // ADD_CONTACT
653 auto add_domain_ops_lhs = [
this](
auto &pip) {
665 auto get_inertia_and_mass_damping = [
this](
const double,
const double,
669 return (
rho /
scale) * fe_domain_lhs->ts_aa +
672 pip.push_back(
new OpMass(
"U",
"U", get_inertia_and_mass_damping));
675 CHKERR PlasticOps::opFactoryDomainLhs<SPACE_DIM, AT, IT, DomainEleOp>(
676 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU");
681 auto add_domain_ops_rhs = [
this](
auto &pip) {
689 {boost::make_shared<ScaledTimeScale>(
"body_force_hist.txt")},
697 AT>::LinearForm<IT>::OpBaseTimesVector<1,
SPACE_DIM, 1>;
700 auto mat_acceleration = boost::make_shared<MatrixDouble>();
702 "U", mat_acceleration));
704 new OpInertiaForce(
"U", mat_acceleration, [](
double,
double,
double) {
708 auto mat_velocity = boost::make_shared<MatrixDouble>();
712 new OpInertiaForce(
"U", mat_velocity, [](
double,
double,
double) {
718 CHKERR PlasticOps::opFactoryDomainRhs<SPACE_DIM, AT, IT, DomainEleOp>(
719 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU");
722 CHKERR ContactOps::opFactoryDomainRhs<SPACE_DIM, AT, IT, DomainEleOp>(
724 #endif // ADD_CONTACT
729 CHKERR add_domain_ops_lhs(pip_mng->getOpDomainLhsPipeline());
730 CHKERR add_domain_ops_rhs(pip_mng->getOpDomainRhsPipeline());
733 CHKERR add_boundary_ops_lhs_mechanical(pip_mng->getOpBoundaryLhsPipeline());
734 CHKERR add_boundary_ops_rhs_mechanical(pip_mng->getOpBoundaryRhsPipeline());
736 CHKERR pip_mng->setDomainRhsIntegrationRule(vol_rule);
737 CHKERR pip_mng->setDomainLhsIntegrationRule(vol_rule);
739 CHKERR pip_mng->setBoundaryLhsIntegrationRule(integration_rule_bc);
740 CHKERR pip_mng->setBoundaryRhsIntegrationRule(integration_rule_bc);
742 auto create_reaction_pipeline = [&](
auto &pip) {
746 CHKERR PlasticOps::opFactoryDomainReactions<SPACE_DIM, AT, IT, DomainEleOp>(
747 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU");
◆ outputResults() [1/11]
◆ outputResults() [2/11]
◆ outputResults() [3/11]
◆ outputResults() [4/11]
◆ outputResults() [5/11]
◆ outputResults() [6/11]
◆ outputResults() [7/11]
◆ outputResults() [8/11]
◆ outputResults() [9/11]
◆ outputResults() [10/11]
[Solve]
[Getting norms]
[Postprocess results]
[Postprocessing results]
[Postprocess clean]
[Postprocess clean]
[Postprocess initialise]
[Postprocess initialise]
- Examples
- dynamic_first_order_con_law.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plot_base.cpp, and shallow_wave.cpp.
Definition at line 1183 of file dynamic_first_order_con_law.cpp.
1185 PetscBool test_flg = PETSC_FALSE;
1193 CHKERR VecNorm(T, NORM_2, &nrm2);
1194 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Regression norm " << nrm2;
1195 constexpr
double regression_value = 0.0194561;
1196 if (fabs(nrm2 - regression_value) > 1e-2)
1198 "Regression test failed; wrong norm value.");
◆ outputResults() [11/11]
[Solve]
[Postprocess results]
Definition at line 504 of file phase.cpp.
513 auto post_proc_fe = boost::make_shared<PostProcEle>(
mField);
514 auto jac_ptr = boost::make_shared<MatrixDouble>();
515 post_proc_fe->getOpPtrVector().push_back(
518 post_proc_fe->getOpPtrVector().push_back(
521 auto s_ptr = boost::make_shared<VectorDouble>();
522 auto phi_ptr = boost::make_shared<MatrixDouble>();
523 post_proc_fe->getOpPtrVector().push_back(
525 post_proc_fe->getOpPtrVector().push_back(
530 post_proc_fe->getOpPtrVector().push_back(
532 new OpPPMap(post_proc_fe->getPostProcMesh(),
533 post_proc_fe->getMapGaussPts(),
553 CHKERR post_proc_fe->writeFile(
"out_" + boost::lexical_cast<std::string>(
i) +
◆ postProcess() [1/2]
[Integrate]
[Solve]
[Print results]
[Postprocess results]
Definition at line 235 of file integration.cpp.
242 "First moment of inertia [ %6.4e, %6.4e, %6.4e ]",
246 "Second moment of inertia [ %6.4e, %6.4e, %6.4e; %6.4e %6.4e; "
◆ postProcess() [2/2]
◆ pushOperators()
[Set density distribution]
[Push operators to pipeline]
Definition at line 188 of file integration.cpp.
◆ readMesh() [1/11]
◆ readMesh() [2/11]
◆ readMesh() [3/11]
◆ readMesh() [4/11]
◆ readMesh() [5/11]
◆ readMesh() [6/11]
◆ readMesh() [7/11]
◆ readMesh() [8/11]
◆ readMesh() [9/11]
◆ readMesh() [10/11]
◆ readMesh() [11/11]
◆ rhsSource()
◆ runProblem() [1/14]
◆ runProblem() [2/14]
◆ runProblem() [3/14]
◆ runProblem() [4/14]
◆ runProblem() [5/14]
◆ runProblem() [6/14]
◆ runProblem() [7/14]
◆ runProblem() [8/14]
◆ runProblem() [9/14]
◆ runProblem() [10/14]
◆ runProblem() [11/14]
◆ runProblem() [12/14]
◆ runProblem() [13/14]
◆ runProblem() [14/14]
◆ setFieldValues()
[Create common data]
[Set density distribution]
Definition at line 172 of file integration.cpp.
174 auto set_density = [&](
VectorAdaptor &&field_data,
double *xcoord,
175 double *ycoord,
double *zcoord) {
◆ setIntegrationRules() [1/3]
◆ setIntegrationRules() [2/3]
◆ setIntegrationRules() [3/3]
◆ setUp()
◆ setupProblem() [1/13]
◆ setupProblem() [2/13]
◆ setupProblem() [3/13]
◆ setupProblem() [4/13]
◆ setupProblem() [5/13]
◆ setupProblem() [6/13]
◆ setupProblem() [7/13]
◆ setupProblem() [8/13]
◆ setupProblem() [9/13]
◆ setupProblem() [10/13]
◆ setupProblem() [11/13]
[Run problem]
[Read mesh]
[Set up problem]
- Examples
- dynamic_first_order_con_law.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plastic.cpp, plot_base.cpp, and shallow_wave.cpp.
Definition at line 276 of file plastic.cpp.
283 auto get_ents_by_dim = [&](
const auto dim) {
296 auto get_base = [&]() {
297 auto domain_ents = get_ents_by_dim(
SPACE_DIM);
298 if (domain_ents.empty())
316 const auto base = get_base();
327 PetscBool order_edge = PETSC_FALSE;
330 PetscBool order_face = PETSC_FALSE;
333 PetscBool order_volume = PETSC_FALSE;
337 if (order_edge || order_face || order_volume) {
339 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order edge " << order_edge
342 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order face " << order_face
345 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order volume " << order_volume
349 auto ents = get_ents_by_dim(0);
351 ents.merge(get_ents_by_dim(1));
353 ents.merge(get_ents_by_dim(2));
355 ents.merge(get_ents_by_dim(3));
371 auto get_skin = [&]() {
376 CHKERR skin.find_skin(0, body_ents,
false, skin_ents);
380 auto filter_blocks = [&](
auto skin) {
381 bool is_contact_block =
false;
386 (boost::format(
"%s(.*)") %
"CONTACT").str()
395 <<
"Find contact block set: " <<
m->getName();
396 auto meshset =
m->getMeshset();
397 Range contact_meshset_range;
399 meshset,
SPACE_DIM - 1, contact_meshset_range,
true);
402 contact_meshset_range);
403 contact_range.merge(contact_meshset_range);
405 if (is_contact_block) {
407 <<
"Nb entities in contact surface: " << contact_range.size();
409 skin = intersect(skin, contact_range);
414 auto filter_true_skin = [&](
auto skin) {
416 ParallelComm *pcomm =
418 CHKERR pcomm->filter_pstatus(skin, PSTATUS_SHARED | PSTATUS_MULTISHARED,
419 PSTATUS_NOT, -1, &boundary_ents);
420 return boundary_ents;
423 auto boundary_ents = filter_true_skin(filter_blocks(get_skin()));
431 auto project_ho_geometry = [&]() {
435 PetscBool project_geometry = PETSC_TRUE;
437 &project_geometry, PETSC_NULL);
438 if (project_geometry){
439 CHKERR project_ho_geometry();
◆ setupProblem() [12/13]
◆ setupProblem() [13/13]
◆ solveSystem() [1/11]
◆ solveSystem() [2/11]
◆ solveSystem() [3/11]
◆ solveSystem() [4/11]
◆ solveSystem() [5/11]
◆ solveSystem() [6/11]
◆ solveSystem() [7/11]
◆ solveSystem() [8/11]
◆ solveSystem() [9/11]
◆ solveSystem() [10/11]
◆ solveSystem() [11/11]
[Solve]
[Push operators to pipeline]
[Solve]
< Mass matrix
< Linear solver
- Examples
- dynamic_first_order_con_law.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plot_base.cpp, and shallow_wave.cpp.
Definition at line 893 of file dynamic_first_order_con_law.cpp.
898 auto dm =
simple->getDM();
900 auto calculate_stress_ops = [&](
auto &pip) {
903 auto v_ptr = boost::make_shared<MatrixDouble>();
905 auto X_ptr = boost::make_shared<MatrixDouble>();
909 auto x_ptr = boost::make_shared<MatrixDouble>();
913 auto mat_H_tensor_ptr = boost::make_shared<MatrixDouble>();
915 "F", mat_H_tensor_ptr));
917 auto u_ptr = boost::make_shared<MatrixDouble>();
921 auto mat_F_ptr = boost::make_shared<MatrixDouble>();
923 mat_F_ptr, mat_H_tensor_ptr));
925 PetscBool is_linear_elasticity = PETSC_TRUE;
927 &is_linear_elasticity, PETSC_NULL);
929 auto mat_P_ptr = boost::make_shared<MatrixDouble>();
930 if (is_linear_elasticity) {
935 auto inv_F = boost::make_shared<MatrixDouble>();
936 auto det_ptr = boost::make_shared<VectorDouble>();
942 mat_F_ptr, inv_F, det_ptr));
945 auto mat_v_grad_ptr = boost::make_shared<MatrixDouble>();
947 "V", mat_v_grad_ptr));
949 return boost::make_tuple(v_ptr, X_ptr, x_ptr, mat_P_ptr, mat_F_ptr, u_ptr);
952 auto post_proc_boundary = [&]() {
953 auto boundary_post_proc_fe = boost::make_shared<PostProcFaceEle>(
mField);
956 boundary_post_proc_fe->getOpPtrVector(), {},
"GEOMETRY");
960 auto [boundary_v_ptr, boundary_X_ptr, boundary_x_ptr, boundary_mat_P_ptr,
961 boundary_mat_F_ptr, boundary_u_ptr] =
962 calculate_stress_ops(op_loop_side->getOpPtrVector());
963 boundary_post_proc_fe->getOpPtrVector().push_back(op_loop_side);
967 boundary_post_proc_fe->getOpPtrVector().push_back(
971 boundary_post_proc_fe->getPostProcMesh(),
972 boundary_post_proc_fe->getMapGaussPts(),
977 {
"GEOMETRY", boundary_X_ptr},
978 {
"x", boundary_x_ptr},
979 {
"U", boundary_u_ptr}},
982 {
"F", boundary_mat_F_ptr}},
989 return boundary_post_proc_fe;
1003 auto ts_pre_post_proc = boost::make_shared<TSPrePostProc>();
1011 vol_mass_ele->B =
M;
1019 vol_mass_ele->getOpPtrVector().push_back(
new OpMassV(
"V",
"V", get_rho));
1020 vol_mass_ele->getOpPtrVector().push_back(
new OpMassF(
"F",
"F"));
1023 CHKERR MatAssemblyBegin(
M, MAT_FINAL_ASSEMBLY);
1024 CHKERR MatAssemblyEnd(
M, MAT_FINAL_ASSEMBLY);
1027 CHKERR MatGetRowSum(
M, lumpVec);
1030 CHKERR MatDiagonalSet(
M, lumpVec, INSERT_VALUES);
1036 CHKERR KSPSetFromOptions(ksp);
1039 auto solve_boundary_for_g = [&]() {
1041 if (*(pipeline_mng->getBoundaryExplicitRhsFE()->vecAssembleSwitch)) {
1043 CHKERR VecGhostUpdateBegin(pipeline_mng->getBoundaryExplicitRhsFE()->ts_F,
1044 ADD_VALUES, SCATTER_REVERSE);
1045 CHKERR VecGhostUpdateEnd(pipeline_mng->getBoundaryExplicitRhsFE()->ts_F,
1046 ADD_VALUES, SCATTER_REVERSE);
1047 CHKERR VecAssemblyBegin(pipeline_mng->getBoundaryExplicitRhsFE()->ts_F);
1048 CHKERR VecAssemblyEnd(pipeline_mng->getBoundaryExplicitRhsFE()->ts_F);
1049 *(pipeline_mng->getBoundaryExplicitRhsFE()->vecAssembleSwitch) =
false;
1053 CHKERR KSPSolve(ksp, pipeline_mng->getBoundaryExplicitRhsFE()->ts_F,
D);
1054 CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
1055 CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
1056 CHKERR VecCopy(
D, pipeline_mng->getBoundaryExplicitRhsFE()->ts_F);
1062 pipeline_mng->getBoundaryExplicitRhsFE()->postProcessHook =
1063 solve_boundary_for_g;
1066 ts = pipeline_mng->createTSEX(dm);
1069 PetscBool field_eval_flag = PETSC_TRUE;
1070 boost::shared_ptr<MatrixDouble> velocity_field_ptr;
1071 boost::shared_ptr<MatrixDouble> geometry_field_ptr;
1072 boost::shared_ptr<MatrixDouble> spatial_position_field_ptr;
1073 boost::shared_ptr<SetPtsData> field_eval_data;
1075 std::array<double, 3> field_eval_coords = {0.5, 0.5, 5.};
1078 field_eval_coords.data(), &dim,
1081 if (field_eval_flag) {
1086 field_eval_data,
simple->getDomainFEName());
1089 field_eval_data,
simple->getDomainFEName());
1092 field_eval_data->setEvalPoints(field_eval_coords.data(), 1);
1094 auto no_rule = [](
int,
int,
int) {
return -1; };
1096 auto fe_ptr = field_eval_data->feMethodPtr.lock();
1097 fe_ptr->getRuleHook = no_rule;
1098 velocity_field_ptr = boost::make_shared<MatrixDouble>();
1099 geometry_field_ptr = boost::make_shared<MatrixDouble>();
1100 spatial_position_field_ptr = boost::make_shared<MatrixDouble>();
1101 fe_ptr->getOpPtrVector().push_back(
1103 fe_ptr->getOpPtrVector().push_back(
1105 geometry_field_ptr));
1106 fe_ptr->getOpPtrVector().push_back(
1108 "x_2", spatial_position_field_ptr));
1111 auto post_proc_domain = [&]() {
1112 auto post_proc_fe_vol = boost::make_shared<PostProcEle>(
mField);
1116 auto [boundary_v_ptr, boundary_X_ptr, boundary_x_ptr, boundary_mat_P_ptr,
1117 boundary_mat_F_ptr, boundary_u_ptr] =
1118 calculate_stress_ops(post_proc_fe_vol->getOpPtrVector());
1120 post_proc_fe_vol->getOpPtrVector().push_back(
1124 post_proc_fe_vol->getPostProcMesh(),
1125 post_proc_fe_vol->getMapGaussPts(),
1129 {{
"V", boundary_v_ptr},
1130 {
"GEOMETRY", boundary_X_ptr},
1131 {
"x", boundary_x_ptr},
1132 {
"U", boundary_u_ptr}},
1134 {{
"FIRST_PIOLA", boundary_mat_P_ptr}, {
"F", boundary_mat_F_ptr}},
1141 return post_proc_fe_vol;
1144 boost::shared_ptr<FEMethod> null_fe;
1145 auto monitor_ptr = boost::make_shared<Monitor>(
1147 post_proc_boundary(), velocity_field_ptr, spatial_position_field_ptr,
1148 geometry_field_ptr, field_eval_coords, field_eval_data);
1151 null_fe, monitor_ptr);
1155 CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_MATCHSTEP);
1160 CHKERR TSSetSolution(ts, T);
1161 CHKERR TSSetFromOptions(ts);
1169 boost::shared_ptr<ForcesAndSourcesCore>
null;
1172 ptr->fsRawPtr =
this;
1174 CHKERR TSSolve(ts, NULL);
1175 CHKERR TSGetTime(ts, &ftime);
◆ tsSolve()
- Examples
- plastic.cpp.
Definition at line 785 of file plastic.cpp.
794 auto set_section_monitor = [&](
auto solver) {
797 CHKERR TSGetSNES(solver, &snes);
798 CHKERR SNESMonitorSet(snes,
801 (
void *)(snes_ctx_ptr.get()),
nullptr);
805 auto create_post_process_elements = [&]() {
806 auto pp_fe = boost::make_shared<PostProcEle>(
mField);
807 auto &pip = pp_fe->getOpPtrVector();
809 auto push_vol_ops = [
this](
auto &pip) {
813 auto [common_plastic_ptr, common_henky_ptr] =
814 PlasticOps::createCommonPlasticOps<SPACE_DIM, IT, DomainEleOp>(
815 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU", 1., Sev::inform);
817 if (common_henky_ptr) {
818 if (common_plastic_ptr->mGradPtr != common_henky_ptr->matGradPtr)
822 return std::make_pair(common_plastic_ptr, common_henky_ptr);
825 auto push_vol_post_proc_ops = [
this](
auto &pp_fe,
auto &&p) {
828 auto &pip = pp_fe->getOpPtrVector();
830 auto [common_plastic_ptr, common_henky_ptr] = p;
834 auto x_ptr = boost::make_shared<MatrixDouble>();
837 auto u_ptr = boost::make_shared<MatrixDouble>();
846 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
849 common_plastic_ptr->getPlasticSurfacePtr()},
850 {
"PLASTIC_MULTIPLIER",
851 common_plastic_ptr->getPlasticTauPtr()}},
853 {{
"U", u_ptr}, {
"GEOMETRY", x_ptr}},
855 {{
"GRAD", common_henky_ptr->matGradPtr},
856 {
"FIRST_PIOLA", common_henky_ptr->getMatFirstPiolaStress()}},
858 {{
"PLASTIC_STRAIN", common_plastic_ptr->getPlasticStrainPtr()},
859 {
"PLASTIC_FLOW", common_plastic_ptr->getPlasticFlowPtr()}}
871 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
874 common_plastic_ptr->getPlasticSurfacePtr()},
875 {
"PLASTIC_MULTIPLIER",
876 common_plastic_ptr->getPlasticTauPtr()}},
878 {{
"U", u_ptr}, {
"GEOMETRY", x_ptr}},
882 {{
"STRAIN", common_plastic_ptr->mStrainPtr},
883 {
"STRESS", common_plastic_ptr->mStressPtr},
884 {
"PLASTIC_STRAIN", common_plastic_ptr->getPlasticStrainPtr()},
885 {
"PLASTIC_FLOW", common_plastic_ptr->getPlasticFlowPtr()}}
895 auto vol_post_proc = [
this, push_vol_post_proc_ops, push_vol_ops]() {
896 PetscBool post_proc_vol = PETSC_FALSE;
898 &post_proc_vol, PETSC_NULL);
899 if (post_proc_vol == PETSC_FALSE)
900 return boost::shared_ptr<PostProcEle>();
901 auto pp_fe = boost::make_shared<PostProcEle>(
mField);
903 push_vol_post_proc_ops(pp_fe, push_vol_ops(pp_fe->getOpPtrVector())),
904 "push_vol_post_proc_ops");
908 auto skin_post_proc = [
this, push_vol_post_proc_ops, push_vol_ops]() {
909 PetscBool post_proc_skin = PETSC_TRUE;
911 &post_proc_skin, PETSC_NULL);
912 if (post_proc_skin == PETSC_FALSE)
913 return boost::shared_ptr<SkinPostProcEle>();
916 auto pp_fe = boost::make_shared<SkinPostProcEle>(
mField);
919 pp_fe->getOpPtrVector().push_back(op_side);
921 pp_fe, push_vol_ops(op_side->getOpPtrVector())),
922 "push_vol_post_proc_ops");
926 return std::make_pair(vol_post_proc(), skin_post_proc());
929 auto scatter_create = [&](
auto D,
auto coeff) {
931 CHKERR is_manager->isCreateProblemFieldAndRank(
simple->getProblemName(),
932 ROW,
"U", coeff, coeff, is);
934 CHKERR ISGetLocalSize(is, &loc_size);
938 CHKERR VecScatterCreate(
D, is,
v, PETSC_NULL, &scatter);
943 auto set_time_monitor = [&](
auto dm,
auto solver) {
945 boost::shared_ptr<Monitor> monitor_ptr(
948 boost::shared_ptr<ForcesAndSourcesCore>
null;
950 monitor_ptr,
null,
null);
954 auto set_schur_pc = [&](
auto solver,
955 boost::shared_ptr<SetUpSchur> &schur_ptr) {
959 auto name_prb =
simple->getProblemName();
970 for (
auto f : {
"U"}) {
989 CHKERR ISExpand(is_epp, is_tau, &is_union_raw);
993 auto add_sigma_to_is = [&](
auto is_union) {
995 auto add_sigma_to_is_impl = [&]() {
1001 IS is_union_raw_sigma;
1002 CHKERR ISExpand(is_union, is_sigma, &is_union_raw_sigma);
1007 return is_union_sigma;
1009 is_union = add_sigma_to_is(is_union);
1010 #endif // ADD_CONTACT
1021 CHKERR schur_ptr->setUp(solver);
1027 auto dm =
simple->getDM();
1035 auto create_solver = [pip_mng]() {
1037 return pip_mng->createTSIM();
1039 return pip_mng->createTSIM2();
1042 auto solver = create_solver();
1044 auto active_pre_lhs = []() {
1051 auto active_post_lhs = [&]() {
1053 auto get_iter = [&]() {
1058 "Can not get iter");
1062 auto iter = get_iter();
1065 std::array<int, 5> activity_data;
1066 std::fill(activity_data.begin(), activity_data.end(), 0);
1068 activity_data.data(), activity_data.size(), MPI_INT,
1071 int &active_points = activity_data[0];
1072 int &avtive_full_elems = activity_data[1];
1073 int &avtive_elems = activity_data[2];
1074 int &nb_points = activity_data[3];
1075 int &nb_elements = activity_data[4];
1079 double proc_nb_points =
1080 100 *
static_cast<double>(active_points) / nb_points;
1081 double proc_nb_active =
1082 100 *
static_cast<double>(avtive_elems) / nb_elements;
1083 double proc_nb_full_active = 100;
1085 proc_nb_full_active =
1086 100 *
static_cast<double>(avtive_full_elems) / avtive_elems;
1089 "Iter %d nb pts %d nb avtive pts %d (%3.3f\%) nb active "
1091 "(%3.3f\%) nb full active elems %d (%3.3f\%)",
1092 iter, nb_points, active_points, proc_nb_points,
1093 avtive_elems, proc_nb_active, avtive_full_elems,
1094 proc_nb_full_active, iter);
1101 auto add_active_dofs_elem = [&](
auto dm) {
1103 auto fe_pre_proc = boost::make_shared<FEMethod>();
1104 fe_pre_proc->preProcessHook = active_pre_lhs;
1105 auto fe_post_proc = boost::make_shared<FEMethod>();
1106 fe_post_proc->postProcessHook = active_post_lhs;
1108 ts_ctx_ptr->getPreProcessIJacobian().push_front(fe_pre_proc);
1109 ts_ctx_ptr->getPostProcessIJacobian().push_back(fe_post_proc);
1113 auto set_essential_bc = [&](
auto dm,
auto solver) {
1117 auto pre_proc_ptr = boost::make_shared<FEMethod>();
1118 auto post_proc_rhs_ptr = boost::make_shared<FEMethod>();
1119 auto post_proc_lhs_ptr = boost::make_shared<FEMethod>();
1122 auto disp_time_scale = boost::make_shared<TimeScale>();
1124 auto get_bc_hook_rhs = [
this, pre_proc_ptr, disp_time_scale]() {
1126 {disp_time_scale},
false);
1129 pre_proc_ptr->preProcessHook = get_bc_hook_rhs();
1131 auto get_post_proc_hook_rhs = [
this, post_proc_rhs_ptr]() {
1134 mField, post_proc_rhs_ptr,
nullptr, Sev::verbose)();
1136 mField, post_proc_rhs_ptr, 1.)();
1139 auto get_post_proc_hook_lhs = [
this, post_proc_lhs_ptr]() {
1141 mField, post_proc_lhs_ptr, 1.);
1143 post_proc_rhs_ptr->postProcessHook = get_post_proc_hook_rhs;
1146 ts_ctx_ptr->getPreProcessIFunction().push_front(pre_proc_ptr);
1147 ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_ptr);
1148 ts_ctx_ptr->getPostProcessIFunction().push_back(post_proc_rhs_ptr);
1151 CHKERR TSGetSNES(solver, &snes);
1153 CHKERR SNESGetKSP(snes, &ksp);
1155 CHKERR KSPGetPC(ksp, &pc);
1156 PetscBool is_pcfs = PETSC_FALSE;
1157 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
1159 if (is_pcfs == PETSC_FALSE) {
1160 post_proc_lhs_ptr->postProcessHook = get_post_proc_hook_lhs();
1161 ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_lhs_ptr);
1167 CHKERR TSSetSolution(solver,
D);
1169 CHKERR TS2SetSolution(solver,
D, DD);
1172 CHKERR set_section_monitor(solver);
1173 CHKERR set_time_monitor(dm, solver);
1174 CHKERR TSSetFromOptions(solver);
1177 CHKERR add_active_dofs_elem(dm);
1178 boost::shared_ptr<SetUpSchur> schur_ptr;
1179 CHKERR set_schur_pc(solver, schur_ptr);
1180 CHKERR set_essential_bc(dm, solver);
1185 BOOST_LOG_SCOPED_THREAD_ATTR(
"Timeline", attrs::timer());
1186 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSetUp";
1188 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSetUp <= done";
1189 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSolve";
1190 CHKERR TSSolve(solver, NULL);
1191 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSolve <= done";
◆ TSPrePostProc
◆ approxFunction
◆ approxGradVals
boost::shared_ptr<MatrixDouble> Example::approxGradVals |
|
private |
◆ approxVals
boost::shared_ptr<VectorDouble> Example::approxVals |
|
private |
◆ aveMaxMin
std::array< double, Example::BoundingBox::LAST_BB > Example::aveMaxMin |
|
staticprivate |
◆ base
◆ boundaryMarker
boost::shared_ptr< std::vector< unsigned char > > Example::boundaryMarker |
|
private |
◆ commonDataPtr
boost::shared_ptr< CommonData > Example::commonDataPtr |
|
private |
◆ doEvalField
PetscBool Example::doEvalField |
|
private |
◆ domianLhsFEPtr
boost::shared_ptr<FEMethod> Example::domianLhsFEPtr |
|
private |
◆ domianRhsFEPtr
boost::shared_ptr<FEMethod> Example::domianRhsFEPtr |
|
private |
◆ ePS
◆ fieldEvalCoords
◆ fieldEvalData
◆ focalIndex
◆ iI
◆ matDPtr
boost::shared_ptr<MatrixDouble> Example::matDPtr |
|
private |
◆ mField
◆ pinchNodes
Range Example::pinchNodes |
|
private |
◆ reactionFe
boost::shared_ptr<DomainEle> Example::reactionFe |
|
private |
◆ rigidBodyMotion
◆ rZ
std::vector< double > Example::rZ |
|
staticprivate |
◆ savitzkyGolayNormalisation
int Example::savitzkyGolayNormalisation |
|
staticprivate |
◆ savitzkyGolayWeights
const int * Example::savitzkyGolayWeights |
|
staticprivate |
◆ simpleInterface
Simple * Example::simpleInterface |
|
private |
◆ space
◆ uXScatter
◆ uYScatter
◆ uZScatter
◆ vectorFieldPtr
boost::shared_ptr<MatrixDouble> Example::vectorFieldPtr |
|
private |
The documentation for this struct was generated from the following files:
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 0 > OpBodyForce
auto createAOMappingIS(IS isapp, IS ispetsc)
Creates an application mapping using two index sets.
Data on single entity (This is passed as argument to DataOperator::doWork)
static double lhsFlux(const double x, const double y, const double)
PetscBool set_timer
Set timer.
constexpr double omega
Save field DOFS on vertices/tags.
static std::array< double, LAST_BB > aveMaxMin
boost::shared_ptr< FEMethod > & getDomainRhsFE()
#define MYPCOMM_INDEX
default communicator number PCOMM
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMassV
constexpr double shear_modulus_G
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.
Specialization for DisplacementCubitBcData.
OpSetInvJacHcurlFaceImpl< 2 > OpSetInvJacHcurlFace
MoFEMErrorCode setVertexDofs(VertexCoordsFunction lambda, const std::string field_name, Range *verts=nullptr)
Set DOFs on vertices using user function.
MoFEMErrorCode OPs()
[Boundary condition]
FormsIntegrators< DomainEleOp >::Assembly< AssemblyType::PETSC >::LinearForm< IntegrationType::GAUSS >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM > OpGradTimesTensor2
double w(double eqiv, double dot_tau, double f, double sigma_y, double sigma_Y)
PetscErrorCode DMMoFEMAddSubFieldCol(DM dm, const char field_name[])
static std::vector< double > rZ
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Get values at integration pts for tensor filed rank 2, i.e. matrix field.
double young_modulus
Young modulus.
OpSetContravariantPiolaTransformOnFace2DImpl< 2 > OpSetContravariantPiolaTransformOnFace2D
Problem manager is used to build and partition problems.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM *SPACE_DIM > OpMassF
double sigmaY
Yield stress.
FormsIntegrators< DomainEleOp >::Assembly< AssemblyType::PETSC >::LinearForm< IntegrationType::GAUSS >::OpBaseTimesVector< 1, SPACE_DIM *SPACE_DIM, 1 > OpRhsTestPiola
std::map< std::string, boost::shared_ptr< VectorDouble > > DataMapVec
Specialization for DisplacementCubitBcData.
virtual MPI_Comm & get_comm() const =0
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
PetscErrorCode DMMoFEMSetSquareProblem(DM dm, PetscBool square_problem)
set squared problem
const static char *const ApproximationBaseNames[]
@ L2
field with C-1 continuity
constexpr double bulk_modulus_K
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uZScatter
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Get values at integration pts for tensor filed rank 1, i.e. vector field.
static MoFEMErrorCode tsPostStage(TS ts, PetscReal stagetime, PetscInt stageindex, Vec *Y)
[Boundary condition]
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
virtual int get_comm_rank() const =0
Specialization for DisplacementCubitBcData.
PipelineManager interface.
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition of the displacement bc data structure.
boost::shared_ptr< FEMethod > & getBoundaryRhsFE()
Projection of edge entities with one mid-node on hierarchical basis.
auto createKSP(MPI_Comm comm)
PetscBool is_plane_strain
static boost::weak_ptr< TSPrePostProc > tsPrePostProc
SmartPetscObj< TS > createTSIM(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit solver.
Simple interface for fast problem set-up.
int order
Order displacement.
FieldApproximationBase base
auto getDMSubData(DM dm)
Get sub problem data structure.
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
double zeta
Viscous hardening.
int geom_order
Order if fixed.
static boost::shared_ptr< SetUpSchur > createSetUpSchur(MoFEM::Interface &m_field, SmartPetscObj< DM > sub_dm, SmartPetscObj< IS > field_split_it, SmartPetscObj< AO > ao_map)
Create data structure for handling Schur complement.
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
static int savitzkyGolayNormalisation
Deprecated interface functions.
static constexpr int approx_order
Approximate field values for given petsc vector.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpInertiaForce
Get norm of input MatrixDouble for Tensor2.
PetscErrorCode DMCreateMatrix_MoFEM(DM dm, Mat *M)
#define CHKERR
Inline error check.
auto createDMVector(DM dm)
Get smart vector from DM.
Specialization for DisplacementCubitBcData.
virtual moab::Interface & get_moab()=0
static MoFEMErrorCode tsPostStep(TS ts)
constexpr AssemblyType AT
Section manager is used to create indexes and sections.
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
Simple interface for fast problem set-up.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMass
[Only used with Hooke equation (linear material model)]
static std::array< int, 5 > activityData
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
#define MOFEM_LOG_C(channel, severity, format,...)
Get vector field for H-div approximation.
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uXScatter
PetscBool is_quasi_static
Field evaluator interface.
void simple(double P1[], double P2[], double P3[], double c[], const int N)
PetscErrorCode DMMoFEMCreateSubDM(DM subdm, DM dm, const char problem_name[])
Must be called by user to set Sub DM MoFEM data structures.
PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::DomainEle DomainEle
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uYScatter
double C1_k
Kinematic hardening.
Get value at integration points for scalar field.
static double rhsSource(const double x, const double y, const double)
static const int * savitzkyGolayWeights
double poisson_ratio
Poisson ratio.
Modify integration weights on face to take in account higher-order geometry.
DEPRECATED SmartPetscObj< Vec > smartVectorDuplicate(Vec vec)
constexpr AssemblyType A
[Define dimension]
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesScalar< 2 > OpHdivU
static std::pair< int, int > getCoordsInImage(double x, double y)
constexpr int SPACE_DIM
[Define dimension]
MoFEMErrorCode setDomainRhsIntegrationRule(RuleHookFun rule)
Get norm of input MatrixDouble for Tensor1.
auto type_from_handle(const EntityHandle h)
get type from entity handle
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpDomainSource
double visH
Viscous hardening.
SeverityLevel
Severity levels.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
VectorShallowArrayAdaptor< double > VectorAdaptor
FTensor::Index< 'i', SPACE_DIM > i
std::map< std::string, boost::shared_ptr< MatrixDouble > > DataMapMat
static int window_savitzky_golay
constexpr auto field_name
constexpr double young_modulus
Add operators pushing bases from local to physical configuration.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
double b_iso
Saturation exponent.
const double v
phase velocity of light in medium (cm/ns)
boost::shared_ptr< FEMethod > & getDomainLhsFE()
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define MOFEM_LOG(channel, severity)
Log.
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
boost::shared_ptr< MatrixDouble > matDPtr
MoFEMErrorCode bC()
[Create common data]
PetscBool is_large_strains
Large strains.
MoFEMErrorCode setupProblem()
[Run problem]
constexpr FieldSpace CONTACT_SPACE
FTensor::Index< 'j', 3 > j
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.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 3, 3 > OpHdivHdiv
const FTensor::Tensor2< T, Dim, Dim > Vec
@ MOFEM_DATA_INCONSISTENCY
int ep_order
Order of ep files.
Interface for managing meshsets containing materials and boundary conditions.
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
double Qinf
Saturation yield stress.
MoFEMErrorCode MoFEMSNESMonitorFields(SNES snes, PetscInt its, PetscReal fgnorm, SnesCtx *snes_ctx)
Sens monitor printing residual field by field.
static std::vector< MatrixInt > iI
static MoFEMErrorCode tsPreStep(TS ts)
const double D
diffusivity
MoFEM::Interface & mField
FTensor::Index< 'm', 3 > m
Kronecker Delta class symmetric.
@ MOFEM_ATOM_TEST_INVALID
boost::shared_ptr< DomainEle > reactionFe
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
Make Hdiv space from Hcurl space in 2d.
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[])
MoFEMErrorCode createCommonData()
[Set up problem]
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
FTensor::Index< 'k', 3 > k
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
boost::shared_ptr< CommonData > commonDataPtr
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ HDIV
field with continuous normal traction
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
int tau_order
Order of tau files.
constexpr double poisson_ratio
Element used to execute operators on side of the element.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
FTensor::Index< 'l', 3 > l
Post post-proc data at points from hash maps.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)