v0.10.0
Classes | Macros | Typedefs | Functions | Variables
contact.cpp File Reference
#include <MoFEM.hpp>
#include <MatrixFunction.hpp>
#include <OpPostProcElastic.hpp>
#include <ContactOps.hpp>
#include <HenkyOps.hpp>
#include <PostProcContact.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  ElementsAndOps< 3 >
 
struct  Example
 [Example] More...
 

Macros

#define EXECUTABLE_DIMENSION   3
 

Typedefs

using EntData = DataForcesAndSourcesCore::EntData
 
using DomainEle = ElementsAndOps< SPACE_DIM >::DomainEle
 
using DomainEleOp = ElementsAndOps< SPACE_DIM >::DomainEleOp
 
using BoundaryEle = ElementsAndOps< SPACE_DIM >::BoundaryEle
 
using BoundaryEleOp = ElementsAndOps< SPACE_DIM >::BoundaryEleOp
 
using PostProcEle = ElementsAndOps< SPACE_DIM >::PostProcEle
 
using OpMixDivULhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesVec< SPACE_DIM >
 [Operators used for contact] More...
 
using OpLambdaGraULhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixTensorTimesGrad< SPACE_DIM >
 
using OpMixDivURhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpMixDivTimesU< SPACE_DIM >
 
using OpMixLambdaGradURhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpMixTensorTimesGradU< SPACE_DIM >
 
using OpMixUTimesDivLambdaRhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpMixVecTimesDivLambda< SPACE_DIM >
 
using OpMixUTimesLambdaRhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM >
 
using OpSpringLhs = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM >
 
using OpSpringRhs = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 >
 
using OpBodyForce = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, SPACE_DIM >
 [Operators used for contact] More...
 
using OpKCauchy = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 >
 [Body force] More...
 
using OpInternalForceCauchy = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM >
 
using OpMass = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM >
 [Only used with Hooke equation (linear material model)] More...
 
using OpInertiaForce = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 >
 
using OpKPiola = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, 1 >
 [Only used for dynamics] More...
 
using OpInternalForcePiola = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM >
 

Functions

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

Variables

constexpr int SPACE_DIM
 
constexpr EntityType boundary_ent = SPACE_DIM == 3 ? MBTRI : MBEDGE
 
constexpr bool is_quasi_static = true
 
constexpr bool is_Henky = true
 
constexpr int order = 2
 
constexpr double young_modulus = 100
 
constexpr double poisson_ratio = 0.25
 
constexpr double rho = 0
 
constexpr double cn = 0.01
 
constexpr double spring_stiffness = 0.1
 
static char help [] = "...\n\n"
 

Macro Definition Documentation

◆ EXECUTABLE_DIMENSION

#define EXECUTABLE_DIMENSION   3
Examples
contact.cpp.

Definition at line 24 of file contact.cpp.

Typedef Documentation

◆ BoundaryEle

Definition at line 57 of file contact.cpp.

◆ BoundaryEleOp

Definition at line 58 of file contact.cpp.

◆ DomainEle

Definition at line 55 of file contact.cpp.

◆ DomainEleOp

Definition at line 56 of file contact.cpp.

◆ EntData

Examples
contact.cpp.

Definition at line 54 of file contact.cpp.

◆ OpBodyForce

using OpBodyForce = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm< GAUSS>::OpSource<1, SPACE_DIM>

[Operators used for contact]

[Body force]

Examples
contact.cpp.

Definition at line 81 of file contact.cpp.

◆ OpInertiaForce

using OpInertiaForce = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpBaseTimesVector<1, SPACE_DIM, 1>
Examples
contact.cpp.

Definition at line 96 of file contact.cpp.

◆ OpInternalForceCauchy

using OpInternalForceCauchy = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpGradTimesSymTensor<1, SPACE_DIM, SPACE_DIM>
Examples
contact.cpp.

Definition at line 88 of file contact.cpp.

◆ OpInternalForcePiola

using OpInternalForcePiola = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpGradTimesTensor<1, SPACE_DIM, SPACE_DIM>
Examples
contact.cpp.

Definition at line 103 of file contact.cpp.

◆ OpKCauchy

using OpKCauchy = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpGradSymTensorGrad<1, SPACE_DIM, SPACE_DIM, 0>

[Body force]

[Only used with Hooke equation (linear material model)]

Examples
contact.cpp.

Definition at line 86 of file contact.cpp.

◆ OpKPiola

using OpKPiola = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpGradTensorGrad<1, SPACE_DIM, SPACE_DIM, 1>

[Only used for dynamics]

Examples
contact.cpp.

Definition at line 101 of file contact.cpp.

◆ OpLambdaGraULhs

using OpLambdaGraULhs = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpMixTensorTimesGrad<SPACE_DIM>
Examples
contact.cpp.

Definition at line 64 of file contact.cpp.

◆ OpMass

using OpMass = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpMass<1, SPACE_DIM>

[Only used with Hooke equation (linear material model)]

[Only used for dynamics]

Examples
contact.cpp.

Definition at line 94 of file contact.cpp.

◆ OpMixDivULhs

using OpMixDivULhs = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpMixDivTimesVec<SPACE_DIM>

[Operators used for contact]

