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 839 of file elastic.cpp.

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

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 837 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:104
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:1975
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
Example
[Example]
Definition: plastic.cpp:228
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:47
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:128
help
static char help[]
[Check]
Definition: elastic.cpp:837
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:372
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1094
MoFEM::SCHUR
@ SCHUR
Definition: FormsIntegrators.hpp:104