v0.13.2
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions | Variables
contact.cpp File Reference
#include <MoFEM.hpp>
#include <MatrixFunction.hpp>
#include <HenckyOps.hpp>
#include <ContactOps.hpp>
#include <PostProcContact.hpp>
#include <ContactNaturalDomainBC.hpp>
#include <ContactNaturalBoundaryBC.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  ElementsAndOps< 3 >
 
struct  ContactOps::DomainBCs
 
struct  ContactOps::BoundaryBCs
 
struct  Contact
 

Namespaces

namespace  ContactOps
 

Macros

#define EXECUTABLE_DIMENSION   3
 

Typedefs

using EntData = EntitiesFieldData::EntData
 
using DomainEle = ElementsAndOps< SPACE_DIM >::DomainEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = ElementsAndOps< SPACE_DIM >::BoundaryEle
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using AssemblyDomainEleOp = FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase
 
using AssemblyBoundaryEleOp = FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase
 
using OpMixDivULhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< I >::OpMixDivTimesVec< SPACE_DIM >
 [Operators used for contact] More...
 
using OpLambdaGraULhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< I >::OpMixTensorTimesGrad< SPACE_DIM >
 
using OpMixDivURhs = FormsIntegrators< DomainEleOp >::Assembly< A >::LinearForm< GAUSS >::OpMixDivTimesU< 3, SPACE_DIM, SPACE_DIM >
 
using OpMixLambdaGradURhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< I >::OpMixTensorTimesGradU< SPACE_DIM >
 
using OpMixUTimesDivLambdaRhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< I >::OpMixVecTimesDivLambda< SPACE_DIM >
 
using OpMixUTimesLambdaRhs = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< I >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM >
 
using OpSpringLhs = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< I >::OpMass< 1, SPACE_DIM >
 
using OpSpringRhs = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< I >::OpBaseTimesVector< 1, SPACE_DIM, 1 >
 
using OpMass = FormsIntegrators< DomainEleOp >::Assembly< A >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM >
 [Operators used for contact] More...
 
using OpInertiaForce = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< I >::OpBaseTimesVector< 1, SPACE_DIM, 1 >
 
using OpEssentialLhs = EssentialBC< BoundaryEleOp >::Assembly< A >::BiLinearForm< GAUSS >::OpEssentialLhs< DisplacementCubitBcData, 1, SPACE_DIM >
 [Only used for dynamics] More...
 
using OpEssentialRhs = EssentialBC< BoundaryEleOp >::Assembly< A >::LinearForm< GAUSS >::OpEssentialRhs< DisplacementCubitBcData, 1, SPACE_DIM >
 
using OpKPiola = FormsIntegrators< DomainEleOp >::Assembly< A >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, 1 >
 [Essential boundary conditions] More...
 
using OpInternalForcePiola = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< I >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM >
 
using ContactOps::DomainRhsBCs = NaturalBC< DomainEleOp >::Assembly< A >::LinearForm< I >
 
using ContactOps::OpDomainRhsBCs = DomainRhsBCs::OpFlux< DomainBCs, 1, SPACE_DIM >
 
using ContactOps::BoundaryRhsBCs = NaturalBC< BoundaryEleOp >::Assembly< A >::LinearForm< I >
 
using ContactOps::OpBoundaryRhsBCs = BoundaryRhsBCs::OpFlux< BoundaryBCs, 1, SPACE_DIM >
 
using ContactOps::BoundaryLhsBCs = NaturalBC< BoundaryEleOp >::Assembly< A >::BiLinearForm< I >
 
using ContactOps::OpBoundaryLhsBCs = BoundaryLhsBCs::OpFlux< BoundaryBCs, 1, SPACE_DIM >
 

Functions

MoFEMErrorCode ContactOps::addMatBlockOps (MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, std::string field_name, std::string block_name, boost::shared_ptr< MatrixDouble > mat_D_Ptr, Sev sev)
 
int main (int argc, char *argv[])
 

Variables

constexpr AssemblyType A = AssemblyType::PETSC
 
constexpr IntegrationType I
 
constexpr int SPACE_DIM
 
constexpr FieldSpace CONTACT_SPACE = ElementsAndOps<SPACE_DIM>::CONTACT_SPACE
 
constexpr bool is_quasi_static = true
 
int order = 2
 
constexpr int geom_order
 
double young_modulus = 100
 
double poisson_ratio = 0.25
 
double rho = 0.0
 
double cn = 0.1
 
double spring_stiffness = 0.1
 
double alpha_dumping = 0
 
static char help [] = "...\n\n"
 [Check] More...
 

Detailed Description

\CONTACT contact.cpp

CONTACT of contact problem

Definition in file contact.cpp.

Macro Definition Documentation

◆ EXECUTABLE_DIMENSION

#define EXECUTABLE_DIMENSION   3

Definition at line 11 of file contact.cpp.

Typedef Documentation

◆ AssemblyBoundaryEleOp

Examples
ContactOps.hpp.

Definition at line 52 of file contact.cpp.

◆ AssemblyDomainEleOp

Definition at line 51 of file contact.cpp.

◆ BoundaryEle

Definition at line 48 of file contact.cpp.

◆ BoundaryEleOp

Definition at line 49 of file contact.cpp.

◆ DomainEle

Definition at line 46 of file contact.cpp.

◆ DomainEleOp

Definition at line 47 of file contact.cpp.

◆ EntData

Definition at line 45 of file contact.cpp.

◆ OpEssentialLhs

[Only used for dynamics]

[Essential boundary conditions]

Definition at line 83 of file contact.cpp.

◆ OpEssentialRhs

Definition at line 85 of file contact.cpp.

◆ OpInertiaForce

