v0.16.0
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions | Variables
plastic.cpp File Reference
#include <MoFEM.hpp>
#include <MatrixFunction.hpp>
#include <IntegrationRules.hpp>
#include <HenckyOps.hpp>
#include <PlasticOps.hpp>
#include <PlasticNaturalBCs.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< 2 >
 
struct  ElementsAndOps< 3 >
 
struct  PlasticOps::AddHOOps< 2, 3, 3 >
 
struct  PlasticOps::AddHOOps< 1, 2, 2 >
 
struct  PlasticOps::AddHOOps< 3, 3, 3 >
 
struct  PlasticOps::AddHOOps< 2, 2, 2 >
 
struct  Example
 [Example] More...
 
struct  Example::ScaledTimeScale
 
struct  SetUpSchur
 [Push operators to pipeline] More...
 
struct  SetUpSchurImpl
 

Namespaces

namespace  PlasticOps
 

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 SkinPostProcEle = PostProcBrokenMeshInMoab< BoundaryEle >
 
using SideEle = ElementsAndOps< SPACE_DIM >::SideEle
 
using SetPtsData = FieldEvaluatorInterface::SetPtsData
 
using DomainRhsBCs = NaturalBC< DomainEleOp >::Assembly< AT >::LinearForm< IT >
 
using OpDomainRhsBCs = DomainRhsBCs::OpFlux< PlasticOps::DomainBCs, 1, SPACE_DIM >
 
using BoundaryRhsBCs = NaturalBC< BoundaryEleOp >::Assembly< AT >::LinearForm< IT >
 
using OpBoundaryRhsBCs = BoundaryRhsBCs::OpFlux< PlasticOps::BoundaryBCs, 1, SPACE_DIM >
 
using BoundaryLhsBCs = NaturalBC< BoundaryEleOp >::Assembly< AT >::BiLinearForm< IT >
 
using OpBoundaryLhsBCs = BoundaryLhsBCs::OpFlux< PlasticOps::BoundaryBCs, 1, SPACE_DIM >
 

Functions

double iso_hardening_exp (double tau, double b_iso)
 
double iso_hardening (double tau, double H, double Qinf, double b_iso, double sigmaY)
 
double iso_hardening_dtau (double tau, double H, double Qinf, double b_iso)
 
template<typename T , int DIM>
auto kinematic_hardening (FTensor::Tensor2_symmetric< T, DIM > &t_plastic_strain, double C1_k)
 
template<int DIM>
auto kinematic_hardening_dplastic_strain (double C1_k)
 
int main (int argc, char *argv[])
 
template<int FE_DIM, int PROBLEM_DIM, int SPACE_DIM>
MoFEMErrorCode PlasticOps::scaleL2 (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, std::string geom_field_name)
 

Variables

constexpr int SPACE_DIM
 
constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2
 
constexpr AssemblyType AT
 
constexpr IntegrationType IT
 
constexpr FieldSpace CONTACT_SPACE
 
PetscBool is_large_strains = PETSC_TRUE
 Large strains.
 
PetscBool set_timer = PETSC_FALSE
 Set timer.
 
PetscBool do_eval_field = PETSC_FALSE
 Evaluate field.
 
int atom_test = 0
 Atom test.
 
double scale = 1.
 
double young_modulus = 206913
 Young modulus.
 
double poisson_ratio = 0.29
 Poisson ratio.
 
double sigmaY = 450
 Yield stress.
 
double H = 129
 Hardening.
 
double visH = 0
 Viscous hardening.
 
double zeta = 5e-2
 Viscous hardening.
 
double Qinf = 265
 Saturation yield stress.
 
double b_iso = 16.93
 Saturation exponent.
 
double C1_k = 0
 Kinematic hardening.
 
double cn0 = 1
 
double cn1 = 1
 
int order = 2
 Order displacement.
 
int tau_order = order - 2
 Order of tau files.
 
int ep_order = order - 1
 Order of ep files.
 
int geom_order = 2
 Order if fixed.
 
PetscBool is_quasi_static = PETSC_TRUE
 
double rho = 0.0
 
double alpha_damping = 0
 
static char help [] = "...\n\n"
 [TestOperators]
 

Macro Definition Documentation

◆ EXECUTABLE_DIMENSION

#define EXECUTABLE_DIMENSION   3

Typedef Documentation

◆ BoundaryEle

Definition at line 58 of file plastic.cpp.

◆ BoundaryEleOp

Definition at line 59 of file plastic.cpp.

◆ BoundaryLhsBCs

Definition at line 176 of file plastic.cpp.

◆ BoundaryRhsBCs

Definition at line 173 of file plastic.cpp.

◆ DomainEle

Definition at line 56 of file plastic.cpp.

◆ DomainEleOp

Definition at line 57 of file plastic.cpp.

◆ DomainRhsBCs

Definition at line 170 of file plastic.cpp.

◆ EntData

Definition at line 55 of file plastic.cpp.

