|
| 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, 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 512 of file plastic.cpp.
518 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_X",
520 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Y",
522 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
"REMOVE_Z",
524 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(),
525 "REMOVE_ALL",
"U", 0, 3);
528 for (
auto b : {
"FIX_X",
"REMOVE_X"})
529 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
530 "SIGMA", 0, 0,
false,
true);
531 for (
auto b : {
"FIX_Y",
"REMOVE_Y"})
532 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
533 "SIGMA", 1, 1,
false,
true);
534 for (
auto b : {
"FIX_Z",
"REMOVE_Z"})
535 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
536 "SIGMA", 2, 2,
false,
true);
537 for (
auto b : {
"FIX_ALL",
"REMOVE_ALL"})
538 CHKERR bc_mng->removeBlockDOFsOnEntities(
simple->getProblemName(), b,
539 "SIGMA", 0, 3,
false,
true);
540 CHKERR bc_mng->removeBlockDOFsOnEntities(
541 simple->getProblemName(),
"NO_CONTACT",
"SIGMA", 0, 3,
false,
true);
545 simple->getProblemName(),
"U");
547 auto &bc_map = bc_mng->getBcMapByBlockName();
548 for (
auto bc : bc_map)
549 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, 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 404 of file plastic.cpp.
407 auto get_command_line_parameters = [&]() {
432 PetscBool tau_order_is_set;
435 PetscBool ep_order_is_set;
448 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Hardening " <<
H;
449 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Viscous hardening " <<
visH;
450 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Saturation yield stress " <<
Qinf;
451 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Saturation exponent " <<
b_iso;
452 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Kinematic hardening " <<
C1_k;
457 if (tau_order_is_set == PETSC_FALSE)
459 if (ep_order_is_set == PETSC_FALSE)
462 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Approximation order " <<
order;
464 <<
"Ep approximation order " <<
ep_order;
466 <<
"Tau approximation order " <<
tau_order;
468 <<
"Geometry approximation order " <<
geom_order;
470 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Density " <<
rho;
473 PetscBool is_scale = PETSC_TRUE;
487 #endif // ADD_CONTACT
497 CHKERR get_command_line_parameters();
501 sdfPythonPtr = boost::make_shared<ContactOps::SDFPython>();
502 CHKERR sdfPythonPtr->sdfInit(
"sdf.py");
503 ContactOps::sdfPythonWeakPtr = sdfPythonPtr;
505 #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]
Definition at line 381 of file nonlinear_elastic.cpp.
385 auto dm =
simple->getDM();
391 CHKERR VecNorm(T, NORM_2, &nrm2);
392 MOFEM_LOG(
"EXAMPLE", Sev::inform) <<
"Solution norm " << nrm2;
394 auto post_proc_norm_fe = boost::make_shared<DomainEle>(
mField);
396 auto post_proc_norm_rule_hook = [](
int,
int,
int p) ->
int {
return 2 * p; };
397 post_proc_norm_fe->getRuleHook = post_proc_norm_rule_hook;
400 post_proc_norm_fe->getOpPtrVector(), {H1});
402 enum NORMS { U_NORM_L2 = 0, PIOLA_NORM, LAST_NORM };
406 CHKERR VecZeroEntries(norms_vec);
408 auto u_ptr = boost::make_shared<MatrixDouble>();
409 post_proc_norm_fe->getOpPtrVector().push_back(
412 post_proc_norm_fe->getOpPtrVector().push_back(
415 auto common_ptr = commonDataFactory<SPACE_DIM, GAUSS, DomainEleOp>(
416 mField, post_proc_norm_fe->getOpPtrVector(),
"U",
"MAT_ELASTIC",
419 post_proc_norm_fe->getOpPtrVector().push_back(
421 common_ptr->getMatFirstPiolaStress(), norms_vec, PIOLA_NORM));
426 CHKERR VecAssemblyBegin(norms_vec);
427 CHKERR VecAssemblyEnd(norms_vec);
432 CHKERR VecGetArrayRead(norms_vec, &norms);
434 <<
"norm_u: " << std::scientific << std::sqrt(norms[U_NORM_L2]);
436 <<
"norm_piola: " << std::scientific << std::sqrt(norms[PIOLA_NORM]);
437 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 556 of file plastic.cpp.
560 auto integration_rule_bc = [](
int,
int,
int ao) {
return 2 * ao; };
564 auto add_boundary_ops_lhs_mechanical = [&](
auto &pip) {
573 pip,
mField,
"U", Sev::inform);
578 ContactOps::opFactoryBoundaryLhs<SPACE_DIM, AT, GAUSS, BoundaryEleOp>(
581 ContactOps::opFactoryBoundaryToDomainLhs<SPACE_DIM, AT, IT, DomainEle>(
582 mField, pip,
simple->getDomainFEName(),
"SIGMA",
"U",
"GEOMETRY",
584 #endif // ADD_CONTACT
589 auto add_boundary_ops_rhs_mechanical = [&](
auto &pip) {
598 pip,
mField,
"U", {boost::make_shared<ScaledTimeScale>()}, Sev::inform);
601 CHKERR ContactOps::opFactoryBoundaryRhs<SPACE_DIM, AT, IT, BoundaryEleOp>(
603 #endif // ADD_CONTACT
608 auto add_domain_ops_lhs = [
this](
auto &pip) {
620 auto get_inertia_and_mass_damping = [
this](
const double,
const double,
624 return (
rho /
scale) * fe_domain_lhs->ts_aa +
627 pip.push_back(
new OpMass(
"U",
"U", get_inertia_and_mass_damping));
630 CHKERR PlasticOps::opFactoryDomainLhs<SPACE_DIM, AT, IT, DomainEleOp>(
631 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU");
636 auto add_domain_ops_rhs = [
this](
auto &pip) {
644 {boost::make_shared<ScaledTimeScale>(
"body_force_hist.txt")},
652 AT>::LinearForm<IT>::OpBaseTimesVector<1,
SPACE_DIM, 1>;
655 auto mat_acceleration = boost::make_shared<MatrixDouble>();
657 "U", mat_acceleration));
659 new OpInertiaForce(
"U", mat_acceleration, [](
double,
double,
double) {
663 auto mat_velocity = boost::make_shared<MatrixDouble>();
667 new OpInertiaForce(
"U", mat_velocity, [](
double,
double,
double) {
673 CHKERR PlasticOps::opFactoryDomainRhs<SPACE_DIM, AT, IT, DomainEleOp>(
674 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU");
677 CHKERR ContactOps::opFactoryDomainRhs<SPACE_DIM, AT, IT, DomainEleOp>(
679 #endif // ADD_CONTACT
684 CHKERR add_domain_ops_lhs(pip_mng->getOpDomainLhsPipeline());
685 CHKERR add_domain_ops_rhs(pip_mng->getOpDomainRhsPipeline());
688 CHKERR add_boundary_ops_lhs_mechanical(pip_mng->getOpBoundaryLhsPipeline());
689 CHKERR add_boundary_ops_rhs_mechanical(pip_mng->getOpBoundaryRhsPipeline());
691 CHKERR pip_mng->setDomainRhsIntegrationRule(vol_rule);
692 CHKERR pip_mng->setDomainLhsIntegrationRule(vol_rule);
694 CHKERR pip_mng->setBoundaryLhsIntegrationRule(integration_rule_bc);
695 CHKERR pip_mng->setBoundaryRhsIntegrationRule(integration_rule_bc);
697 auto create_reaction_pipeline = [&](
auto &pip) {
701 CHKERR PlasticOps::opFactoryDomainReactions<SPACE_DIM, AT, IT, DomainEleOp>(
702 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]
◆ 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, phase.cpp, plastic.cpp, plot_base.cpp, and shallow_wave.cpp.
Definition at line 233 of file plastic.cpp.
240 auto get_ents_by_dim = [&](
const auto dim) {
253 auto get_base = [&]() {
254 auto domain_ents = get_ents_by_dim(
SPACE_DIM);
255 if (domain_ents.empty())
273 const auto base = get_base();
284 PetscBool order_edge = PETSC_FALSE;
287 PetscBool order_face = PETSC_FALSE;
290 PetscBool order_volume = PETSC_FALSE;
294 if (order_edge || order_face || order_volume) {
296 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order edge " << order_edge
299 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order face " << order_face
302 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Order volume " << order_volume
306 auto ents = get_ents_by_dim(0);
308 ents.merge(get_ents_by_dim(1));
310 ents.merge(get_ents_by_dim(2));
312 ents.merge(get_ents_by_dim(3));
328 auto get_skin = [&]() {
333 CHKERR skin.find_skin(0, body_ents,
false, skin_ents);
337 auto filter_blocks = [&](
auto skin) {
338 bool is_contact_block =
true;
343 (boost::format(
"%s(.*)") %
"CONTACT").str()
352 <<
"Find contact block set: " <<
m->getName();
353 auto meshset =
m->getMeshset();
354 Range contact_meshset_range;
356 meshset,
SPACE_DIM - 1, contact_meshset_range,
true);
359 contact_meshset_range);
360 contact_range.merge(contact_meshset_range);
362 if (is_contact_block) {
364 <<
"Nb entities in contact surface: " << contact_range.size();
366 skin = intersect(skin, contact_range);
371 auto filter_true_skin = [&](
auto skin) {
373 ParallelComm *pcomm =
375 CHKERR pcomm->filter_pstatus(skin, PSTATUS_SHARED | PSTATUS_MULTISHARED,
376 PSTATUS_NOT, -1, &boundary_ents);
377 return boundary_ents;
380 auto boundary_ents = filter_true_skin(filter_blocks(get_skin()));
388 auto project_ho_geometry = [&]() {
392 PetscBool project_geometry = PETSC_TRUE;
394 &project_geometry, PETSC_NULL);
395 if (project_geometry) {
396 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, 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);
◆ testOperators()
[Solve]
[TestOperators]
- Examples
- plastic.cpp.
Definition at line 1214 of file plastic.cpp.
1224 constexpr
double eps = 1e-9;
1226 auto x = opt->setRandomFields(
simple->getDM(), {
1228 {
"U", {-1e-6, 1e-6}},
1230 {
"EP", {-1e-6, 1e-6}},
1236 auto dot_x_plastic_active =
1237 opt->setRandomFields(
simple->getDM(), {
1246 auto diff_x_plastic_active =
1247 opt->setRandomFields(
simple->getDM(), {
1257 auto dot_x_elastic =
1258 opt->setRandomFields(
simple->getDM(), {
1267 auto diff_x_elastic =
1268 opt->setRandomFields(
simple->getDM(), {
1278 auto test_domain_ops = [&](
auto fe_name,
auto lhs_pipeline,
auto rhs_pipeline,
1279 auto dot_x,
auto diff_x) {
1282 auto diff_res = opt->checkCentralFiniteDifference(
1283 simple->getDM(), fe_name, rhs_pipeline, lhs_pipeline, x, dot_x,
1289 CHKERR VecNorm(diff_res, NORM_2, &fnorm);
1291 "Test consistency of tangent matrix %3.4e", fnorm);
1293 constexpr
double err = 1e-5;
1296 "Norm of directional derivative too large err = %3.4e", fnorm);
1301 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Elastic active";
1302 CHKERR test_domain_ops(
simple->getDomainFEName(), pip->getDomainLhsFE(),
1303 pip->getDomainRhsFE(), dot_x_elastic, diff_x_elastic);
1305 MOFEM_LOG(
"PLASTICITY", Sev::inform) <<
"Plastic active";
1306 CHKERR test_domain_ops(
simple->getDomainFEName(), pip->getDomainLhsFE(),
1307 pip->getDomainRhsFE(), dot_x_plastic_active,
1308 diff_x_plastic_active);
◆ tsSolve()
- Examples
- plastic.cpp.
Definition at line 740 of file plastic.cpp.
749 auto set_section_monitor = [&](
auto solver) {
752 CHKERR TSGetSNES(solver, &snes);
753 CHKERR SNESMonitorSet(snes,
756 (
void *)(snes_ctx_ptr.get()),
nullptr);
760 auto create_post_process_elements = [&]() {
761 auto pp_fe = boost::make_shared<PostProcEle>(
mField);
763 auto push_vol_ops = [
this](
auto &pip) {
767 auto [common_plastic_ptr, common_hencky_ptr] =
768 PlasticOps::createCommonPlasticOps<SPACE_DIM, IT, DomainEleOp>(
769 mField,
"MAT_PLASTIC", pip,
"U",
"EP",
"TAU", 1., Sev::inform);
771 if (common_hencky_ptr) {
772 if (common_plastic_ptr->mGradPtr != common_hencky_ptr->matGradPtr)
776 return std::make_pair(common_plastic_ptr, common_hencky_ptr);
779 auto push_vol_post_proc_ops = [
this](
auto &pp_fe,
auto &&p) {
782 auto &pip = pp_fe->getOpPtrVector();
784 auto [common_plastic_ptr, common_hencky_ptr] = p;
788 auto x_ptr = boost::make_shared<MatrixDouble>();
791 auto u_ptr = boost::make_shared<MatrixDouble>();
800 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
803 common_plastic_ptr->getPlasticSurfacePtr()},
804 {
"PLASTIC_MULTIPLIER",
805 common_plastic_ptr->getPlasticTauPtr()}},
807 {{
"U", u_ptr}, {
"GEOMETRY", x_ptr}},
809 {{
"GRAD", common_hencky_ptr->matGradPtr},
810 {
"FIRST_PIOLA", common_hencky_ptr->getMatFirstPiolaStress()}},
812 {{
"PLASTIC_STRAIN", common_plastic_ptr->getPlasticStrainPtr()},
813 {
"PLASTIC_FLOW", common_plastic_ptr->getPlasticFlowPtr()}}
825 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
828 common_plastic_ptr->getPlasticSurfacePtr()},
829 {
"PLASTIC_MULTIPLIER",
830 common_plastic_ptr->getPlasticTauPtr()}},
832 {{
"U", u_ptr}, {
"GEOMETRY", x_ptr}},
836 {{
"STRAIN", common_plastic_ptr->mStrainPtr},
837 {
"STRESS", common_plastic_ptr->mStressPtr},
838 {
"PLASTIC_STRAIN", common_plastic_ptr->getPlasticStrainPtr()},
839 {
"PLASTIC_FLOW", common_plastic_ptr->getPlasticFlowPtr()}}
849 auto vol_post_proc = [
this, push_vol_post_proc_ops, push_vol_ops]() {
850 PetscBool post_proc_vol = PETSC_FALSE;
852 &post_proc_vol, PETSC_NULL);
853 if (post_proc_vol == PETSC_FALSE)
854 return boost::shared_ptr<PostProcEle>();
855 auto pp_fe = boost::make_shared<PostProcEle>(
mField);
857 push_vol_post_proc_ops(pp_fe, push_vol_ops(pp_fe->getOpPtrVector())),
858 "push_vol_post_proc_ops");
862 auto skin_post_proc = [
this, push_vol_post_proc_ops, push_vol_ops]() {
863 PetscBool post_proc_skin = PETSC_TRUE;
865 &post_proc_skin, PETSC_NULL);
866 if (post_proc_skin == PETSC_FALSE)
867 return boost::shared_ptr<SkinPostProcEle>();
870 auto pp_fe = boost::make_shared<SkinPostProcEle>(
mField);
873 pp_fe->getOpPtrVector().push_back(op_side);
875 pp_fe, push_vol_ops(op_side->getOpPtrVector())),
876 "push_vol_post_proc_ops");
880 return std::make_pair(vol_post_proc(), skin_post_proc());
883 auto scatter_create = [&](
auto D,
auto coeff) {
885 CHKERR is_manager->isCreateProblemFieldAndRank(
simple->getProblemName(),
886 ROW,
"U", coeff, coeff, is);
888 CHKERR ISGetLocalSize(is, &loc_size);
892 CHKERR VecScatterCreate(
D, is,
v, PETSC_NULL, &scatter);
897 auto set_time_monitor = [&](
auto dm,
auto solver) {
899 boost::shared_ptr<Monitor> monitor_ptr(
902 boost::shared_ptr<ForcesAndSourcesCore>
null;
904 monitor_ptr,
null,
null);
908 auto set_schur_pc = [&](
auto solver,
909 boost::shared_ptr<SetUpSchur> &schur_ptr) {
912 auto name_prb =
simple->getProblemName();
923 for (
auto f : {
"U"}) {
941 for (
auto f : {
"SIGMA",
"EP",
"TAU"}) {
946 for (
auto f : {
"EP",
"TAU"}) {
965 auto get_nested_mat_data = [&](
auto schur_dm,
auto block_dm) {
971 {simple->getDomainFEName(),
987 {simple->getBoundaryFEName(),
989 {{
"SIGMA",
"SIGMA"}, {
"U",
"SIGMA"}, {
"SIGMA",
"U"}
999 {dm_schur, dm_block}, block_mat_data,
1001 {
"SIGMA",
"EP",
"TAU"}, {
nullptr,
nullptr,
nullptr}, true
1008 auto get_nested_mat_data = [&](
auto schur_dm,
auto block_dm) {
1009 auto block_mat_data =
1012 {{simple->getDomainFEName(),
1029 {dm_schur, dm_block}, block_mat_data,
1031 {
"EP",
"TAU"}, {
nullptr,
nullptr}, false
1038 auto nested_mat_data = get_nested_mat_data(dm_schur, dm_block);
1041 auto block_is =
getDMSubData(dm_block)->getSmartRowIs();
1042 auto ao_schur =
getDMSubData(dm_schur)->getSmartRowMap();
1048 CHKERR schur_ptr->setUp(solver);
1054 auto dm =
simple->getDM();
1062 auto create_solver = [pip_mng]() {
1064 return pip_mng->createTSIM();
1066 return pip_mng->createTSIM2();
1069 auto solver = create_solver();
1071 auto active_pre_lhs = []() {
1078 auto active_post_lhs = [&]() {
1080 auto get_iter = [&]() {
1085 "Can not get iter");
1089 auto iter = get_iter();
1092 std::array<int, 5> activity_data;
1093 std::fill(activity_data.begin(), activity_data.end(), 0);
1095 activity_data.data(), activity_data.size(), MPI_INT,
1098 int &active_points = activity_data[0];
1099 int &avtive_full_elems = activity_data[1];
1100 int &avtive_elems = activity_data[2];
1101 int &nb_points = activity_data[3];
1102 int &nb_elements = activity_data[4];
1106 double proc_nb_points =
1107 100 *
static_cast<double>(active_points) / nb_points;
1108 double proc_nb_active =
1109 100 *
static_cast<double>(avtive_elems) / nb_elements;
1110 double proc_nb_full_active = 100;
1112 proc_nb_full_active =
1113 100 *
static_cast<double>(avtive_full_elems) / avtive_elems;
1116 "Iter %d nb pts %d nb active pts %d (%3.3f\%) nb active "
1118 "(%3.3f\%) nb full active elems %d (%3.3f\%)",
1119 iter, nb_points, active_points, proc_nb_points,
1120 avtive_elems, proc_nb_active, avtive_full_elems,
1121 proc_nb_full_active, iter);
1128 auto add_active_dofs_elem = [&](
auto dm) {
1130 auto fe_pre_proc = boost::make_shared<FEMethod>();
1131 fe_pre_proc->preProcessHook = active_pre_lhs;
1132 auto fe_post_proc = boost::make_shared<FEMethod>();
1133 fe_post_proc->postProcessHook = active_post_lhs;
1135 ts_ctx_ptr->getPreProcessIJacobian().push_front(fe_pre_proc);
1136 ts_ctx_ptr->getPostProcessIJacobian().push_back(fe_post_proc);
1140 auto set_essential_bc = [&](
auto dm,
auto solver) {
1144 auto pre_proc_ptr = boost::make_shared<FEMethod>();
1145 auto post_proc_rhs_ptr = boost::make_shared<FEMethod>();
1146 auto post_proc_lhs_ptr = boost::make_shared<FEMethod>();
1149 auto disp_time_scale = boost::make_shared<TimeScale>();
1151 auto get_bc_hook_rhs = [
this, pre_proc_ptr, disp_time_scale]() {
1153 {disp_time_scale},
false);
1156 pre_proc_ptr->preProcessHook = get_bc_hook_rhs();
1158 auto get_post_proc_hook_rhs = [
this, post_proc_rhs_ptr]() {
1161 mField, post_proc_rhs_ptr,
nullptr, Sev::verbose)();
1163 mField, post_proc_rhs_ptr, 1.)();
1166 auto get_post_proc_hook_lhs = [
this, post_proc_lhs_ptr]() {
1168 mField, post_proc_lhs_ptr, 1.);
1170 post_proc_rhs_ptr->postProcessHook = get_post_proc_hook_rhs;
1173 ts_ctx_ptr->getPreProcessIFunction().push_front(pre_proc_ptr);
1174 ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_ptr);
1175 ts_ctx_ptr->getPostProcessIFunction().push_back(post_proc_rhs_ptr);
1176 post_proc_lhs_ptr->postProcessHook = get_post_proc_hook_lhs();
1177 ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_lhs_ptr);
1183 CHKERR TSSetSolution(solver,
D);
1185 CHKERR TS2SetSolution(solver,
D, DD);
1188 CHKERR set_section_monitor(solver);
1189 CHKERR set_time_monitor(dm, solver);
1190 CHKERR TSSetFromOptions(solver);
1193 CHKERR add_active_dofs_elem(dm);
1194 boost::shared_ptr<SetUpSchur> schur_ptr;
1195 CHKERR set_schur_pc(solver, schur_ptr);
1196 CHKERR set_essential_bc(dm, solver);
1201 BOOST_LOG_SCOPED_THREAD_ATTR(
"Timeline", attrs::timer());
1202 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSetUp";
1204 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSetUp <= done";
1205 MOFEM_LOG(
"TIMER", Sev::verbose) <<
"TSSolve";
1206 CHKERR TSSolve(solver, NULL);
1207 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 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
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.
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
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
Calculate directional derivative of the right hand side and compare it with tangent matrix derivative...
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.
MoFEMErrorCode testOperators()
[Solve]
#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
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.
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)