|
| 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/15]
◆ Example() [2/15]
◆ Example() [3/15]
◆ Example() [4/15]
◆ Example() [5/15]
◆ Example() [6/15]
◆ Example() [7/15]
◆ Example() [8/15]
◆ Example() [9/15]
◆ Example() [10/15]
◆ Example() [11/15]
◆ Example() [12/15]
◆ Example() [13/15]
◆ Example() [14/15]
◆ Example() [15/15]
◆ 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, 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/3]
◆ bC() [2/3]
[Create common data]
[Boundary condition]
- Examples
- plastic.cpp.
Definition at line 504 of file plastic.cpp.
511 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_X",
513 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Y",
515 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Z",
517 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
518 "REMOVE_ALL",
"U", 0, 3);
521 for (
auto b : {
"FIX_X",
"REMOVE_X"})
522 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
523 "SIGMA", 0, 0,
false,
true);
524 for (
auto b : {
"FIX_Y",
"REMOVE_Y"})
525 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
526 "SIGMA", 1, 1,
false,
true);
527 for (
auto b : {
"FIX_Z",
"REMOVE_Z"})
528 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
529 "SIGMA", 2, 2,
false,
true);
530 for (
auto b : {
"FIX_ALL",
"REMOVE_ALL"})
531 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
532 "SIGMA", 0, 3,
false,
true);
533 CHKERR bc_mng->removeBlockDOFsOnEntities(
534 simple->getProblemName(),
"NO_CONTACT",
"SIGMA", 0, 3,
false,
true);
538 simple->getProblemName(),
"U");
540 auto &bc_map = bc_mng->getBcMapByBlockName();
541 for (
auto bc : bc_map)
542 MOFEM_LOG(
"PLASTICITY", Sev::verbose) <<
"Marker " << bc.first;
◆ bC() [3/3]
◆ 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, 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/9]
◆ createCommonData() [2/9]
◆ createCommonData() [3/9]
◆ createCommonData() [4/9]
◆ createCommonData() [5/9]
◆ createCommonData() [6/9]
◆ createCommonData() [7/9]
[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 396 of file plastic.cpp.
399 auto get_command_line_parameters = [&]() {
424 PetscBool tau_order_is_set;
427 PetscBool ep_order_is_set;
440 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Hardening " <<
H;
441 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Viscous hardening " <<
visH;
442 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Saturation yield stress " <<
Qinf;
443 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Saturation exponent " <<
b_iso;
444 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Kinematic hardening " <<
C1_k;
449 if (tau_order_is_set == PETSC_FALSE)
451 if (ep_order_is_set == PETSC_FALSE)
454 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Approximation order " <<
order;
456 <<
"Ep approximation order " <<
ep_order;
458 <<
"Tau approximation order " <<
tau_order;
460 <<
"Geometry approximation order " <<
geom_order;
462 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Density " <<
rho;
465 PetscBool is_scale = PETSC_TRUE;
479 #endif // ADD_CONTACT
489 CHKERR get_command_line_parameters();
493 sdfPythonPtr = boost::make_shared<ContactOps::SDFPython>();
494 CHKERR sdfPythonPtr->sdfInit(
"sdf.py");
495 ContactOps::sdfPythonWeakPtr = sdfPythonPtr;
497 #endif // ADD_CONTACT
◆ createCommonData() [8/9]
◆ createCommonData() [9/9]
◆ 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]
Definition at line 384 of file nonlinear_elastic.cpp.
388 auto dm =
simple->getDM();
394 CHKERR VecNorm(T, NORM_2, &nrm2);
395 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Solution norm " << nrm2;
397 auto post_proc_norm_fe = boost::make_shared<DomainEle>(
mField);
399 auto post_proc_norm_rule_hook = [](
int,
int,
int p) ->
int {
return 2 * p; };
400 post_proc_norm_fe->getRuleHook = post_proc_norm_rule_hook;
403 post_proc_norm_fe->getOpPtrVector(), {H1});
405 enum NORMS { U_NORM_L2 = 0, PIOLA_NORM, LAST_NORM };
409 CHKERR VecZeroEntries(norms_vec);
411 auto u_ptr = boost::make_shared<MatrixDouble>();
412 post_proc_norm_fe->getOpPtrVector().push_back(
415 post_proc_norm_fe->getOpPtrVector().push_back(
418 auto common_ptr = commonDataFactory<SPACE_DIM, GAUSS, DomainEleOp>(
419 mField, post_proc_norm_fe->getOpPtrVector(),
"U",
"MAT_ELASTIC",
422 post_proc_norm_fe->getOpPtrVector().push_back(
424 common_ptr->getMatFirstPiolaStress(), norms_vec, PIOLA_NORM));
429 CHKERR VecAssemblyBegin(norms_vec);
430 CHKERR VecAssemblyEnd(norms_vec);
435 CHKERR VecGetArrayRead(norms_vec, &norms);
437 <<
"norm_u: " << std::scientific << std::sqrt(norms[U_NORM_L2]);
439 <<
"norm_piola: " << std::scientific << std::sqrt(norms[PIOLA_NORM]);
440 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/3]
◆ OPs() [2/3]
[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 549 of file plastic.cpp.
555 auto integration_rule_bc = [](
int,
int,
int ao) {
return 2 * ao; };
559 auto add_boundary_ops_lhs_mechanical = [&](
auto &pip) {
568 pip,
mField,
"U", Sev::inform);
572 ContactOps::opFactoryBoundaryLhs<SPACE_DIM, AT, GAUSS, BoundaryEleOp>(
575 ContactOps::opFactoryBoundaryToDomainLhs<SPACE_DIM, AT, IT, DomainEle>(
576 mField, pip,
simple->getDomainFEName(),
"SIGMA",
"U",
"GEOMETRY",
578 #endif // ADD_CONTACT
583 auto add_boundary_ops_rhs_mechanical = [&](
auto &pip) {
592 pip,
mField,
"U", {boost::make_shared<ScaledTimeScale>()}, Sev::inform);
595 CHKERR ContactOps::opFactoryBoundaryRhs<SPACE_DIM, AT, IT, BoundaryEleOp>(
597 #endif // ADD_CONTACT
602 auto add_domain_ops_lhs = [
this](
auto &pip) {
614 auto get_inertia_and_mass_damping = [
this](
const double,
const double,
618 return (
rho /
scale) * fe_domain_lhs->ts_aa +
621 pip.push_back(
new OpMass(
"U",
"U", get_inertia_and_mass_damping));
624 CHKERR PlasticOps::opFactoryDomainLhs<SPACE_DIM, AT, IT, DomainEleOp>(
625 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU");
630 auto add_domain_ops_rhs = [
this](
auto &pip) {
638 {boost::make_shared<ScaledTimeScale>(
"body_force_hist.txt")},
646 AT>::LinearForm<IT>::OpBaseTimesVector<1,
SPACE_DIM, 1>;
649 auto mat_acceleration = boost::make_shared<MatrixDouble>();
651 "U", mat_acceleration));
653 new OpInertiaForce(
"U", mat_acceleration, [](
double,
double,
double) {
657 auto mat_velocity = boost::make_shared<MatrixDouble>();
661 new OpInertiaForce(
"U", mat_velocity, [](
double,
double,
double) {
667 CHKERR PlasticOps::opFactoryDomainRhs<SPACE_DIM, AT, IT, DomainEleOp>(
668 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU");
671 CHKERR ContactOps::opFactoryDomainRhs<SPACE_DIM, AT, IT, DomainEleOp>(
673 #endif // ADD_CONTACT
678 CHKERR add_domain_ops_lhs(pip_mng->getOpDomainLhsPipeline());
679 CHKERR add_domain_ops_rhs(pip_mng->getOpDomainRhsPipeline());
682 CHKERR add_boundary_ops_lhs_mechanical(pip_mng->getOpBoundaryLhsPipeline());
683 CHKERR add_boundary_ops_rhs_mechanical(pip_mng->getOpBoundaryRhsPipeline());
685 CHKERR pip_mng->setDomainRhsIntegrationRule(vol_rule);
686 CHKERR pip_mng->setDomainLhsIntegrationRule(vol_rule);
688 CHKERR pip_mng->setBoundaryLhsIntegrationRule(integration_rule_bc);
689 CHKERR pip_mng->setBoundaryRhsIntegrationRule(integration_rule_bc);
691 auto create_reaction_pipeline = [&](
auto &pip) {
695 CHKERR PlasticOps::opFactoryDomainReactions<SPACE_DIM, AT, IT, DomainEleOp>(
696 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU");
◆ OPs() [3/3]
◆ 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]
◆ 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/15]
◆ runProblem() [2/15]
◆ runProblem() [3/15]
◆ runProblem() [4/15]
◆ runProblem() [5/15]
◆ runProblem() [6/15]
◆ runProblem() [7/15]
◆ runProblem() [8/15]
◆ runProblem() [9/15]
◆ runProblem() [10/15]
◆ runProblem() [11/15]
◆ runProblem() [12/15]
◆ runProblem() [13/15]
◆ runProblem() [14/15]
◆ runProblem() [15/15]
◆ 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/14]
◆ setupProblem() [2/14]
◆ setupProblem() [3/14]
◆ setupProblem() [4/14]
◆ setupProblem() [5/14]
◆ setupProblem() [6/14]
◆ setupProblem() [7/14]
◆ setupProblem() [8/14]
◆ setupProblem() [9/14]
◆ setupProblem() [10/14]
◆ setupProblem() [11/14]
[Run problem]
[Read mesh]
[Set up problem]
- Examples
- dynamic_first_order_con_law.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, phase.cpp, plastic.cpp, plot_base.cpp, and shallow_wave.cpp.
Definition at line 225 of file plastic.cpp.
232 auto get_ents_by_dim = [&](
const auto dim) {
245 auto get_base = [&]() {
246 auto domain_ents = get_ents_by_dim(
SPACE_DIM);
247 if (domain_ents.empty())
265 const auto base = get_base();
276 PetscBool order_edge = PETSC_FALSE;
279 PetscBool order_face = PETSC_FALSE;
282 PetscBool order_volume = PETSC_FALSE;
286 if (order_edge || order_face || order_volume) {
288 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order edge " << order_edge
291 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order face " << order_face
294 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order volume " << order_volume
298 auto ents = get_ents_by_dim(0);
300 ents.merge(get_ents_by_dim(1));
302 ents.merge(get_ents_by_dim(2));
304 ents.merge(get_ents_by_dim(3));
320 auto get_skin = [&]() {
325 CHKERR skin.find_skin(0, body_ents,
false, skin_ents);
329 auto filter_blocks = [&](
auto skin) {
330 bool is_contact_block =
false;
335 (boost::format(
"%s(.*)") %
"CONTACT").str()
344 <<
"Find contact block set: " <<
m->getName();
345 auto meshset =
m->getMeshset();
346 Range contact_meshset_range;
348 meshset,
SPACE_DIM - 1, contact_meshset_range,
true);
351 contact_meshset_range);
352 contact_range.merge(contact_meshset_range);
354 if (is_contact_block) {
356 <<
"Nb entities in contact surface: " << contact_range.size();
358 skin = intersect(skin, contact_range);
363 auto filter_true_skin = [&](
auto skin) {
365 ParallelComm *pcomm =
367 CHKERR pcomm->filter_pstatus(skin, PSTATUS_SHARED | PSTATUS_MULTISHARED,
368 PSTATUS_NOT, -1, &boundary_ents);
369 return boundary_ents;
372 auto boundary_ents = filter_true_skin(filter_blocks(get_skin()));
380 auto project_ho_geometry = [&]() {
384 PetscBool project_geometry = PETSC_TRUE;
386 &project_geometry, PETSC_NULL);
387 if (project_geometry) {
388 CHKERR project_ho_geometry();
◆ setupProblem() [12/14]
◆ setupProblem() [13/14]
◆ setupProblem() [14/14]
◆ 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, 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() [1/2]
- Examples
- plastic.cpp.
Definition at line 734 of file plastic.cpp.
743 auto set_section_monitor = [&](
auto solver) {
746 CHKERR TSGetSNES(solver, &snes);
747 CHKERR SNESMonitorSet(snes,
750 (
void *)(snes_ctx_ptr.get()),
nullptr);
754 auto create_post_process_elements = [&]() {
755 auto pp_fe = boost::make_shared<PostProcEle>(
mField);
756 auto &pip = pp_fe->getOpPtrVector();
758 auto push_vol_ops = [
this](
auto &pip) {
762 auto [common_plastic_ptr, common_henky_ptr] =
763 PlasticOps::createCommonPlasticOps<SPACE_DIM, IT, DomainEleOp>(
764 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU", 1., Sev::inform);
766 if (common_henky_ptr) {
767 if (common_plastic_ptr->mGradPtr != common_henky_ptr->matGradPtr)
771 return std::make_pair(common_plastic_ptr, common_henky_ptr);
774 auto push_vol_post_proc_ops = [
this](
auto &pp_fe,
auto &&p) {
777 auto &pip = pp_fe->getOpPtrVector();
779 auto [common_plastic_ptr, common_henky_ptr] = p;
783 auto x_ptr = boost::make_shared<MatrixDouble>();
786 auto u_ptr = boost::make_shared<MatrixDouble>();
795 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
798 common_plastic_ptr->getPlasticSurfacePtr()},
799 {
"PLASTIC_MULTIPLIER",
800 common_plastic_ptr->getPlasticTauPtr()}},
802 {{
"U", u_ptr}, {
"GEOMETRY", x_ptr}},
804 {{
"GRAD", common_henky_ptr->matGradPtr},
805 {
"FIRST_PIOLA", common_henky_ptr->getMatFirstPiolaStress()}},
807 {{
"PLASTIC_STRAIN", common_plastic_ptr->getPlasticStrainPtr()},
808 {
"PLASTIC_FLOW", common_plastic_ptr->getPlasticFlowPtr()}}
820 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
823 common_plastic_ptr->getPlasticSurfacePtr()},
824 {
"PLASTIC_MULTIPLIER",
825 common_plastic_ptr->getPlasticTauPtr()}},
827 {{
"U", u_ptr}, {
"GEOMETRY", x_ptr}},
831 {{
"STRAIN", common_plastic_ptr->mStrainPtr},
832 {
"STRESS", common_plastic_ptr->mStressPtr},
833 {
"PLASTIC_STRAIN", common_plastic_ptr->getPlasticStrainPtr()},
834 {
"PLASTIC_FLOW", common_plastic_ptr->getPlasticFlowPtr()}}
844 auto vol_post_proc = [
this, push_vol_post_proc_ops, push_vol_ops]() {
845 PetscBool post_proc_vol = PETSC_FALSE;
847 &post_proc_vol, PETSC_NULL);
848 if (post_proc_vol == PETSC_FALSE)
849 return boost::shared_ptr<PostProcEle>();
850 auto pp_fe = boost::make_shared<PostProcEle>(
mField);
852 push_vol_post_proc_ops(pp_fe, push_vol_ops(pp_fe->getOpPtrVector())),
853 "push_vol_post_proc_ops");
857 auto skin_post_proc = [
this, push_vol_post_proc_ops, push_vol_ops]() {
858 PetscBool post_proc_skin = PETSC_TRUE;
860 &post_proc_skin, PETSC_NULL);
861 if (post_proc_skin == PETSC_FALSE)
862 return boost::shared_ptr<SkinPostProcEle>();
865 auto pp_fe = boost::make_shared<SkinPostProcEle>(
mField);
868 pp_fe->getOpPtrVector().push_back(op_side);
870 pp_fe, push_vol_ops(op_side->getOpPtrVector())),
871 "push_vol_post_proc_ops");
875 return std::make_pair(vol_post_proc(), skin_post_proc());
878 auto scatter_create = [&](
auto D,
auto coeff) {
880 CHKERR is_manager->isCreateProblemFieldAndRank(
simple->getProblemName(),
881 ROW,
"U", coeff, coeff, is);
883 CHKERR ISGetLocalSize(is, &loc_size);
887 CHKERR VecScatterCreate(
D, is,
v, PETSC_NULL, &scatter);
892 auto set_time_monitor = [&](
auto dm,
auto solver) {
894 boost::shared_ptr<Monitor> monitor_ptr(
897 boost::shared_ptr<ForcesAndSourcesCore>
null;
899 monitor_ptr,
null,
null);
903 auto set_schur_pc = [&](
auto solver,
904 boost::shared_ptr<SetUpSchur> &schur_ptr) {
908 auto name_prb =
simple->getProblemName();
919 for (
auto f : {
"U"}) {
937 for (
auto f : {
"SIGMA",
"EP",
"TAU"}) {
942 for (
auto f : {
"EP",
"TAU"}) {
961 auto get_nested_mat_data = [&](
auto schur_dm,
auto block_dm) {
967 {simple->getDomainFEName(),
983 {simple->getBoundaryFEName(),
985 {{
"SIGMA",
"SIGMA"}, {
"U",
"SIGMA"}, {
"SIGMA",
"U"}
995 {dm_schur, dm_block}, block_mat_data,
997 {
"SIGMA",
"EP",
"TAU"}, {
nullptr,
nullptr,
nullptr}, true
1004 auto get_nested_mat_data = [&](
auto schur_dm,
auto block_dm) {
1005 auto block_mat_data =
1008 {{simple->getDomainFEName(),
1025 {dm_schur, dm_block}, block_mat_data,
1027 {
"EP",
"TAU"}, {
nullptr,
nullptr}, false
1034 auto nested_mat_data = get_nested_mat_data(dm_schur, dm_block);
1037 auto block_is =
getDMSubData(dm_block)->getSmartRowIs();
1038 auto ao_schur =
getDMSubData(dm_schur)->getSmartRowMap();
1044 CHKERR schur_ptr->setUp(solver);
1050 auto dm =
simple->getDM();
1058 auto create_solver = [pip_mng]() {
1060 return pip_mng->createTSIM();
1062 return pip_mng->createTSIM2();
1065 auto solver = create_solver();
1067 auto active_pre_lhs = []() {
1074 auto active_post_lhs = [&]() {
1076 auto get_iter = [&]() {
1081 "Can not get iter");
1085 auto iter = get_iter();
1088 std::array<int, 5> activity_data;
1089 std::fill(activity_data.begin(), activity_data.end(), 0);
1091 activity_data.data(), activity_data.size(), MPI_INT,
1094 int &active_points = activity_data[0];
1095 int &avtive_full_elems = activity_data[1];
1096 int &avtive_elems = activity_data[2];
1097 int &nb_points = activity_data[3];
1098 int &nb_elements = activity_data[4];
1102 double proc_nb_points =
1103 100 *
static_cast<double>(active_points) / nb_points;
1104 double proc_nb_active =
1105 100 *
static_cast<double>(avtive_elems) / nb_elements;
1106 double proc_nb_full_active = 100;
1108 proc_nb_full_active =
1109 100 *
static_cast<double>(avtive_full_elems) / avtive_elems;
1112 "Iter %d nb pts %d nb avtive pts %d (%3.3f\%) nb active "
1114 "(%3.3f\%) nb full active elems %d (%3.3f\%)",
1115 iter, nb_points, active_points, proc_nb_points,
1116 avtive_elems, proc_nb_active, avtive_full_elems,
1117 proc_nb_full_active, iter);
1124 auto add_active_dofs_elem = [&](
auto dm) {
1126 auto fe_pre_proc = boost::make_shared<FEMethod>();
1127 fe_pre_proc->preProcessHook = active_pre_lhs;
1128 auto fe_post_proc = boost::make_shared<FEMethod>();
1129 fe_post_proc->postProcessHook = active_post_lhs;
1131 ts_ctx_ptr->getPreProcessIJacobian().push_front(fe_pre_proc);
1132 ts_ctx_ptr->getPostProcessIJacobian().push_back(fe_post_proc);
1136 auto set_essential_bc = [&](
auto dm,
auto solver) {
1140 auto pre_proc_ptr = boost::make_shared<FEMethod>();
1141 auto post_proc_rhs_ptr = boost::make_shared<FEMethod>();
1142 auto post_proc_lhs_ptr = boost::make_shared<FEMethod>();
1145 auto disp_time_scale = boost::make_shared<TimeScale>();
1147 auto get_bc_hook_rhs = [
this, pre_proc_ptr, disp_time_scale]() {
1149 {disp_time_scale},
false);
1152 pre_proc_ptr->preProcessHook = get_bc_hook_rhs();
1154 auto get_post_proc_hook_rhs = [
this, post_proc_rhs_ptr]() {
1157 mField, post_proc_rhs_ptr,
nullptr, Sev::verbose)();
1159 mField, post_proc_rhs_ptr, 1.)();
1162 auto get_post_proc_hook_lhs = [
this, post_proc_lhs_ptr]() {
1164 mField, post_proc_lhs_ptr, 1.);
1166 post_proc_rhs_ptr->postProcessHook = get_post_proc_hook_rhs;
1169 ts_ctx_ptr->getPreProcessIFunction().push_front(pre_proc_ptr);
1170 ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_ptr);
1171 ts_ctx_ptr->getPostProcessIFunction().push_back(post_proc_rhs_ptr);
1172 post_proc_lhs_ptr->postProcessHook = get_post_proc_hook_lhs();
1173 ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_lhs_ptr);
1179 CHKERR TSSetSolution(solver,
D);
1181 CHKERR TS2SetSolution(solver,
D, DD);
1184 CHKERR set_section_monitor(solver);
1185 CHKERR set_time_monitor(dm, solver);
1186 CHKERR TSSetFromOptions(solver);
1189 CHKERR add_active_dofs_elem(dm);
1190 boost::shared_ptr<SetUpSchur> schur_ptr;
1191 CHKERR set_schur_pc(solver, schur_ptr);
1192 CHKERR set_essential_bc(dm, solver);
1197 BOOST_LOG_SCOPED_THREAD_ATTR(
"Timeline", attrs::timer());
1198 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSetUp";
1200 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSetUp <= done";
1201 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSolve";
1202 CHKERR TSSolve(solver, NULL);
1203 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSolve <= done";
◆ tsSolve() [2/2]
◆ 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 reference 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
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
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.
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.
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
static int savitzkyGolayNormalisation
Deprecated interface functions.
Approximate field values for given petsc vector.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpInertiaForce
boost::shared_ptr< DomainEle > reactionFe
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.
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.
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)
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uZScatter
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.
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
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.
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
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uYScatter
static MoFEMErrorCode tsPreStep(TS ts)
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uXScatter
const double D
diffusivity
MoFEM::Interface & mField
FTensor::Index< 'm', 3 > m
Kronecker Delta class symmetric.
@ MOFEM_ATOM_TEST_INVALID
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
MoFEMErrorCode DMMoFEMSetNestSchurData(DM dm, boost::shared_ptr< NestSchurData >)
boost::shared_ptr< BlockStructure > createBlockMatStructure(DM dm, SchurFEOpsFEandFields schur_fe_op_vec)
Create a Mat Diag Blocks object.
#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
static boost::shared_ptr< SetUpSchur > createSetUpSchur(MoFEM::Interface &m_field)
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)