v0.14.0
Classes | Typedefs | Functions | Variables
elastic.cpp File Reference

elastic example More...

#include <MoFEM.hpp>
#include <ElasticSpring.hpp>
#include <FluidLevel.hpp>
#include <CalculateTraction.hpp>
#include <NaturalDomainBC.hpp>
#include <NaturalBoundaryBC.hpp>

Go to the source code of this file.

Classes

struct  DomainBCs
 [OpInternalForce] More...
 
struct  BoundaryBCs
 
struct  PostProcEleByDim< DIM >
 
struct  PostProcEleByDim< 2 >
 
struct  PostProcEleByDim< 3 >
 
struct  Example
 [Example] More...
 
struct  SetUpSchur
 [Push operators to pipeline] More...
 
struct  SetUpSchurImpl
 

Typedefs

using EntData = EntitiesFieldData::EntData
 [Define entities] More...
 
using DomainEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::DomainEle
 
using BoundaryEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::BoundaryEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using OpK = FormsIntegrators< DomainEleOp >::Assembly< A >::BiLinearForm< I >::OpGradSymTensorGrad< BASE_DIM, SPACE_DIM, SPACE_DIM, 0 >
 [Define entities] More...
 
using OpInternalForce = FormsIntegrators< DomainEleOp >::Assembly< A >::LinearForm< I >::OpGradTimesSymTensor< BASE_DIM, SPACE_DIM, SPACE_DIM >
 
using DomainRhsBCs = NaturalBC< DomainEleOp >::Assembly< A >::LinearForm< I >
 
using OpDomainRhsBCs = DomainRhsBCs::OpFlux< DomainBCs, 1, SPACE_DIM >
 
using BoundaryRhsBCs = NaturalBC< BoundaryEleOp >::Assembly< A >::LinearForm< I >
 
using OpBoundaryRhsBCs = BoundaryRhsBCs::OpFlux< BoundaryBCs, 1, SPACE_DIM >
 
using BoundaryLhsBCs = NaturalBC< BoundaryEleOp >::Assembly< A >::BiLinearForm< I >
 
using OpBoundaryLhsBCs = BoundaryLhsBCs::OpFlux< BoundaryBCs, 1, SPACE_DIM >
 
using PostProcEleDomain = PostProcEleByDim< SPACE_DIM >::PostProcEleDomain
 
using SideEle = PostProcEleByDim< SPACE_DIM >::SideEle
 
using PostProcEleBdy = PostProcEleByDim< SPACE_DIM >::PostProcEleBdy
 

Functions

int main (int argc, char *argv[])
 

Variables

constexpr int BASE_DIM = 1
 
constexpr int SPACE_DIM
 [Define dimension] More...
 
constexpr AssemblyType A
 [Define dimension] More...
 
constexpr IntegrationType I
 
constexpr double young_modulus = 1
 
constexpr double poisson_ratio = 0.3
 
constexpr double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio))
 
constexpr double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio))
 
PetscBool is_plane_strain = PETSC_FALSE
 
static char help [] = "...\n\n"
 [Check] More...
 

Detailed Description

elastic example

Version
0.13.2
Date
2022-09-19

Definition in file elastic.cpp.

Typedef Documentation

◆ BoundaryEle

Definition at line 32 of file elastic.cpp.

◆ BoundaryEleOp

Definition at line 34 of file elastic.cpp.

◆ BoundaryLhsBCs

Definition at line 52 of file elastic.cpp.

◆ BoundaryRhsBCs

using BoundaryRhsBCs = NaturalBC<BoundaryEleOp>::Assembly<A>::LinearForm<I>

Definition at line 50 of file elastic.cpp.

◆ DomainEle

Definition at line 30 of file elastic.cpp.

◆ DomainEleOp

Definition at line 33 of file elastic.cpp.

◆ DomainRhsBCs

using DomainRhsBCs = NaturalBC<DomainEleOp>::Assembly<A>::LinearForm<I>

Definition at line 48 of file elastic.cpp.

◆ EntData

[Define entities]

Definition at line 29 of file elastic.cpp.

◆ OpBoundaryLhsBCs

Definition at line 53 of file elastic.cpp.

◆ OpBoundaryRhsBCs

Definition at line 51 of file elastic.cpp.

◆ OpDomainRhsBCs

Definition at line 49 of file elastic.cpp.

◆ OpInternalForce

using OpInternalForce = FormsIntegrators<DomainEleOp>::Assembly<A>::LinearForm< I>::OpGradTimesSymTensor<BASE_DIM, SPACE_DIM, SPACE_DIM>

[OpK] [OpInternalForce]