Examples
contact.cpp.

Definition at line 62 of file contact.cpp.

◆ OpMixDivURhs

using OpMixDivURhs = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm< GAUSS>::OpMixDivTimesU<SPACE_DIM>
Examples
contact.cpp.

Definition at line 66 of file contact.cpp.

◆ OpMixLambdaGradURhs

using OpMixLambdaGradURhs = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpMixTensorTimesGradU<SPACE_DIM>
Examples
contact.cpp.

Definition at line 68 of file contact.cpp.

◆ OpMixUTimesDivLambdaRhs

using OpMixUTimesDivLambdaRhs = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpMixVecTimesDivLambda<SPACE_DIM>
Examples
contact.cpp.

Definition at line 70 of file contact.cpp.

◆ OpMixUTimesLambdaRhs

using OpMixUTimesLambdaRhs = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpGradTimesTensor<1, SPACE_DIM, SPACE_DIM>
Examples
contact.cpp.

Definition at line 72 of file contact.cpp.

◆ OpSpringLhs

using OpSpringLhs = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpMass<1, SPACE_DIM>
Examples
contact.cpp.

Definition at line 74 of file contact.cpp.

◆ OpSpringRhs

using OpSpringRhs = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpBaseTimesVector<1, SPACE_DIM, 1>
Examples
contact.cpp.

Definition at line 76 of file contact.cpp.

◆ PostProcEle

Definition at line 59 of file contact.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
Examples
contact.cpp.

Definition at line 580 of file contact.cpp.

580  {
581 
582  // Initialisation of MoFEM/PETSc and MOAB data structures
583  const char param_file[] = "param_file.petsc";
584  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
585 
586  // Add logging channel for example
587  auto core_log = logging::core::get();
588  core_log->add_sink(
589  LogManager::createSink(LogManager::getStrmWorld(), "EXAMPLE"));
590  LogManager::setLog("EXAMPLE");
591  MOFEM_LOG_TAG("EXAMPLE", "example");
592 
593  try {
594 
595  //! [Register MoFEM discrete manager in PETSc]
596  DMType dm_name = "DMMOFEM";
597  CHKERR DMRegister_MoFEM(dm_name);
598  //! [Register MoFEM discrete manager in PETSc
599 
600  //! [Create MoAB]
601  moab::Core mb_instance; ///< mesh database
602  moab::Interface &moab = mb_instance; ///< mesh database interface
603  //! [Create MoAB]
604 
605  //! [Create MoFEM]
606  MoFEM::Core core(moab); ///< finite element database
607  MoFEM::Interface &m_field = core; ///< finite element database insterface
608  //! [Create MoFEM]
609 
610  //! [Load mesh]
611  Simple *simple = m_field.getInterface<Simple>();
612  CHKERR simple->getOptions();
613  CHKERR simple->loadFile("");
614  //! [Load mesh]
615 
616  //! [Example]
617  Example ex(m_field);
618  CHKERR ex.runProblem();
619  //! [Example]
620  }
621  CATCH_ERRORS;
622 
624 }

Variable Documentation

◆ boundary_ent

constexpr EntityType boundary_ent = SPACE_DIM == 3 ? MBTRI : MBEDGE
constexpr
Examples
contact.cpp.

Definition at line 53 of file contact.cpp.

◆ cn

constexpr double cn = 0.01
constexpr
Examples
contact.cpp.

Definition at line 113 of file contact.cpp.

◆ help

char help[] = "...\n\n"
static
Examples
contact.cpp.

Definition at line 578 of file contact.cpp.

◆ is_Henky

constexpr bool is_Henky = true
constexpr
Examples
contact.cpp.

Definition at line 107 of file contact.cpp.

◆ is_quasi_static

constexpr bool is_quasi_static = true
constexpr
Examples
contact.cpp.

Definition at line 106 of file contact.cpp.

◆ order

constexpr int order = 2
constexpr
Examples
contact.cpp.

Definition at line 109 of file contact.cpp.

◆ poisson_ratio

constexpr double poisson_ratio = 0.25
constexpr
Examples
contact.cpp.

Definition at line 111 of file contact.cpp.

◆ rho

constexpr double rho = 0
constexpr
Examples
contact.cpp, HookeElement.cpp, Remodeling.cpp, and Remodeling.hpp.

Definition at line 112 of file contact.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM
constexpr
Initial value:
Examples
contact.cpp.

Definition at line 50 of file contact.cpp.

◆ spring_stiffness

constexpr double spring_stiffness = 0.1
constexpr
Examples
contact.cpp.

Definition at line 114 of file contact.cpp.

◆ young_modulus

constexpr double young_modulus = 100
constexpr
Examples
contact.cpp.

Definition at line 110 of file contact.cpp.

MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:26
Example
[Example]
Definition: plastic.cpp:113
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:36
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1943
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:604
param_file
std::string param_file
Definition: DefaultParams.hpp:29
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
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:60
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:48
EXECUTABLE_DIMENSION
#define EXECUTABLE_DIMENSION
Definition: contact.cpp:24
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:343
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:77
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:100
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:441
help
static char help[]
Definition: contact.cpp:578
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1129
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.
Definition: UnknownInterface.hpp:130