◆ OpBoundaryLhsBCs

using OpBoundaryLhsBCs = BoundaryLhsBCs::OpFlux<PlasticOps::BoundaryBCs, 1, SPACE_DIM>

Definition at line 177 of file plastic.cpp.

◆ OpBoundaryRhsBCs

using OpBoundaryRhsBCs = BoundaryRhsBCs::OpFlux<PlasticOps::BoundaryBCs, 1, SPACE_DIM>

Definition at line 174 of file plastic.cpp.

◆ OpDomainRhsBCs

using OpDomainRhsBCs = DomainRhsBCs::OpFlux<PlasticOps::DomainBCs, 1, SPACE_DIM>

Definition at line 171 of file plastic.cpp.

◆ PostProcEle

Definition at line 60 of file plastic.cpp.

◆ SetPtsData

Definition at line 63 of file plastic.cpp.

◆ SideEle

Definition at line 62 of file plastic.cpp.

◆ SkinPostProcEle

Definition at line 61 of file plastic.cpp.

Function Documentation

◆ iso_hardening()

double iso_hardening ( double  tau,
double  H,
double  Qinf,
double  b_iso,
double  sigmaY 
)
inline

Isotropic hardening

Examples
PlasticOpsGeneric.hpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-0_plasticity/src/PlasticOpsGeneric.hpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 74 of file plastic.cpp.

75 {
76 return H * tau + Qinf * (1. - iso_hardening_exp(tau, b_iso)) + sigmaY;
77}
double Qinf
Saturation yield stress.
Definition plastic.cpp:132
double H
Hardening.
Definition plastic.cpp:129
double iso_hardening_exp(double tau, double b_iso)
Definition plastic.cpp:65
double b_iso
Saturation exponent.
Definition plastic.cpp:133
double sigmaY
Yield stress.
Definition plastic.cpp:128

◆ iso_hardening_dtau()

double iso_hardening_dtau ( double  tau,
double  H,
double  Qinf,
double  b_iso 
)
inline
Examples
PlasticOpsGeneric.hpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-0_plasticity/src/PlasticOpsGeneric.hpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 79 of file plastic.cpp.

80 {
81 auto r = [&](auto tau) {
82 return H + Qinf * b_iso * iso_hardening_exp(tau, b_iso);
83 };
84 constexpr double eps = 1e-12;
85 return std::max(r(tau), eps * r(0));
86}
const double eps
Definition HenckyOps.hpp:13
int r
Definition sdf.py:205

◆ iso_hardening_exp()

double iso_hardening_exp ( double  tau,
double  b_iso 
)
inline
Examples
mofem/tutorials/adv-0_plasticity/plastic.cpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 65 of file plastic.cpp.

65 {
66 return std::exp(
67 std::max(static_cast<double>(std::numeric_limits<float>::min_exponent10),
68 -b_iso * tau));
69}

◆ kinematic_hardening()

template<typename T , int DIM>
auto kinematic_hardening ( FTensor::Tensor2_symmetric< T, DIM > &  t_plastic_strain,
double  C1_k 
)
inline

Kinematic hardening

Examples
PlasticOpsGeneric.hpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, mofem/tutorials/adv-0_plasticity/src/PlasticOpsGeneric.hpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 93 of file plastic.cpp.

94 {
95 FTensor::Index<'i', DIM> i;
96 FTensor::Index<'j', DIM> j;
98 if (C1_k < std::numeric_limits<double>::epsilon()) {
99 t_alpha(i, j) = 0;
100 return t_alpha;
101 }
102 t_alpha(i, j) = C1_k * t_plastic_strain(i, j);
103 return t_alpha;
104}
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
double C1_k
Kinematic hardening.
Definition plastic.cpp:134

◆ kinematic_hardening_dplastic_strain()

template<int DIM>
auto kinematic_hardening_dplastic_strain ( double  C1_k)
inline
Examples
mofem/tutorials/adv-0_plasticity/plastic.cpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 107 of file plastic.cpp.

107 {
108 FTensor::Index<'i', DIM> i;
109 FTensor::Index<'j', DIM> j;
110 FTensor::Index<'k', DIM> k;
111 FTensor::Index<'l', DIM> l;
114 t_diff(i, j, k, l) = C1_k * (t_kd(i, k) ^ t_kd(j, l)) / 4.;
115 return t_diff;
116}
Kronecker Delta class symmetric.
constexpr auto t_kd
FTensor::Index< 'l', 3 > l
FTensor::Index< 'k', 3 > k

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

[Example]

[Example]

Definition at line 1590 of file plastic.cpp.