Definition at line 43 of file elastic.cpp.

◆ OpK

using OpK = FormsIntegrators<DomainEleOp>::Assembly<A>::BiLinearForm< I>::OpGradSymTensorGrad<BASE_DIM, SPACE_DIM, SPACE_DIM, 0>

[Define entities]

[OpK]

Examples
PoissonOperators.hpp, and simple_elasticity.cpp.

Definition at line 39 of file elastic.cpp.

◆ PostProcEleBdy

Definition at line 71 of file elastic.cpp.

◆ PostProcEleDomain

Definition at line 69 of file elastic.cpp.

◆ SideEle

Definition at line 70 of file elastic.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

[Register MoFEM discrete manager in PETSc]

[Register MoFEM discrete manager in PETSc

[Create MoAB]

< mesh database

< mesh database interface

[Create MoAB]

[Create MoFEM]

< finite element database

< finite element database interface

[Create MoFEM]

[Example]

[Example]

Definition at line 840 of file elastic.cpp.

840  {
841 
842  // Initialisation of MoFEM/PETSc and MOAB data structures
843  const char param_file[] = "param_file.petsc";
844  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
845 
846  auto core_log = logging::core::get();
847  core_log->add_sink(
848  LogManager::createSink(LogManager::getStrmWorld(), "TIMER"));
849 
850  core_log->add_sink(
851  LogManager::createSink(LogManager::getStrmSync(), "FieldEvaluator"));
852  LogManager::setLog("FieldEvaluator");
853  MOFEM_LOG_TAG("FieldEvaluator", "field_eval");
854 
855  try {
856 
857  //! [Register MoFEM discrete manager in PETSc]
858  DMType dm_name = "DMMOFEM";
859  CHKERR DMRegister_MoFEM(dm_name);
860  DMType dm_name_mg = "DMMOFEM_MG";
862  //! [Register MoFEM discrete manager in PETSc
863 
864  //! [Create MoAB]
865  moab::Core mb_instance; ///< mesh database
866  moab::Interface &moab = mb_instance; ///< mesh database interface
867  //! [Create MoAB]
868 
869  //! [Create MoFEM]
870  MoFEM::Core core(moab); ///< finite element database
871  MoFEM::Interface &m_field = core; ///< finite element database interface
872  //! [Create MoFEM]
873 
874  //! [Example]
875  Example ex(m_field);
876  CHKERR ex.runProblem();
877  //! [Example]
878  }
879  CATCH_ERRORS;
880 
882 }

Variable Documentation

◆ A

constexpr AssemblyType A
constexpr
Initial value:

[Define dimension]

Definition at line 21 of file elastic.cpp.

◆ BASE_DIM

constexpr int BASE_DIM = 1
constexpr

Definition at line 15 of file elastic.cpp.

◆ bulk_modulus_K

constexpr double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio))
constexpr

Definition at line 81 of file elastic.cpp.

◆ help

char help[] = "...\n\n"
static

[Check]

Definition at line 838 of file elastic.cpp.

◆ I

constexpr IntegrationType I
constexpr
Initial value:

Definition at line 25 of file elastic.cpp.

◆ is_plane_strain

PetscBool is_plane_strain = PETSC_FALSE

Definition at line 84 of file elastic.cpp.

◆ poisson_ratio

constexpr double poisson_ratio = 0.3
constexpr

Definition at line 80 of file elastic.cpp.

◆ shear_modulus_G

constexpr double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio))
constexpr

Definition at line 82 of file elastic.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM
constexpr
Initial value:

[Define dimension]

Definition at line 18 of file elastic.cpp.

◆ young_modulus

constexpr double young_modulus = 1
constexpr

Definition at line 79 of file elastic.cpp.

EXECUTABLE_DIMENSION
#define EXECUTABLE_DIMENSION
Definition: plastic.cpp:13
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
MoFEM::PETSC
@ PETSC
Definition: FormsIntegrators.hpp:105
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
SCHUR_ASSEMBLE
#define SCHUR_ASSEMBLE
Definition: contact.cpp:18
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
Example
[Example]
Definition: plastic.cpp:177
MoFEM::DMRegister_MGViaApproxOrders
MoFEMErrorCode DMRegister_MGViaApproxOrders(const char sname[])
Register DM for Multi-Grid via approximation orders.
Definition: PCMGSetUpViaApproxOrders.cpp:302
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:136
help
static char help[]
[Check]
Definition: elastic.cpp:838
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
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
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
MoFEM::BLOCK_SCHUR
@ BLOCK_SCHUR
Definition: FormsIntegrators.hpp:108