v0.16.3
Loading...
Searching...
No Matches
nonlinear_elastic.cpp
Go to the documentation of this file.
1/**
2 * @file nonlinear_elastic.cpp
3 * @example mofem/users_modules/um_ageing_umat/
4 * nonlinear_elasticity_ageing_example/nonlinear_elastic.cpp
5 * @date 2025-10-5
6 *
7 * @copyright Anonymous authors (c) 2025 under the MIT license (see LICENSE for
8 * details)
9 */
10
11#include <MoFEM.hpp>
12#include <MatrixFunction.hpp>
13
14using namespace MoFEM;
15
16constexpr int SPACE_DIM =
17 EXECUTABLE_DIMENSION; //< Space dimension of problem, mesh
18
23using DomainEleOp = DomainEle::UserDataOperator;
24using BoundaryEleOp = BoundaryEle::UserDataOperator;
25
30
34
35template <int DIM> struct PostProcEleByDim;
36
37template <> struct PostProcEleByDim<2> {
41};
42
43template <> struct PostProcEleByDim<3> {
47};
48
54
55#include <MatOps.hpp>
56#include <Monitor.hpp>
57
59#include <UmatExample.hpp>
60
61static char help[] = "...\n\n";
62
63int main(int argc, char *argv[]) {
64
65 // Initialisation of MoFEM/PETSc and MOAB data structures
66 const char param_file[] = "param_file.petsc";
67 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
68
69 // Add logging channel for example
70 auto core_log = logging::core::get();
71 core_log->add_sink(
73 LogManager::setLog("EXAMPLE");
74 MOFEM_LOG_TAG("EXAMPLE", "example");
75
76 try {
77
78 //! [Register MoFEM discrete manager in PETSc]
79 DMType dm_name = "DMMOFEM";
80 CHKERR DMRegister_MoFEM(dm_name);
81 //! [Register MoFEM discrete manager in PETSc
82
83 //! [Create MoAB]
84 moab::Core mb_instance; ///< mesh database
85 moab::Interface &moab = mb_instance; ///< mesh database interface
86 //! [Create MoAB]
87
88 //! [Create MoFEM]
89 MoFEM::Core core(moab); ///< finite element database
90 MoFEM::Interface &m_field = core; ///< finite element database interface
91 //! [Create MoFEM]
92
93 //! [Example]
94 UmatExample ex(m_field);
95 CHKERR ex.runProblem();
96 //! [Example]
97 }
99
101}
int main()
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
PostProcEleByDim< SPACE_DIM >::PostProcEleDomain PostProcEleDomain
PostProcEleByDim< SPACE_DIM >::PostProcEleBdy PostProcEleBdy
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
@ PETSC
Standard PETSc assembly.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
#define EXECUTABLE_DIMENSION
Definition plastic.cpp:13
ElementsAndOps< SPACE_DIM >::SideEle SideEle
Definition plastic.cpp:62
Core (interface) class.
Definition Core.hpp:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
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
Template struct for dimension-specific finite element types.
Force scale operator for reading two columns.
PipelineManager::ElementsAndOpsByDim< 2 >::FaceSideEle SideEle
PipelineManager::ElementsAndOpsByDim< 3 >::FaceSideEle SideEle
MoFEMErrorCode runProblem()
[Run problem]
static char help[]
constexpr int SPACE_DIM