v0.13.1
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
plastic.cpp File Reference
#include <MoFEM.hpp>
#include <MatrixFunction.hpp>
#include <IntegrationRules.hpp>
#include <cblas.h>
#include <lapack_wrap.h>
#include <quad.h>
#include <HenckyOps.hpp>
#include <PlasticOps.hpp>

Go to the source code of this file.

Classes

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

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 PostProcEle = PostProcBrokenMeshInMoab< DomainEle >
 
using AssemblyDomainEleOp = FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase
 
using OpKCauchy = FormsIntegrators< DomainEleOp >::Assembly< A >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 >
 [Only used with Hooke equation (linear material model)] More...
 
using OpInternalForceCauchy = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< G >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM >
 
using OpMass = FormsIntegrators< DomainEleOp >::Assembly< A >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM >
 [Only used with Hooke equation (linear material model)] More...
 
using OpInertiaForce = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< G >::OpBaseTimesVector< 1, SPACE_DIM, 1 >
 
using OpKPiola = FormsIntegrators< DomainEleOp >::Assembly< A >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, 1 >
 [Only used for dynamics] More...
 
using OpInternalForcePiola = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< G >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM >
 
using OpBoundaryMass = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< G >::OpMass< 1, SPACE_DIM >
 [Only used with Hencky/nonlinear material] More...
 
using OpBoundaryVec = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< G >::OpBaseTimesVector< 1, SPACE_DIM, 0 >
 
using OpBoundaryInternal = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< G >::OpBaseTimesVector< 1, SPACE_DIM, 1 >
 
using OpScaleL2 = MoFEM::OpScaleBaseBySpaceInverseOfMeasure< DomainEleOp >
 [Essential boundary conditions] More...
 
using DomainNaturalBC = NaturalBC< DomainEleOp >::Assembly< A >::LinearForm< G >
 
using OpBodyForce = DomainNaturalBC::OpFlux< NaturalMeshsetType< BLOCKSET >, 1, SPACE_DIM >
 
using BoundaryNaturalBC = NaturalBC< BoundaryEleOp >::Assembly< A >::LinearForm< G >
 
using OpForce = BoundaryNaturalBC::OpFlux< NaturalMeshsetType< BLOCKSET >, 1, SPACE_DIM >
 
using OpEssentialLhs = EssentialBC< BoundaryEleOp >::Assembly< A >::BiLinearForm< GAUSS >::OpEssentialLhs< DisplacementCubitBcData, 1, SPACE_DIM >
 
using OpEssentialRhs = EssentialBC< BoundaryEleOp >::Assembly< A >::LinearForm< GAUSS >::OpEssentialRhs< DisplacementCubitBcData, 1, SPACE_DIM >
 

Functions

long double hardening (long double tau)
 
long double hardening_dtau (long double tau)
 
long double hardening_dtau2 (long double tau)
 
int main (int argc, char *argv[])
 

Variables

constexpr int SPACE_DIM
 
constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2
 
constexpr AssemblyType A = AssemblyType::PETSC
 
constexpr IntegrationType G
 
PetscBool is_large_strains = PETSC_TRUE
 
double scale = 1.
 
double young_modulus = 206913
 
double poisson_ratio = 0.29
 
double rho = 0
 
double sigmaY = 450
 
double H = 129
 
double visH = 0
 
double cn = 1
 
double zeta = 5e-2
 
double eta = 1e2
 
double Qinf = 265
 
double b_iso = 16.93
 
int order = 2
 Order if fixed. More...
 
int geom_order = 2
 Order if fixed. More...
 
static char help [] = "...\n\n"
 [Solve] More...
 

Macro Definition Documentation

◆ EXECUTABLE_DIMENSION

#define EXECUTABLE_DIMENSION   3

Typedef Documentation

◆ AssemblyDomainEleOp

◆ BoundaryEle

Definition at line 53 of file plastic.cpp.