1590 {
1591
1592#ifdef ADD_CONTACT
1593 #ifdef ENABLE_PYTHON_BINDING
1594 Py_Initialize();
1595 np::initialize();
1596 #endif
1597#endif // ADD_CONTACT
1598
1599 // Initialisation of MoFEM/PETSc and MOAB data structures
1600 const char param_file[] = "param_file.petsc";
1601 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
1602
1603 // Add logging channel for example
1604 auto core_log = logging::core::get();
1605 core_log->add_sink(
1607 core_log->add_sink(
1609 LogManager::setLog("PLASTICITY");
1610 MOFEM_LOG_TAG("PLASTICITY", "Plasticity");
1611
1612#ifdef ADD_CONTACT
1613 core_log->add_sink(
1615 LogManager::setLog("CONTACT");
1616 MOFEM_LOG_TAG("CONTACT", "Contact");
1617#endif // ADD_CONTACT
1618
1619 core_log->add_sink(
1621 LogManager::setLog("PlasticSync");
1622 MOFEM_LOG_TAG("PlasticSync", "PlasticSync");
1623
1624 try {
1625
1626 //! [Register MoFEM discrete manager in PETSc]
1627 DMType dm_name = "DMMOFEM";
1628 CHKERR DMRegister_MoFEM(dm_name);
1629 //! [Register MoFEM discrete manager in PETSc
1630
1631 //! [Create MoAB]
1632 moab::Core mb_instance; ///< mesh database
1633 moab::Interface &moab = mb_instance; ///< mesh database interface
1634 //! [Create MoAB]
1635
1636 //! [Create MoFEM]
1637 MoFEM::Core core(moab); ///< finite element database
1638 MoFEM::Interface &m_field = core; ///< finite element database interface
1639 //! [Create MoFEM]
1640
1641 //! [Load mesh]
1642 Simple *simple = m_field.getInterface<Simple>();
1644 CHKERR simple->loadFile();
1645 //! [Load mesh]
1646
1647 //! [Example]
1648 Example ex(m_field);
1649 CHKERR ex.runProblem();
1650 //! [Example]
1651 }
1653
1655
1656#ifdef ADD_CONTACT
1657 #ifdef ENABLE_PYTHON_BINDING
1658 if (Py_FinalizeEx() < 0) {
1659 exit(120);
1660 }
1661 #endif
1662#endif // ADD_CONTACT
1663
1664 return 0;
1665}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
[Example]
Definition plastic.cpp:217
Core (interface) class.
Definition Core.hpp:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
Deprecated interface functions.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
Simple interface for fast problem set-up.
Definition Simple.hpp:27
MoFEMErrorCode getOptions()
get options
Definition Simple.cpp:180
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
static char help[]
[TestOperators]
Definition plastic.cpp:1588

Variable Documentation

◆ alpha_damping

double alpha_damping = 0

◆ AT

constexpr AssemblyType AT
constexpr
Initial value:
=
(SCHUR_ASSEMBLE) ? AssemblyType::BLOCK_SCHUR
AssemblyType
[Storage and set boundary conditions]
@ PETSC
Standard PETSc assembly.
#define SCHUR_ASSEMBLE
Definition contact.cpp:18

Definition at line 44 of file plastic.cpp.

◆ atom_test

int atom_test = 0

◆ b_iso

double b_iso = 16.93

◆ C1_k

double C1_k = 0

◆ cn0

double cn0 = 1

◆ cn1

double cn1 = 1

◆ CONTACT_SPACE

constexpr FieldSpace CONTACT_SPACE
constexpr

◆ do_eval_field

PetscBool do_eval_field = PETSC_FALSE

◆ ep_order

int ep_order = order - 1

Order of ep files.

Examples
mofem/tutorials/adv-0_plasticity/plastic.cpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 141 of file plastic.cpp.

◆ geom_order

int geom_order = 2

◆ H

double H = 129

◆ help

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

[TestOperators]

Definition at line 1588 of file plastic.cpp.

◆ is_large_strains

PetscBool is_large_strains = PETSC_TRUE

◆ is_quasi_static

PetscBool is_quasi_static = PETSC_TRUE

◆ IT

constexpr IntegrationType IT
constexpr
Initial value:
=
IntegrationType::GAUSS

Definition at line 47 of file plastic.cpp.

◆ order

int order = 2

Order displacement.

Definition at line 139 of file plastic.cpp.

◆ poisson_ratio

double poisson_ratio = 0.29

◆ Qinf

double Qinf = 265

◆ rho

double rho = 0.0

◆ scale

double scale = 1.

◆ set_timer

PetscBool set_timer = PETSC_FALSE

Set timer.

Examples
mofem/tutorials/adv-0_plasticity/plastic.cpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 119 of file plastic.cpp.

◆ sigmaY

double sigmaY = 450

◆ size_symm

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

◆ SPACE_DIM

constexpr int SPACE_DIM
constexpr
Initial value:
=
3

Definition at line 40 of file plastic.cpp.

◆ tau_order

int tau_order = order - 2

Order of tau files.

Examples
mofem/tutorials/adv-0_plasticity/plastic.cpp, plastic.cpp, and thermoplastic.cpp.

Definition at line 140 of file plastic.cpp.

◆ visH

double visH = 0

◆ young_modulus

double young_modulus = 206913

◆ zeta

double zeta = 5e-2