v0.14.0
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 
12 using namespace MoFEM;
13 
14 constexpr int SPACE_DIM =
15  EXECUTABLE_DIMENSION; //< Space dimension of problem, mesh
16 
19 using BoundaryEle =
23 
24 using DomainNaturalBC =
26 using OpBodyForce =
28 
29 using BoundaryNaturalBC =
32 
33 template <int DIM> struct PostProcEleByDim;
34 
35 template <> struct PostProcEleByDim<2> {
39 };
40 
41 template <> struct PostProcEleByDim<3> {
45 };
46 
49 using PostProcEdges =
51 
52 constexpr double young_modulus = 100;
53 constexpr double poisson_ratio = 0.3;
54 
55 #include <HenckyOps.hpp>
56 using namespace HenckyOps;
57 
58 struct Example {
59 
60  Example(MoFEM::Interface &m_field) : mField(m_field) {}
61 
62  MoFEMErrorCode runProblem();
63 
64 private:
65  MoFEM::Interface &mField;
66 
67  MoFEMErrorCode readMesh();
68  MoFEMErrorCode setupProblem();
69  MoFEMErrorCode boundaryCondition();
70  MoFEMErrorCode assembleSystem();
71  MoFEMErrorCode solveSystem();
72  MoFEMErrorCode gettingNorms();
73  MoFEMErrorCode outputResults();
74  MoFEMErrorCode checkResults();
75 };
76 
77 //! [Run problem]
80  CHKERR readMesh();
81  CHKERR setupProblem();
82  CHKERR boundaryCondition();
83  CHKERR assembleSystem();
84  CHKERR solveSystem();
85  CHKERR gettingNorms();
86  CHKERR outputResults();
87  CHKERR checkResults();
89 }
90 //! [Run problem]
91 
92 //! [Read mesh]
95  auto simple = mField.getInterface<Simple>();
96  CHKERR simple->getOptions();
97  char meshFileName[255];
98  CHKERR PetscOptionsGetString(PETSC_NULL, PETSC_NULL, "-file_name",
99  meshFileName, 255, PETSC_NULL);
100  CHKERR simple->loadFile("", meshFileName,
103 }
104 //! [Read mesh]
105 
106 //! [Set up problem]
109  Simple *simple = mField.getInterface<Simple>();
110 
111  enum bases { AINSWORTH, DEMKOWICZ, LASBASETOPT };
112  const char *list_bases[LASBASETOPT] = {"ainsworth", "demkowicz"};
113  PetscInt choice_base_value = AINSWORTH;
114  CHKERR PetscOptionsGetEList(PETSC_NULL, NULL, "-base", list_bases,
115  LASBASETOPT, &choice_base_value, PETSC_NULL);
116 
118  switch (choice_base_value) {
119  case AINSWORTH:
121  MOFEM_LOG("WORLD", Sev::inform)
122  << "Set AINSWORTH_LEGENDRE_BASE for displacements";
123  break;
124  case DEMKOWICZ:
125  base = DEMKOWICZ_JACOBI_BASE;
126  MOFEM_LOG("WORLD", Sev::inform)
127  << "Set DEMKOWICZ_JACOBI_BASE for displacements";
128  break;
129  default:
130  base = LASTBASE;
131  break;
132  }
133 
134  // Add field
135  CHKERR simple->addDomainField("U", H1, base, SPACE_DIM);
136  CHKERR simple->addBoundaryField("U", H1, base, SPACE_DIM);
137  int order = 2;
138  CHKERR PetscOptionsGetInt(PETSC_NULL, "", "-order", &order, PETSC_NULL);
139  CHKERR simple->setFieldOrder("U", order);
140  CHKERR simple->setUp();
142 }
143 //! [Set up problem]
144 
145 //! [Boundary condition]
148  auto *pipeline_mng = mField.getInterface<PipelineManager>();
149  auto simple = mField.getInterface<Simple>();
150  auto bc_mng = mField.getInterface<BcManager>();
151  auto time_scale = boost::make_shared<TimeScale>();
152 
153  auto integration_rule = [](int, int, int approx_order) {
154  return 2 * (approx_order - 1);
155  };
156 
157  CHKERR pipeline_mng->setDomainRhsIntegrationRule(integration_rule);
158  CHKERR pipeline_mng->setDomainLhsIntegrationRule(integration_rule);
159  CHKERR pipeline_mng->setBoundaryRhsIntegrationRule(integration_rule);
160 
162  pipeline_mng->getOpBoundaryRhsPipeline(), mField, "U", {time_scale},
163  "FORCE", Sev::inform);
164 
165  //! [Define gravity vector]
167  pipeline_mng->getOpDomainRhsPipeline(), mField, "U", {time_scale},
168  "BODY_FORCE", Sev::inform);
169 
170  // Essential BC
171  CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_X",
172  "U", 0, 0);
173  CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_Y",
174  "U", 1, 1);
175  CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_Z",
176  "U", 2, 2);
177  CHKERR bc_mng->pushMarkDOFsOnEntities<DisplacementCubitBcData>(
178  simple->getProblemName(), "U");
179 
180  // Essential MPCs BC
181  CHKERR bc_mng->addBlockDOFsToMPCs(simple->getProblemName(), "U");
182 
184 }
185 //! [Boundary condition]
186 
187 //! [Push operators to pipeline]
190  auto *simple = mField.getInterface<Simple>();
191  auto *pipeline_mng = mField.getInterface<PipelineManager>();
192 
193  auto add_domain_ops_lhs = [&](auto &pip) {
196  CHKERR HenckyOps::opFactoryDomainLhs<SPACE_DIM, PETSC, GAUSS, DomainEleOp>(
197  mField, pip, "U", "MAT_ELASTIC", Sev::inform);
199  };
200 
201  auto add_domain_ops_rhs = [&](auto &pip) {
204  CHKERR HenckyOps::opFactoryDomainRhs<SPACE_DIM, PETSC, GAUSS, DomainEleOp>(
205  mField, pip, "U", "MAT_ELASTIC", Sev::inform);
207  };
208 
209  CHKERR add_domain_ops_lhs(pipeline_mng->getOpDomainLhsPipeline());
210  CHKERR add_domain_ops_rhs(pipeline_mng->getOpDomainRhsPipeline());
211 
213 }
214 //! [Push operators to pipeline]
215 
216 /**
217  * @brief Monitor solution
218  *
219  * This functions is called by TS solver at the end of each step. It is used
220  * to output results to the hard drive.
221  */
222 struct Monitor : public FEMethod {
223  Monitor(SmartPetscObj<DM> dm, boost::shared_ptr<PostProcEleBdy> post_proc)
224  : dM(dm), postProc(post_proc){};
227  constexpr int save_every_nth_step = 1;
228  if (ts_step % save_every_nth_step == 0) {
229  CHKERR DMoFEMLoopFiniteElements(dM, "bFE", postProc);
231  postProc->mField, postProc->getPostProcMesh(), {"U"});
232 
233  CHKERR postProc->writeFile(
234  "out_step_" + boost::lexical_cast<std::string>(ts_step) + ".h5m");
235  }
237  }
238 
239 private:
241  boost::shared_ptr<PostProcEleBdy> postProc;
242 };
243 
244 //! [Solve]
247  auto *simple = mField.getInterface<Simple>();
248  auto *pipeline_mng = mField.getInterface<PipelineManager>();
249 
250  auto dm = simple->getDM();
251  auto ts = pipeline_mng->createTSIM();
252 
253  // Setup postprocessing
254  auto create_post_proc_fe = [dm, this, simple]() {
255  auto post_proc_ele_domain = [dm, this](auto &pip_domain) {
257  auto common_ptr = commonDataFactory<SPACE_DIM, GAUSS, DomainEleOp>(
258  mField, pip_domain, "U", "MAT_ELASTIC", Sev::inform);
259  return common_ptr;
260  };
261 
262  auto post_proc_fe_bdy = boost::make_shared<PostProcEleBdy>(mField);
263  auto u_ptr = boost::make_shared<MatrixDouble>();
264  post_proc_fe_bdy->getOpPtrVector().push_back(
266  auto op_loop_side =
267  new OpLoopSide<SideEle>(mField, simple->getDomainFEName(), SPACE_DIM);
268  auto common_ptr = post_proc_ele_domain(op_loop_side->getOpPtrVector());
269  post_proc_fe_bdy->getOpPtrVector().push_back(op_loop_side);
270 
272 
273  post_proc_fe_bdy->getOpPtrVector().push_back(
274 
275  new OpPPMap(
276 
277  post_proc_fe_bdy->getPostProcMesh(),
278  post_proc_fe_bdy->getMapGaussPts(),
279 
280  {},
281 
282  {{"U", u_ptr}},
283 
284  {{"GRAD", common_ptr->matGradPtr},
285  {"FIRST_PIOLA", common_ptr->getMatFirstPiolaStress()}},
286 
287  {}
288 
289  )
290 
291  );
292  return post_proc_fe_bdy;
293  };
294 
295  auto add_extra_finite_elements_to_ksp_solver_pipelines = [&]() {
297 
298  auto pre_proc_ptr = boost::make_shared<FEMethod>();
299  auto post_proc_rhs_ptr = boost::make_shared<FEMethod>();
300  auto post_proc_lhs_ptr = boost::make_shared<FEMethod>();
301 
302  auto time_scale = boost::make_shared<TimeScale>();
303 
304  auto get_bc_hook_rhs = [this, pre_proc_ptr, time_scale]() {
307  {time_scale}, false)();
309  };
310 
311  pre_proc_ptr->preProcessHook = get_bc_hook_rhs;
312 
313  auto get_post_proc_hook_rhs = [this, post_proc_rhs_ptr]() {
316  mField, post_proc_rhs_ptr, nullptr, Sev::verbose)();
318  mField, post_proc_rhs_ptr, 1.)();
319  CHKERR EssentialPostProcRhs<MPCsType>(mField, post_proc_rhs_ptr)();
321  };
322  auto get_post_proc_hook_lhs = [this, post_proc_lhs_ptr]() {
325  mField, post_proc_lhs_ptr, 1.)();
326  CHKERR EssentialPostProcLhs<MPCsType>(mField, post_proc_lhs_ptr)();
328  };
329  post_proc_rhs_ptr->postProcessHook = get_post_proc_hook_rhs;
330  post_proc_lhs_ptr->postProcessHook = get_post_proc_hook_lhs;
331 
332  // This is low level pushing finite elements (pipelines) to solver
333  auto ts_ctx_ptr = getDMTsCtx(simple->getDM());
334  ts_ctx_ptr->getPreProcessIFunction().push_front(pre_proc_ptr);
335  ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_ptr);
336  ts_ctx_ptr->getPostProcessIFunction().push_back(post_proc_rhs_ptr);
337  ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_lhs_ptr);
339  };
340 
341  // Add extra finite elements to SNES solver pipelines to resolve essential
342  // boundary conditions
343  CHKERR add_extra_finite_elements_to_ksp_solver_pipelines();
344 
345  auto create_monitor_fe = [dm](auto &&post_proc_fe) {
346  return boost::make_shared<Monitor>(dm, post_proc_fe);
347  };
348 
349  // Set monitor which postprocessing results and saves them to the hard drive
350  boost::shared_ptr<FEMethod> null_fe;
351  auto monitor_ptr = create_monitor_fe(create_post_proc_fe());
352  CHKERR DMMoFEMTSSetMonitor(dm, ts, simple->getDomainFEName(), null_fe,
353  null_fe, monitor_ptr);
354 
355  // Set time solver
356  double ftime = 1;
357  CHKERR TSSetDuration(ts, PETSC_DEFAULT, ftime);
358  CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_MATCHSTEP);
359 
360  auto D = createDMVector(simple->getDM());
361 
362  CHKERR TSSetSolution(ts, D);
363  CHKERR TSSetFromOptions(ts);
364 
365  CHKERR TSSolve(ts, NULL);
366  CHKERR TSGetTime(ts, &ftime);
367 
368  PetscInt steps, snesfails, rejects, nonlinits, linits;
369  CHKERR TSGetStepNumber(ts, &steps);
370  CHKERR TSGetSNESFailures(ts, &snesfails);
371  CHKERR TSGetStepRejections(ts, &rejects);
372  CHKERR TSGetSNESIterations(ts, &nonlinits);
373  CHKERR TSGetKSPIterations(ts, &linits);
374  MOFEM_LOG_C("EXAMPLE", Sev::inform,
375  "steps %d (%d rejected, %d SNES fails), ftime %g, nonlinits "
376  "%d, linits %d",
377  steps, rejects, snesfails, ftime, nonlinits, linits);
378 
380 }
381 //! [Solve]
382 
383 //! [Getting norms]
386 
387  auto simple = mField.getInterface<Simple>();
388  auto dm = simple->getDM();
389 
390  auto T = createDMVector(simple->getDM());
391  CHKERR DMoFEMMeshToLocalVector(simple->getDM(), T, INSERT_VALUES,
392  SCATTER_FORWARD);
393  double nrm2;
394  CHKERR VecNorm(T, NORM_2, &nrm2);
395  MOFEM_LOG("EXAMPLE", Sev::inform) << "Solution norm " << nrm2;
396 
397  auto post_proc_norm_fe = boost::make_shared<DomainEle>(mField);
398 
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;
401 
403  post_proc_norm_fe->getOpPtrVector(), {H1});
404 
405  enum NORMS { U_NORM_L2 = 0, PIOLA_NORM, LAST_NORM };
406  auto norms_vec =
407  createVectorMPI(mField.get_comm(),
408  (mField.get_comm_rank() == 0) ? LAST_NORM : 0, LAST_NORM);
409  CHKERR VecZeroEntries(norms_vec);
410 
411  auto u_ptr = boost::make_shared<MatrixDouble>();
412  post_proc_norm_fe->getOpPtrVector().push_back(
414 
415  post_proc_norm_fe->getOpPtrVector().push_back(
416  new OpCalcNormL2Tensor1<SPACE_DIM>(u_ptr, norms_vec, U_NORM_L2));
417 
418  auto common_ptr = commonDataFactory<SPACE_DIM, GAUSS, DomainEleOp>(
419  mField, post_proc_norm_fe->getOpPtrVector(), "U", "MAT_ELASTIC",
420  Sev::inform);
421 
422  post_proc_norm_fe->getOpPtrVector().push_back(
424  common_ptr->getMatFirstPiolaStress(), norms_vec, PIOLA_NORM));
425 
426  CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(),
427  post_proc_norm_fe);
428 
429  CHKERR VecAssemblyBegin(norms_vec);
430  CHKERR VecAssemblyEnd(norms_vec);
431 
432  MOFEM_LOG_CHANNEL("SELF"); // Clear channel from old tags
433  if (mField.get_comm_rank() == 0) {
434  const double *norms;
435  CHKERR VecGetArrayRead(norms_vec, &norms);
436  MOFEM_TAG_AND_LOG("SELF", Sev::inform, "example")
437  << "norm_u: " << std::scientific << std::sqrt(norms[U_NORM_L2]);
438  MOFEM_TAG_AND_LOG("SELF", Sev::inform, "example")
439  << "norm_piola: " << std::scientific << std::sqrt(norms[PIOLA_NORM]);
440  CHKERR VecRestoreArrayRead(norms_vec, &norms);
441  }
442 
444 }
445 //! [Getting norms]
446 
447 //! [Postprocessing results]
450  PetscInt test_nb = 0;
451  PetscBool test_flg = PETSC_FALSE;
452  CHKERR PetscOptionsGetInt(PETSC_NULL, "", "-test", &test_nb, &test_flg);
453 
454  if (test_flg) {
455  auto simple = mField.getInterface<Simple>();
456  auto T = createDMVector(simple->getDM());
457  CHKERR DMoFEMMeshToLocalVector(simple->getDM(), T, INSERT_VALUES,
458  SCATTER_FORWARD);
459  double nrm2;
460  CHKERR VecNorm(T, NORM_2, &nrm2);
461  MOFEM_LOG("EXAMPLE", Sev::verbose) << "Regression norm " << nrm2;
462  double regression_value = 0;
463  switch (test_nb) {
464  case 1:
465  regression_value = 1.02789;
466  break;
467  case 2:
468  regression_value = 1.8841e+00;
469  break;
470  case 3:
471  regression_value = 1.8841e+00;
472  break;
473  case 4: // just links
474  regression_value = 4.9625e+00;
475  break;
476  case 5: // link master
477  regression_value = 6.6394e+00;
478  break;
479  case 6: // link master swap
480  regression_value = 4.98764e+00;
481  break;
482  case 7: // link Y
483  regression_value = 4.9473e+00;
484  break;
485  case 8: // link_3D_repr
486  regression_value = 2.5749e-01;
487  break;
488 
489  default:
490  SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID, "Wrong test number.");
491  break;
492  }
493  if (fabs(nrm2 - regression_value) > 1e-2)
494  SETERRQ2(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
495  "Regression test field; wrong norm value. %6.4e != %6.4e", nrm2,
496  regression_value);
497  }
499 }
500 //! [Postprocessing results]
501 
502 //! [Check]
506 }
507 //! [Check]
508 
509 static char help[] = "...\n\n";
510 
511 int main(int argc, char *argv[]) {
512 
513  // Initialisation of MoFEM/PETSc and MOAB data structures
514  const char param_file[] = "param_file.petsc";
515  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
516 
517  // Add logging channel for example
518  auto core_log = logging::core::get();
519  core_log->add_sink(
521  LogManager::setLog("EXAMPLE");
522  MOFEM_LOG_TAG("EXAMPLE", "example");
523 
524  try {
525 
526  //! [Register MoFEM discrete manager in PETSc]
527  DMType dm_name = "DMMOFEM";
528  CHKERR DMRegister_MoFEM(dm_name);
529  //! [Register MoFEM discrete manager in PETSc
530 
531  //! [Create MoAB]
532  moab::Core mb_instance; ///< mesh database
533  moab::Interface &moab = mb_instance; ///< mesh database interface
534  //! [Create MoAB]
535 
536  //! [Create MoFEM]
537  MoFEM::Core core(moab); ///< finite element database
538  MoFEM::Interface &m_field = core; ///< finite element database interface
539  //! [Create MoFEM]
540 
541  //! [Example]
542  Example ex(m_field);
543  CHKERR ex.runProblem();
544  //! [Example]
545  }
546  CATCH_ERRORS;
547 
549 }
MoFEM::NaturalBC::Assembly::LinearForm
Definition: Natural.hpp:67
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:128
Example::checkResults
MoFEMErrorCode checkResults()
[Postprocess results]
Definition: dynamic_first_order_con_law.cpp:1205
EXECUTABLE_DIMENSION
#define EXECUTABLE_DIMENSION
Definition: plastic.cpp:13
BoundaryEle
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
Definition: child_and_parent.cpp:39
MoFEM::EssentialPreProcReaction< DisplacementCubitBcData >
Specialization for DisplacementCubitBcData.
Definition: EssentialDisplacementCubitBcData.hpp:157
Example::assembleSystem
MoFEMErrorCode assembleSystem()
[Push operators to pipeline]
Definition: dynamic_first_order_con_law.cpp:647
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
H1
@ H1
continuous field
Definition: definitions.h:85
LASTBASE
@ LASTBASE
Definition: definitions.h:69
Example::Example
Example(MoFEM::Interface &m_field)
Definition: nonlinear_elastic.cpp:60
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
MoFEM::FEMethod
structure for User Loop Methods on finite elements
Definition: LoopMethods.hpp:369
MoFEM::OpFluxRhsImpl
Definition: Natural.hpp:39
MoFEM::PipelineManager::ElementsAndOpsByDim
Definition: PipelineManager.hpp:38
MoFEM::EssentialPostProcLhs< DisplacementCubitBcData >
Specialization for DisplacementCubitBcData.
Definition: EssentialDisplacementCubitBcData.hpp:134
Monitor::Monitor
Monitor(SmartPetscObj< DM > dm, boost::shared_ptr< PostProcEleBdy > post_proc)
Definition: nonlinear_elastic.cpp:223
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::OpCalculateVectorFieldValues
Get values at integration pts for tensor filed rank 1, i.e. vector field.
Definition: UserDataOperators.hpp:466
PostProcEleByDim< 2 >::SideEle
PipelineManager::ElementsAndOpsByDim< 2 >::FaceSideEle SideEle
Definition: dynamic_first_order_con_law.cpp:44
MoFEM::EssentialPostProcRhs< DisplacementCubitBcData >
Specialization for DisplacementCubitBcData.
Definition: EssentialDisplacementCubitBcData.hpp:113
MoFEM::PETSC
@ PETSC
Definition: FormsIntegrators.hpp:105
MoFEM::PipelineManager
PipelineManager interface.
Definition: PipelineManager.hpp:24
MoFEM.hpp
MoFEM::DMoFEMMeshToLocalVector
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:523
MoFEM::DisplacementCubitBcData
Definition of the displacement bc data structure.
Definition: BCData.hpp:76
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::EssentialPostProcRhs< MPCsType >
Specialization for DisplacementCubitBcData.
Definition: EssentialMPCsData.hpp:81
HenckyOps
Definition: HenckyOps.hpp:11
MoFEM::LogManager::createSink
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
Definition: LogManager.cpp:298
HenckyOps.hpp
Monitor::postProcess
MoFEMErrorCode postProcess()
function is run at the end of loop
Definition: nonlinear_elastic.cpp:225
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
order
constexpr int order
Definition: dg_projection.cpp:18
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
EntData
EntitiesFieldData::EntData EntData
Definition: nonlinear_elastic.cpp:17
Example::readMesh
MoFEMErrorCode readMesh()
[Run problem]
Definition: dynamic_first_order_con_law.cpp:463
PostProcEleByDim
Definition: dynamic_first_order_con_law.cpp:39
MoFEM::OpCalcNormL2Tensor2
Get norm of input MatrixDouble for Tensor2.
Definition: NormsOperators.hpp:72
save_every_nth_step
int save_every_nth_step
Definition: photon_diffusion.cpp:67
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::createDMVector
auto createDMVector(DM dm)
Get smart vector from DM.
Definition: DMMoFEM.hpp:1099
MoFEM::EssentialPreProc< DisplacementCubitBcData >
Specialization for DisplacementCubitBcData.
Definition: EssentialDisplacementCubitBcData.hpp:91
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::BcManager
Simple interface for fast problem set-up.
Definition: BcManager.hpp:25
BoundaryEleOp
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
Example
[Example]
Definition: plastic.cpp:177
main
int main(int argc, char *argv[])
Definition: nonlinear_elastic.cpp:511
OpPPMap
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
Definition: photon_diffusion.cpp:29
MoFEM::PostProcBrokenMeshInMoabBaseContImpl
Definition: PostProcBrokenMeshInMoabBase.hpp:880
Example::solveSystem
MoFEMErrorCode solveSystem()
[Solve]
Definition: dynamic_first_order_con_law.cpp:893
MoFEM::LogManager::getStrmWorld
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:344
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
SideEle
ElementsAndOps< SPACE_DIM >::SideEle SideEle
Definition: plastic.cpp:61
MoFEM::EssentialPostProcLhs< MPCsType >
Specialization for MPCsType.
Definition: EssentialMPCsData.hpp:102
SPACE_DIM
constexpr int SPACE_DIM
Definition: nonlinear_elastic.cpp:14
MatrixFunction.hpp
MoFEM::OpCalcNormL2Tensor1
Get norm of input MatrixDouble for Tensor1.
Definition: NormsOperators.hpp:44
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
MoFEM::AddFluxToRhsPipelineImpl
Definition: Natural.hpp:46
PostProcEleBdy
PostProcEleByDim< SPACE_DIM >::PostProcEleBdy PostProcEleBdy
Definition: dynamic_first_order_con_law.cpp:55
MoFEM::PostProcBrokenMeshInMoabBase
Definition: PostProcBrokenMeshInMoabBase.hpp:94
MoFEM::AddHOOps
Add operators pushing bases from local to physical configuration.
Definition: HODataOperators.hpp:413
integration_rule
auto integration_rule
Definition: free_surface.cpp:185
DomainEleOp
MoFEM::CoreTmp< 0 >::Initialize
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
MOFEM_TAG_AND_LOG
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
Definition: LogManager.hpp:362
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MoFEM::NaturalBC::Assembly
Assembly methods.
Definition: Natural.hpp:65
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
DEMKOWICZ_JACOBI_BASE
@ DEMKOWICZ_JACOBI_BASE
Definition: definitions.h:66
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
Example::setupProblem
MoFEMErrorCode setupProblem()
[Run problem]
Definition: plastic.cpp:225
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
Example::boundaryCondition
MoFEMErrorCode boundaryCondition()
[Set up problem]
Definition: dynamic_first_order_con_law.cpp:536
Monitor
[Push operators to pipeline]
Definition: dynamic_first_order_con_law.cpp:783
approx_order
int approx_order
Definition: test_broken_space.cpp:50
MoFEM::DMMoFEMTSSetMonitor
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:1056
AINSWORTH_LEGENDRE_BASE
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
young_modulus
constexpr double young_modulus
Definition: nonlinear_elastic.cpp:52
MoFEM::PetscOptionsGetString
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
Definition: DeprecatedPetsc.hpp:172
MoFEM::PetscOptionsGetEList
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
Definition: DeprecatedPetsc.hpp:203
help
static char help[]
[Check]
Definition: nonlinear_elastic.cpp:509
MoFEM::createVectorMPI
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
Definition: PetscSmartObj.hpp:202
Example::gettingNorms
MoFEMErrorCode gettingNorms()
[Solve]
Definition: nonlinear_elastic.cpp:384
FieldApproximationBase
FieldApproximationBase
approximation base
Definition: definitions.h:58
Example::runProblem
MoFEMErrorCode runProblem()
[Run problem]
Definition: plastic.cpp:213
Monitor::postProc
boost::shared_ptr< PostProcEleBdy > postProc
Definition: nonlinear_elastic.cpp:241
ReactionDiffusionEquation::D
const double D
diffusivity
Definition: reaction_diffusion.cpp:20
MOFEM_ATOM_TEST_INVALID
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:40
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
DomainEle
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
Definition: child_and_parent.cpp:34
MoFEM::LogManager::setLog
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:389
MoFEM::EssentialPreProc
Class (Function) to enforce essential constrains.
Definition: Essential.hpp:25
MoFEM::SmartPetscObj< DM >
Example::outputResults
MoFEMErrorCode outputResults()
[Solve]
Definition: dynamic_first_order_con_law.cpp:1183
MoFEM::DMoFEMLoopFiniteElements
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:586
convert.int
int
Definition: convert.py:64
MoFEM::PetscOptionsGetInt
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
Definition: DeprecatedPetsc.hpp:142
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::getDMTsCtx
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition: DMMoFEM.hpp:1141
poisson_ratio
constexpr double poisson_ratio
Definition: nonlinear_elastic.cpp:53
PostProcEleByDim< 3 >::SideEle
PipelineManager::ElementsAndOpsByDim< 3 >::FaceSideEle SideEle
Definition: dynamic_first_order_con_law.cpp:50
MoFEM::OpLoopSide
Element used to execute operators on side of the element.
Definition: ForcesAndSourcesCore.hpp:1290
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::OpPostProcMapInMoab
Post post-proc data at points from hash maps.
Definition: PostProcBrokenMeshInMoabBase.hpp:698