v0.15.0
Loading...
Searching...
No Matches
nonlinear_elastic.cpp
Go to the documentation of this file.
1/**
2 * \file nonlinear_elastic.cpp
3 * \example nonlinear_elastic.cpp
4 *
5 * Plane stress elastic dynamic problem
6 *
7 */
8
9#include <MoFEM.hpp>
10#include <MatrixFunction.hpp>
11
12using namespace MoFEM;
13
14constexpr int SPACE_DIM =
15 EXECUTABLE_DIMENSION; //< Space dimension of problem, mesh
16
21using DomainEleOp = DomainEle::UserDataOperator;
22using BoundaryEleOp = BoundaryEle::UserDataOperator;
23
28
32
33template <int DIM> struct PostProcEleByDim;
34
35template <> struct PostProcEleByDim<2> {
39};
40
41template <> struct PostProcEleByDim<3> {
45};
46
52
53#include <HenckyOps.hpp>
54using namespace HenckyOps;
55
56struct Example {
57
58 Example(MoFEM::Interface &m_field) : mField(m_field) {}
59
61
62private:
64 boost::shared_ptr<DomainEle> reactionFe;
65
74};
75
76//! [Run problem]
88}
89//! [Run problem]
90
91//! [Read mesh]
96 CHKERR simple->loadFile();
98}
99//! [Read mesh]
100
101//! [Set up problem]
105
106 enum bases { AINSWORTH, DEMKOWICZ, LASBASETOPT };
107 const char *list_bases[LASBASETOPT] = {"ainsworth", "demkowicz"};
108 PetscInt choice_base_value = AINSWORTH;
109 CHKERR PetscOptionsGetEList(PETSC_NULLPTR, NULL, "-base", list_bases,
110 LASBASETOPT, &choice_base_value, PETSC_NULLPTR);
111
113 switch (choice_base_value) {
114 case AINSWORTH:
116 MOFEM_LOG("WORLD", Sev::inform)
117 << "Set AINSWORTH_LEGENDRE_BASE for displacements";
118 break;
119 case DEMKOWICZ:
121 MOFEM_LOG("WORLD", Sev::inform)
122 << "Set DEMKOWICZ_JACOBI_BASE for displacements";
123 break;
124 default:
125 base = LASTBASE;
126 break;
127 }
128
129 // Add field
130 CHKERR simple->addDomainField("U", H1, base, SPACE_DIM);
131 CHKERR simple->addBoundaryField("U", H1, base, SPACE_DIM);
132 int order = 2;
133 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-order", &order, PETSC_NULLPTR);
134 CHKERR simple->setFieldOrder("U", order);
135 CHKERR simple->setUp();
137}
138//! [Set up problem]
139
140//! [Boundary condition]
143 auto *pipeline_mng = mField.getInterface<PipelineManager>();
145 auto bc_mng = mField.getInterface<BcManager>();
146 auto time_scale = boost::make_shared<TimeScale>();
147
148 auto integration_rule = [](int, int, int approx_order) {
149 return 2 * (approx_order - 1);
150 };
151
152 CHKERR pipeline_mng->setDomainRhsIntegrationRule(integration_rule);
153 CHKERR pipeline_mng->setDomainLhsIntegrationRule(integration_rule);
154 CHKERR pipeline_mng->setBoundaryRhsIntegrationRule(integration_rule);
155
156 reactionFe = boost::make_shared<DomainEle>(mField);
157 reactionFe->getRuleHook = integration_rule;
158
160 pipeline_mng->getOpBoundaryRhsPipeline(), mField, "U", {time_scale},
161 "FORCE", Sev::inform);
162
163 //! [Define gravity vector]
165 pipeline_mng->getOpDomainRhsPipeline(), mField, "U", {time_scale},
166 "BODY_FORCE", Sev::inform);
167
168 // Essential BC
169 CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_X",
170 "U", 0, 0);
171 CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_Y",
172 "U", 1, 1);
173 CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_Z",
174 "U", 2, 2);
175 CHKERR bc_mng->pushMarkDOFsOnEntities<DisplacementCubitBcData>(
176 simple->getProblemName(), "U");
177
179}
180//! [Boundary condition]
181
182//! [Push operators to pipeline]
185 auto *pipeline_mng = mField.getInterface<PipelineManager>();
186
187 auto add_domain_ops_lhs = [&](auto &pip) {
190 CHKERR HenckyOps::opFactoryDomainLhs<SPACE_DIM, PETSC, GAUSS, DomainEleOp>(
191 mField, pip, "U", "MAT_ELASTIC", Sev::inform);
193 };
194
195 auto add_domain_ops_rhs = [&](auto &pip) {
198 CHKERR HenckyOps::opFactoryDomainRhs<SPACE_DIM, PETSC, GAUSS, DomainEleOp>(
199 mField, pip, "U", "MAT_ELASTIC", Sev::inform);
201 };
202
203 CHKERR add_domain_ops_lhs(pipeline_mng->getOpDomainLhsPipeline());
204 CHKERR add_domain_ops_rhs(pipeline_mng->getOpDomainRhsPipeline());
205
206 // push operators to reaction pipeline
207 CHKERR add_domain_ops_rhs(reactionFe->getOpPtrVector());
208 reactionFe->postProcessHook =
210
212}
213//! [Push operators to pipeline]
214
215/**
216 * @brief Monitor solution
217 *
218 * This functions is called by TS solver at the end of each step. It is used
219 * to output results to the hard drive.
220 */
221struct Monitor : public FEMethod {
223 std::pair<boost::shared_ptr<PostProcEleDomain>,
224 boost::shared_ptr<PostProcEleBdy>>
225 pair_post_proc,
226 boost::shared_ptr<DomainEle> reaction_fe)
227 : dM(dm), postProcDomain(pair_post_proc.first), postProcSkin(pair_post_proc.second),
228 reactionFe(reaction_fe) {
229 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-save_every", &saveEvery,
230 PETSC_NULLPTR);
231 }
234
235 auto make_vtk = [&]() {
237 if (postProcDomain) {
240 CHKERR postProcDomain->writeFile(
241 "out_step_" + boost::lexical_cast<std::string>(ts_step) + ".h5m");
242 }
243 if (postProcSkin) {
246 CHKERR postProcSkin->writeFile(
247 "out_skin_" + boost::lexical_cast<std::string>(ts_step) + ".h5m");
248 }
250 };
251
252 auto calculate_reaction = [&]() {
254 auto r = createDMVector(dM);
255 reactionFe->f = r;
256 CHKERR VecZeroEntries(r);
259 };
260
261 if (!(ts_step % saveEvery)) {
262 CHKERR make_vtk();
263 }
264 if (reactionFe)
265 CHKERR calculate_reaction();
266
268 }
269
270private:
272 boost::shared_ptr<PostProcEleDomain> postProcDomain;
273 boost::shared_ptr<PostProcEleBdy> postProcSkin;
274 boost::shared_ptr<DomainEle> reactionFe;
275 PetscInt saveEvery = 1;
276};
277
278//! [Solve]
281 auto *simple = mField.getInterface<Simple>();
282 auto *pipeline_mng = mField.getInterface<PipelineManager>();
283
284 auto dm = simple->getDM();
285 auto ts = pipeline_mng->createTSIM();
286
287 PetscBool post_proc_vol;
288 PetscBool post_proc_skin;
289
290 if constexpr (SPACE_DIM == 2) {
291 post_proc_vol = PETSC_TRUE;
292 post_proc_skin = PETSC_FALSE;
293 } else {
294 post_proc_vol = PETSC_FALSE;
295 post_proc_skin = PETSC_TRUE;
296 }
297 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "", "-post_proc_vol", &post_proc_vol,
298 PETSC_NULLPTR);
299 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "", "-post_proc_skin", &post_proc_skin,
300 PETSC_NULLPTR);
301
302 // Setup postprocessing
303 auto create_post_proc_fe = [dm, this, simple, post_proc_vol,
304 post_proc_skin]() {
305 auto post_proc_ele_domain = [dm, this](auto &pip_domain) {
307 auto common_ptr = commonDataFactory<SPACE_DIM, GAUSS, DomainEleOp>(
308 mField, pip_domain, "U", "MAT_ELASTIC", Sev::inform);
309 return common_ptr;
310 };
311
312 auto post_proc_map = [this](auto &pip, auto u_ptr, auto common_ptr) {
314
316
317 pip->getOpPtrVector().push_back(
318
319 new OpPPMap(pip->getPostProcMesh(), pip->getMapGaussPts(), {},
320 {{"U", u_ptr}},
321 {{"GRAD", common_ptr->matGradPtr},
322 {"FIRST_PIOLA", common_ptr->getMatFirstPiolaStress()}},
323 {}));
325 };
326
327 auto push_post_proc_bdy = [dm, this, simple, post_proc_skin,
328 &post_proc_ele_domain,
329 &post_proc_map](auto &pip_bdy) {
330 if (post_proc_skin == PETSC_FALSE)
331 return boost::shared_ptr<PostProcEleBdy>();
332
333 auto u_ptr = boost::make_shared<MatrixDouble>();
334 pip_bdy->getOpPtrVector().push_back(
336 auto op_loop_side =
337 new OpLoopSide<SideEle>(mField, simple->getDomainFEName(), SPACE_DIM);
338 auto common_ptr = post_proc_ele_domain(op_loop_side->getOpPtrVector());
339 pip_bdy->getOpPtrVector().push_back(op_loop_side);
340
341 CHKERR post_proc_map(pip_bdy, u_ptr, common_ptr);
342
343 return pip_bdy;
344 };
345
346 auto push_post_proc_domain = [dm, this, simple, post_proc_vol,
347 &post_proc_ele_domain,
348 &post_proc_map](auto &pip_domain) {
349 if (post_proc_vol == PETSC_FALSE)
350 return boost::shared_ptr<PostProcEleDomain>();
351
352 auto u_ptr = boost::make_shared<MatrixDouble>();
353 pip_domain->getOpPtrVector().push_back(
355 auto common_ptr = post_proc_ele_domain(pip_domain->getOpPtrVector());
356
357 CHKERR post_proc_map(pip_domain, u_ptr, common_ptr);
358
359 return pip_domain;
360 };
361
362 auto post_proc_fe_domain = boost::make_shared<PostProcEleDomain>(mField);
363 auto post_proc_fe_bdy = boost::make_shared<PostProcEleBdy>(mField);
364
365 return std::make_pair(push_post_proc_domain(post_proc_fe_domain),
366 push_post_proc_bdy(post_proc_fe_bdy));
367 };
368
369 auto add_extra_finite_elements_to_ksp_solver_pipelines = [&]() {
371
372 auto pre_proc_ptr = boost::make_shared<FEMethod>();
373 auto post_proc_rhs_ptr = boost::make_shared<FEMethod>();
374 auto post_proc_lhs_ptr = boost::make_shared<FEMethod>();
375
376 auto time_scale = boost::make_shared<TimeScale>();
377
378 auto get_bc_hook_rhs = [this, pre_proc_ptr, time_scale]() {
381 {time_scale}, false)();
383 };
384
385 pre_proc_ptr->preProcessHook = get_bc_hook_rhs;
386
387 auto get_post_proc_hook_rhs = [this, post_proc_rhs_ptr]() {
390 mField, post_proc_rhs_ptr, nullptr, Sev::verbose)();
392 mField, post_proc_rhs_ptr, 1.)();
394 };
395 auto get_post_proc_hook_lhs = [this, post_proc_lhs_ptr]() {
398 mField, post_proc_lhs_ptr, 1.)();
400 };
401 post_proc_rhs_ptr->postProcessHook = get_post_proc_hook_rhs;
402 post_proc_lhs_ptr->postProcessHook = get_post_proc_hook_lhs;
403
404 // This is low level pushing finite elements (pipelines) to solver
405 auto ts_ctx_ptr = getDMTsCtx(simple->getDM());
406 ts_ctx_ptr->getPreProcessIFunction().push_front(pre_proc_ptr);
407 ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_ptr);
408 ts_ctx_ptr->getPostProcessIFunction().push_back(post_proc_rhs_ptr);
409 ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_lhs_ptr);
411 };
412
413 // Add extra finite elements to SNES solver pipelines to resolve essential
414 // boundary conditions
415 CHKERR add_extra_finite_elements_to_ksp_solver_pipelines();
416
417 auto create_monitor_fe = [dm](auto &&post_proc_fe, auto &&reactionFe) {
418 return boost::make_shared<Monitor>(dm, post_proc_fe, reactionFe);
419 };
420
421 // Set monitor which postprocessing results and saves them to the hard drive
422 boost::shared_ptr<FEMethod> null_fe;
423 auto monitor_ptr = create_monitor_fe(create_post_proc_fe(), reactionFe);
424 CHKERR DMMoFEMTSSetMonitor(dm, ts, simple->getDomainFEName(), null_fe,
425 null_fe, monitor_ptr);
426
427 // Set time solver
428 double ftime = 1;
429 CHKERR TSSetMaxTime(ts, ftime);
430 CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_MATCHSTEP);
431
432 auto B = createDMMatrix(dm);
433 CHKERR TSSetI2Jacobian(ts, B, B, PETSC_NULLPTR, PETSC_NULLPTR);
434 auto D = createDMVector(simple->getDM());
435 CHKERR TSSetSolution(ts, D);
436 CHKERR TSSetFromOptions(ts);
437
438 CHKERR TSSolve(ts, NULL);
439 CHKERR TSGetTime(ts, &ftime);
440
441 PetscInt steps, snesfails, rejects, nonlinits, linits;
442 CHKERR TSGetStepNumber(ts, &steps);
443 CHKERR TSGetSNESFailures(ts, &snesfails);
444 CHKERR TSGetStepRejections(ts, &rejects);
445 CHKERR TSGetSNESIterations(ts, &nonlinits);
446 CHKERR TSGetKSPIterations(ts, &linits);
447 MOFEM_LOG_C("EXAMPLE", Sev::inform,
448 "steps %d (%d rejected, %d SNES fails), ftime %g, nonlinits "
449 "%d, linits %d",
450 steps, rejects, snesfails, ftime, nonlinits, linits);
451
453}
454//! [Solve]
455
456//! [Getting norms]
459
461 auto dm = simple->getDM();
462
463 auto T = createDMVector(simple->getDM());
464 CHKERR DMoFEMMeshToLocalVector(simple->getDM(), T, INSERT_VALUES,
465 SCATTER_FORWARD);
466 double nrm2;
467 CHKERR VecNorm(T, NORM_2, &nrm2);
468 MOFEM_LOG("EXAMPLE", Sev::inform) << "Solution norm " << nrm2;
469
470 auto post_proc_norm_fe = boost::make_shared<DomainEle>(mField);
471
472 auto post_proc_norm_rule_hook = [](int, int, int p) -> int { return 2 * p; };
473 post_proc_norm_fe->getRuleHook = post_proc_norm_rule_hook;
474
476 post_proc_norm_fe->getOpPtrVector(), {H1});
477
478 enum NORMS { U_NORM_L2 = 0, PIOLA_NORM, LAST_NORM };
479 auto norms_vec =
481 (mField.get_comm_rank() == 0) ? LAST_NORM : 0, LAST_NORM);
482 CHKERR VecZeroEntries(norms_vec);
483
484 auto u_ptr = boost::make_shared<MatrixDouble>();
485 post_proc_norm_fe->getOpPtrVector().push_back(
487
488 post_proc_norm_fe->getOpPtrVector().push_back(
489 new OpCalcNormL2Tensor1<SPACE_DIM>(u_ptr, norms_vec, U_NORM_L2));
490
491 auto common_ptr = commonDataFactory<SPACE_DIM, GAUSS, DomainEleOp>(
492 mField, post_proc_norm_fe->getOpPtrVector(), "U", "MAT_ELASTIC",
493 Sev::inform);
494
495 post_proc_norm_fe->getOpPtrVector().push_back(
497 common_ptr->getMatFirstPiolaStress(), norms_vec, PIOLA_NORM));
498
500 post_proc_norm_fe);
501
502 CHKERR VecAssemblyBegin(norms_vec);
503 CHKERR VecAssemblyEnd(norms_vec);
504
505 MOFEM_LOG_CHANNEL("SELF"); // Clear channel from old tags
506 if (mField.get_comm_rank() == 0) {
507 const double *norms;
508 CHKERR VecGetArrayRead(norms_vec, &norms);
509 MOFEM_TAG_AND_LOG("SELF", Sev::inform, "example")
510 << "norm_u: " << std::scientific << std::sqrt(norms[U_NORM_L2]);
511 MOFEM_TAG_AND_LOG("SELF", Sev::inform, "example")
512 << "norm_piola: " << std::scientific << std::sqrt(norms[PIOLA_NORM]);
513 CHKERR VecRestoreArrayRead(norms_vec, &norms);
514 }
515
517}
518//! [Getting norms]
519
520//! [Postprocessing results]
523 PetscInt test_nb = 0;
524 PetscBool test_flg = PETSC_FALSE;
525 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-test", &test_nb, &test_flg);
526
527 if (test_flg) {
529 auto T = createDMVector(simple->getDM());
530 CHKERR DMoFEMMeshToLocalVector(simple->getDM(), T, INSERT_VALUES,
531 SCATTER_FORWARD);
532 double nrm2;
533 CHKERR VecNorm(T, NORM_2, &nrm2);
534 MOFEM_LOG("EXAMPLE", Sev::verbose) << "Regression norm " << nrm2;
535 double regression_value = 0;
536 switch (test_nb) {
537 case 1:
538 regression_value = 1.02789;
539 break;
540 case 2:
541 regression_value = 1.8841e+00;
542 break;
543 case 3:
544 regression_value = 1.8841e+00;
545 break;
546 case 4: // just links
547 regression_value = 4.9625e+00;
548 break;
549 case 5: // link master
550 regression_value = 6.6394e+00;
551 break;
552 case 6: // link master swap
553 regression_value = 4.98764e+00;
554 break;
555 case 7: // link Y
556 regression_value = 4.9473e+00;
557 break;
558 case 8: // link_3D_repr
559 regression_value = 2.5749e-01;
560 break;
561
562 default:
563 SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID, "Wrong test number.");
564 break;
565 }
566 if (fabs(nrm2 - regression_value) > 1e-2)
567 SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
568 "Regression test field; wrong norm value. %6.4e != %6.4e", nrm2,
569 regression_value);
570 }
572}
573//! [Postprocessing results]
574
575//! [Check]
579}
580//! [Check]
581
582static char help[] = "...\n\n";
583
584int main(int argc, char *argv[]) {
585
586 // Initialisation of MoFEM/PETSc and MOAB data structures
587 const char param_file[] = "param_file.petsc";
588 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
589
590 // Add logging channel for example
591 auto core_log = logging::core::get();
592 core_log->add_sink(
594 LogManager::setLog("EXAMPLE");
595 MOFEM_LOG_TAG("EXAMPLE", "example");
596
597 try {
598
599 //! [Register MoFEM discrete manager in PETSc]
600 DMType dm_name = "DMMOFEM";
601 CHKERR DMRegister_MoFEM(dm_name);
602 //! [Register MoFEM discrete manager in PETSc
603
604 //! [Create MoAB]
605 moab::Core mb_instance; ///< mesh database
606 moab::Interface &moab = mb_instance; ///< mesh database interface
607 //! [Create MoAB]
608
609 //! [Create MoFEM]
610 MoFEM::Core core(moab); ///< finite element database
611 MoFEM::Interface &m_field = core; ///< finite element database interface
612 //! [Create MoFEM]
613
614 //! [Example]
615 Example ex(m_field);
616 CHKERR ex.runProblem();
617 //! [Example]
618 }
620
622}
#define MOFEM_LOG_C(channel, severity, format,...)
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
int main()
constexpr int SPACE_DIM
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
#define CATCH_ERRORS
Catch errors.
FieldApproximationBase
approximation base
Definition definitions.h:58
@ LASTBASE
Definition definitions.h:69
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition definitions.h:60
@ DEMKOWICZ_JACOBI_BASE
Definition definitions.h:66
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ H1
continuous field
Definition definitions.h:85
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
constexpr int order
PostProcEleByDim< SPACE_DIM >::PostProcEleDomain PostProcEleDomain
PostProcEleByDim< SPACE_DIM >::PostProcEleBdy PostProcEleBdy
auto integration_rule
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition DMMoFEM.cpp:514
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition DMMoFEM.cpp:576
auto createDMVector(DM dm)
Get smart vector from DM.
Definition DMMoFEM.hpp:1102
auto createDMMatrix(DM dm)
Get smart matrix from DM.
Definition DMMoFEM.hpp:1059
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
double D
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
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.
Definition DMMoFEM.cpp:1046
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition DMMoFEM.hpp:1144
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
#define EXECUTABLE_DIMENSION
Definition plastic.cpp:13
ElementsAndOps< SPACE_DIM >::SideEle SideEle
Definition plastic.cpp:61
static constexpr int approx_order
[Example]
Definition plastic.cpp:216
MoFEMErrorCode boundaryCondition()
MoFEMErrorCode assembleSystem()
MoFEMErrorCode readMesh()
boost::shared_ptr< DomainEle > reactionFe
Definition plastic.cpp:235
FieldApproximationBase base
Definition plot_base.cpp:68
MoFEMErrorCode checkResults()
MoFEMErrorCode solveSystem()
Example(MoFEM::Interface &m_field)
MoFEMErrorCode runProblem()
MoFEMErrorCode gettingNorms()
[Solve]
MoFEM::Interface & mField
Definition plastic.cpp:226
MoFEMErrorCode setupProblem()
MoFEMErrorCode outputResults()
Add operators pushing bases from local to physical configuration.
boost::weak_ptr< CacheTuple > getCacheWeakPtr() const
Get the cache weak ptr object.
Simple interface for fast problem set-up.
Definition BcManager.hpp:29
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
Core (interface) class.
Definition Core.hpp:82
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:72
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:112
Deprecated interface functions.
Definition of the displacement bc data structure.
Definition BCData.hpp:72
Data on single entity (This is passed as argument to DataOperator::doWork)
Class (Function) to enforce essential constrains on the left hand side diagonal.
Definition Essential.hpp:33
Class (Function) to enforce essential constrains on the right hand side diagonal.
Definition Essential.hpp:41
Class (Function) to calculate residual side diagonal.
Definition Essential.hpp:49
Class (Function) to enforce essential constrains.
Definition Essential.hpp:25
structure for User Loop Methods on finite elements
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Assembly methods.
Definition Natural.hpp:65
Get norm of input MatrixDouble for Tensor1.
Get norm of input MatrixDouble for Tensor2.
Get values at integration pts for tensor field rank 1, i.e. vector field.
Element used to execute operators on side of the element.
Post post-proc data at points from hash maps.
PipelineManager interface.
Simple interface for fast problem set-up.
Definition Simple.hpp:27
MoFEMErrorCode getOptions()
get options
Definition Simple.cpp:180
const std::string getDomainFEName() const
Get the Domain FE Name.
Definition Simple.hpp:387
intrusive_ptr for managing petsc objects
PetscInt ts_step
time step number
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
[Push operators to pipeline]
SmartPetscObj< DM > dM
Monitor(SmartPetscObj< DM > dm, std::pair< boost::shared_ptr< PostProcEleDomain >, boost::shared_ptr< PostProcEleBdy > > pair_post_proc, boost::shared_ptr< DomainEle > reaction_fe)
PetscInt saveEvery
MoFEMErrorCode postProcess()
function is run at the end of loop
boost::shared_ptr< DomainEle > reactionFe
boost::shared_ptr< PostProcEleDomain > postProcDomain
boost::shared_ptr< PostProcEleBdy > postProcSkin
PipelineManager::ElementsAndOpsByDim< 2 >::FaceSideEle SideEle
PipelineManager::ElementsAndOpsByDim< 3 >::FaceSideEle SideEle
static char help[]
[Check]
constexpr int SPACE_DIM