◆ BoundaryEleOp

Definition at line 54 of file plastic.cpp.

◆ BoundaryNaturalBC

Definition at line 94 of file plastic.cpp.

◆ DomainEle

Definition at line 51 of file plastic.cpp.

◆ DomainEleOp

Definition at line 52 of file plastic.cpp.

◆ DomainNaturalBC

Definition at line 90 of file plastic.cpp.

◆ EntData

Definition at line 50 of file plastic.cpp.

◆ OpBodyForce

Definition at line 91 of file plastic.cpp.

◆ OpBoundaryInternal

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

Definition at line 85 of file plastic.cpp.

◆ OpBoundaryMass

[Only used with Hencky/nonlinear material]

[Essential boundary conditions]

Examples
contact.cpp, and helmholtz.cpp.

Definition at line 81 of file plastic.cpp.

◆ OpBoundaryVec

using OpBoundaryVec = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::LinearForm<G>::OpBaseTimesVector<1, SPACE_DIM, 0>
Examples
contact.cpp.

Definition at line 83 of file plastic.cpp.

◆ OpEssentialLhs

Definition at line 98 of file plastic.cpp.

◆ OpEssentialRhs

Definition at line 100 of file plastic.cpp.

◆ OpForce

Definition at line 95 of file plastic.cpp.

◆ OpInertiaForce

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

Definition at line 69 of file plastic.cpp.

◆ OpInternalForceCauchy

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

Definition at line 62 of file plastic.cpp.

◆ OpInternalForcePiola

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

Definition at line 76 of file plastic.cpp.

◆ OpKCauchy

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

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

Examples
contact.cpp, and plastic.cpp.

Definition at line 60 of file plastic.cpp.

◆ OpKPiola

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

[Only used for dynamics]

[Only used with Hencky/nonlinear material]

Examples
contact.cpp, and plastic.cpp.

Definition at line 74 of file plastic.cpp.

◆ OpMass

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

[Only used for dynamics]

Definition at line 67 of file plastic.cpp.

◆ OpScaleL2

[Essential boundary conditions]

Definition at line 88 of file plastic.cpp.

◆ PostProcEle

Definition at line 55 of file plastic.cpp.

Function Documentation

◆ hardening()

long double hardening ( long double  tau)
inline
Examples
PlasticOpsGeneric.hpp, and plastic.cpp.

Definition at line 122 of file plastic.cpp.

122 {
123 return H * tau + Qinf * (1. - std::exp(-b_iso * tau)) + sigmaY;
124}
double Qinf
Definition: plastic.cpp:116
double H
Definition: plastic.cpp:111
double b_iso
Definition: plastic.cpp:117
double sigmaY
Definition: plastic.cpp:110

◆ hardening_dtau()

long double hardening_dtau ( long double  tau)
inline
Examples
PlasticOpsGeneric.hpp, and plastic.cpp.

Definition at line 126 of file plastic.cpp.

126 {
127 return H + Qinf * b_iso * std::exp(-b_iso * tau);
128}

◆ hardening_dtau2()

long double hardening_dtau2 ( long double  tau)
inline
Examples
PlasticOpsGeneric.hpp, and plastic.cpp.

Definition at line 130 of file plastic.cpp.

130 {
131 return -(Qinf * (b_iso * b_iso)) * std::exp(-b_iso * tau);
132}

◆ 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 insterface

[Create MoFEM]

[Load mesh]

[Load mesh]

[Example]

[Example]

Definition at line 983 of file plastic.cpp.