using OpInertiaForce = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<I>::OpBaseTimesVector<1, SPACE_DIM, 1>

Definition at line 78 of file contact.cpp.

◆ OpInternalForcePiola

Definition at line 92 of file contact.cpp.

◆ OpKPiola

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

[Essential boundary conditions]

Definition at line 90 of file contact.cpp.

◆ OpLambdaGraULhs

using OpLambdaGraULhs = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::BiLinearForm<I>::OpMixTensorTimesGrad<SPACE_DIM>

Definition at line 59 of file contact.cpp.

◆ OpMass

[Operators used for contact]

[Only used for dynamics]

Definition at line 76 of file contact.cpp.

◆ OpMixDivULhs

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

[Operators used for contact]

Definition at line 57 of file contact.cpp.

◆ OpMixDivURhs

using OpMixDivURhs = FormsIntegrators<DomainEleOp>::Assembly<A>::LinearForm< GAUSS>::OpMixDivTimesU<3, SPACE_DIM, SPACE_DIM>

Definition at line 61 of file contact.cpp.

◆ OpMixLambdaGradURhs

using OpMixLambdaGradURhs = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<I>::OpMixTensorTimesGradU<SPACE_DIM>

Definition at line 63 of file contact.cpp.

◆ OpMixUTimesDivLambdaRhs

using OpMixUTimesDivLambdaRhs = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<I>::OpMixVecTimesDivLambda<SPACE_DIM>

Definition at line 65 of file contact.cpp.

◆ OpMixUTimesLambdaRhs

Definition at line 67 of file contact.cpp.

◆ OpSpringLhs

Definition at line 69 of file contact.cpp.

◆ OpSpringRhs

using OpSpringRhs = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::LinearForm<I>::OpBaseTimesVector<1, SPACE_DIM, 1>

Definition at line 71 of file contact.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]

[Load mesh]

[Load mesh]

[CONTACT]

[CONTACT]

Definition at line 704 of file contact.cpp.

704 {
705
706#ifdef PYTHON_SFD
707 Py_Initialize();
708#endif
709
710 // Initialisation of MoFEM/PETSc and MOAB data structures
711 const char param_file[] = "param_file.petsc";
713
714 // Add logging channel for CONTACT
715 auto core_log = logging::core::get();
716 core_log->add_sink(
718 LogManager::setLog("CONTACT");
719 MOFEM_LOG_TAG("CONTACT", "indent");
720
721 try {
722
723 //! [Register MoFEM discrete manager in PETSc]
724 DMType dm_name = "DMMOFEM";
725 CHKERR DMRegister_MoFEM(dm_name);
726 //! [Register MoFEM discrete manager in PETSc
727
728 //! [Create MoAB]
729 moab::Core mb_instance; ///< mesh database
730 moab::Interface &moab = mb_instance; ///< mesh database interface
731 //! [Create MoAB]
732
733 //! [Create MoFEM]
734 MoFEM::Core core(moab); ///< finite element database
735 MoFEM::Interface &m_field = core; ///< finite element database interface
736 //! [Create MoFEM]
737
738 //! [Load mesh]
739 Simple *simple = m_field.getInterface<Simple>();
740 CHKERR simple->getOptions();
741 CHKERR simple->loadFile("");
742 //! [Load mesh]
743
744 //! [CONTACT]
745 Contact ex(m_field);
746 CHKERR ex.runProblem();
747 //! [CONTACT]
748 }
750
752
753#ifdef PYTHON_SFD
754 if (Py_FinalizeEx() < 0) {
755 exit(120);
756 }
757#endif
758}
std::string param_file
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
static char help[]
[Check]
Definition: contact.cpp:702
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
#define CHKERR
Inline error check.
Definition: definitions.h:535
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:47
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:391
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
Core (interface) class.
Definition: Core.hpp:82
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
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
Deprecated interface functions.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
Definition: LogManager.cpp:300
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:346
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.

Variable Documentation

◆ A

constexpr AssemblyType A = AssemblyType::PETSC
constexpr

Definition at line 25 of file contact.cpp.

◆ alpha_dumping

double alpha_dumping = 0

Definition at line 127 of file contact.cpp.

◆ cn

double cn = 0.1
Examples
ContactOps.hpp.

Definition at line 124 of file contact.cpp.

◆ CONTACT_SPACE

constexpr FieldSpace CONTACT_SPACE = ElementsAndOps<SPACE_DIM>::CONTACT_SPACE
constexpr

Definition at line 54 of file contact.cpp.

◆ geom_order

constexpr int geom_order
constexpr
Initial value:
=
1

Currently calculation of normals at integration points is missing on edges (i.e. 2d case). We have to restrict to linear geometry in 2d.

Definition at line 118 of file contact.cpp.

◆ help

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

[Check]

Definition at line 702 of file contact.cpp.

◆ I

constexpr IntegrationType I
constexpr
Initial value:
=
IntegrationType::GAUSS

Definition at line 26 of file contact.cpp.

◆ is_quasi_static

constexpr bool is_quasi_static = true
constexpr
Examples
NonlinearElasticElementInterface.hpp.

Definition at line 115 of file contact.cpp.

◆ order

int order = 2

Definition at line 117 of file contact.cpp.

◆ poisson_ratio

double poisson_ratio = 0.25

Definition at line 122 of file contact.cpp.

◆ rho

double rho = 0.0

Definition at line 123 of file contact.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM
constexpr
Initial value:
=
#define EXECUTABLE_DIMENSION
Definition: contact.cpp:11

Definition at line 42 of file contact.cpp.

◆ spring_stiffness

double spring_stiffness = 0.1

Definition at line 125 of file contact.cpp.

◆ young_modulus

double young_modulus = 100

Definition at line 121 of file contact.cpp.