983 {
984
985 // Initialisation of MoFEM/PETSc and MOAB data structures
986 const char param_file[] = "param_file.petsc";
988
989 // Add logging channel for example
990 auto core_log = logging::core::get();
991 core_log->add_sink(
993 LogManager::setLog("EXAMPLE");
994 MOFEM_LOG_TAG("EXAMPLE", "example");
995
996 try {
997
998 //! [Register MoFEM discrete manager in PETSc]
999 DMType dm_name = "DMMOFEM";
1000 CHKERR DMRegister_MoFEM(dm_name);
1001 //! [Register MoFEM discrete manager in PETSc
1002
1003 //! [Create MoAB]
1004 moab::Core mb_instance; ///< mesh database
1005 moab::Interface &moab = mb_instance; ///< mesh database interface
1006 //! [Create MoAB]
1007
1008 //! [Create MoFEM]
1009 MoFEM::Core core(moab); ///< finite element database
1010 MoFEM::Interface &m_field = core; ///< finite element database insterface
1011 //! [Create MoFEM]
1012
1013 //! [Load mesh]
1014 Simple *simple = m_field.getInterface<Simple>();
1015 CHKERR simple->getOptions();
1016 CHKERR simple->loadFile();
1017 //! [Load mesh]
1018
1019 //! [Example]
1020 Example ex(m_field);
1021 CHKERR ex.runProblem();
1022 //! [Example]
1023 }
1025
1027}
std::string param_file
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
#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: DMMMoFEM.cpp:47
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:364
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:332
static char help[]
[Solve]
Definition: plastic.cpp:981
[Example]
Definition: plastic.cpp:139
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:279
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:323
Simple interface for fast problem set-up.
Definition: Simple.hpp:26
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.

Variable Documentation

◆ A

constexpr AssemblyType A = AssemblyType::PETSC
constexpr

◆ b_iso

double b_iso = 16.93
Examples
plastic.cpp.

Definition at line 117 of file plastic.cpp.

◆ cn

double cn = 1
Examples
ContactOps.hpp, PlasticOps.hpp, contact.cpp, and plastic.cpp.

Definition at line 113 of file plastic.cpp.

◆ eta

double eta = 1e2
Examples
PlasticOpsGeneric.hpp, free_surface.cpp, plastic.cpp, and plot_base.cpp.

Definition at line 115 of file plastic.cpp.

◆ G

constexpr IntegrationType G
constexpr
Initial value:
=
IntegrationType::GAUSS
Examples
plastic.cpp.

Definition at line 47 of file plastic.cpp.

◆ geom_order

int geom_order = 2

Order if fixed.

Examples
plastic.cpp.

Definition at line 120 of file plastic.cpp.

◆ H

double H = 129
Examples
plastic.cpp.

Definition at line 111 of file plastic.cpp.

◆ help

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

[Solve]

Definition at line 981 of file plastic.cpp.

◆ is_large_strains

PetscBool is_large_strains = PETSC_TRUE
Examples
contact.cpp, and plastic.cpp.

Definition at line 103 of file plastic.cpp.

◆ order

int order = 2

Order if fixed.

Definition at line 119 of file plastic.cpp.

◆ poisson_ratio

double poisson_ratio = 0.29

Definition at line 108 of file plastic.cpp.

◆ Qinf

double Qinf = 265
Examples
plastic.cpp.

Definition at line 116 of file plastic.cpp.

◆ rho

double rho = 0

◆ scale

double scale = 1.

◆ sigmaY

double sigmaY = 450
Examples
PlasticOps.hpp, and plastic.cpp.

Definition at line 110 of file plastic.cpp.

◆ size_symm

constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2
constexpr

◆ SPACE_DIM

constexpr int SPACE_DIM
constexpr
Initial value:
=
#define EXECUTABLE_DIMENSION
Definition: plastic.cpp:10

Definition at line 42 of file plastic.cpp.

◆ visH

double visH = 0
Examples
PlasticOps.hpp, and plastic.cpp.

Definition at line 112 of file plastic.cpp.

◆ young_modulus

double young_modulus = 206913

◆ zeta

double zeta = 5e-2
Examples
PlasticOps.hpp, plastic.cpp, and plot_base.cpp.

Definition at line 114 of file plastic.cpp.