v0.14.0
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< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  ElementsAndOps< 3 >
 
struct  PlasticOps::AddHOOps< FE_DIM, PROBLEM_DIM, SPACE_DIM >
 
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

 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 = ElementsAndOps<SPACE_DIM>::CONTACT_SPACE
 
PetscBool is_large_strains = PETSC_TRUE
 Large strains. More...
 
PetscBool set_timer = PETSC_FALSE
 Set timer. More...
 
PetscBool do_eval_field = PETSC_FALSE
 Evaluate field. More...
 
int atom_test = 0
 Atom test. More...
 
double scale = 1.
 
double young_modulus = 206913
 Young modulus. More...
 
double poisson_ratio = 0.29
 Poisson ratio. More...
 
double sigmaY = 450
 Yield stress. More...
 
double H = 129
 Hardening. More...
 
double visH = 0
 Viscous hardening. More...
 
double zeta = 5e-2
 Viscous hardening. More...
 
double Qinf = 265
 Saturation yield stress. More...
 
double b_iso = 16.93
 Saturation exponent. More...
 
double C1_k = 0
 Kinematic hardening. More...
 
double cn0 = 1
 
double cn1 = 1
 
int order = 2
 Order displacement. More...
 
int tau_order = order - 2
 Order of tau files. More...
 
int ep_order = order - 1
 Order of ep files. More...
 
int geom_order = 2
 Order if fixed. More...
 
PetscBool is_quasi_static = PETSC_TRUE
 
double rho = 0.0
 
double alpha_damping = 0
 
static char help [] = "...\n\n"
 [TestOperators] More...
 

Macro Definition Documentation

◆ EXECUTABLE_DIMENSION

#define EXECUTABLE_DIMENSION   3

Typedef Documentation

◆ BoundaryEle

Definition at line 57 of file plastic.cpp.

◆ BoundaryEleOp

Definition at line 58 of file plastic.cpp.

◆ BoundaryLhsBCs

Definition at line 175 of file plastic.cpp.

◆ BoundaryRhsBCs

using BoundaryRhsBCs = NaturalBC<BoundaryEleOp>::Assembly<AT>::LinearForm<IT>

Definition at line 172 of file plastic.cpp.

◆ DomainEle

Definition at line 55 of file plastic.cpp.

◆ DomainEleOp

Definition at line 56 of file plastic.cpp.

◆ DomainRhsBCs

using DomainRhsBCs = NaturalBC<DomainEleOp>::Assembly<AT>::LinearForm<IT>

Definition at line 169 of file plastic.cpp.

◆ EntData

Examples
plastic.cpp.

Definition at line 54 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 59 of file plastic.cpp.

◆ SetPtsData

Examples
plastic.cpp.

Definition at line 62 of file plastic.cpp.

◆ SideEle

Definition at line 61 of file plastic.cpp.

◆ SkinPostProcEle

Definition at line 60 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
plastic.cpp, and PlasticOpsGeneric.hpp.

Definition at line 73 of file plastic.cpp.

74  {
75  return H * tau + Qinf * (1. - iso_hardening_exp(tau, b_iso)) + sigmaY;
76 }

◆ iso_hardening_dtau()

double iso_hardening_dtau ( double  tau,
double  H,
double  Qinf,
double  b_iso 
)
inline
Examples
plastic.cpp, and PlasticOpsGeneric.hpp.

Definition at line 78 of file plastic.cpp.

79  {
80  auto r = [&](auto tau) {
81  return H + Qinf * b_iso * iso_hardening_exp(tau, b_iso);
82  };
83  constexpr double eps = 1e-12;
84  return std::max(r(tau), eps * r(0));
85 }

◆ iso_hardening_exp()

double iso_hardening_exp ( double  tau,
double  b_iso 
)
inline
Examples
plastic.cpp.

Definition at line 64 of file plastic.cpp.

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

◆ 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
plastic.cpp, and PlasticOpsGeneric.hpp.

Definition at line 92 of file plastic.cpp.

93  {
97  if (C1_k < std::numeric_limits<double>::epsilon()) {
98  t_alpha(i, j) = 0;
99  return t_alpha;
100  }
101  t_alpha(i, j) = C1_k * t_plastic_strain(i, j);
102  return t_alpha;
103 }

◆ kinematic_hardening_dplastic_strain()

template<int DIM>
auto kinematic_hardening_dplastic_strain ( double  C1_k)
inline
Examples
plastic.cpp.

Definition at line 106 of file plastic.cpp.

106  {
113  t_diff(i, j, k, l) = C1_k * (t_kd(i, k) ^ t_kd(j, l)) / 4.;
114  return t_diff;
115 }

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

Examples
plastic.cpp.

Definition at line 1560 of file plastic.cpp.

1560  {
1561 
1562 #ifdef ADD_CONTACT
1563  #ifdef PYTHON_SDF
1564  Py_Initialize();
1565  np::initialize();
1566  #endif
1567 #endif // ADD_CONTACT
1568 
1569  // Initialisation of MoFEM/PETSc and MOAB data structures
1570  const char param_file[] = "param_file.petsc";
1571  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
1572 
1573  // Add logging channel for example
1574  auto core_log = logging::core::get();
1575  core_log->add_sink(
1576  LogManager::createSink(LogManager::getStrmWorld(), "PLASTICITY"));
1577  core_log->add_sink(
1578  LogManager::createSink(LogManager::getStrmWorld(), "TIMER"));
1579  LogManager::setLog("PLASTICITY");
1580  MOFEM_LOG_TAG("PLASTICITY", "Plasticity");
1581 
1582 #ifdef ADD_CONTACT
1583  core_log->add_sink(
1584  LogManager::createSink(LogManager::getStrmWorld(), "CONTACT"));
1585  LogManager::setLog("CONTACT");
1586  MOFEM_LOG_TAG("CONTACT", "Contact");
1587 #endif // ADD_CONTACT
1588 
1589  core_log->add_sink(
1590  LogManager::createSink(LogManager::getStrmSync(), "PlasticSync"));
1591  LogManager::setLog("PlasticSync");
1592  MOFEM_LOG_TAG("PlasticSync", "PlasticSync");
1593 
1594  try {
1595 
1596  //! [Register MoFEM discrete manager in PETSc]
1597  DMType dm_name = "DMMOFEM";
1598  CHKERR DMRegister_MoFEM(dm_name);
1599  //! [Register MoFEM discrete manager in PETSc
1600 
1601  //! [Create MoAB]
1602  moab::Core mb_instance; ///< mesh database
1603  moab::Interface &moab = mb_instance; ///< mesh database interface
1604  //! [Create MoAB]
1605 
1606  //! [Create MoFEM]
1607  MoFEM::Core core(moab); ///< finite element database
1608  MoFEM::Interface &m_field = core; ///< finite element database interface
1609  //! [Create MoFEM]
1610 
1611  //! [Load mesh]
1612  Simple *simple = m_field.getInterface<Simple>();
1613  CHKERR simple->getOptions();
1614  CHKERR simple->loadFile();
1615  //! [Load mesh]
1616 
1617  //! [Example]
1618  Example ex(m_field);
1619  CHKERR ex.runProblem();
1620  //! [Example]
1621  }
1622  CATCH_ERRORS;
1623 
1625 
1626 #ifdef ADD_CONTACT
1627  #ifdef PYTHON_SDF
1628  if (Py_FinalizeEx() < 0) {
1629  exit(120);
1630  }
1631  #endif
1632 #endif // ADD_CONTACT
1633 
1634  return 0;
1635 }

Variable Documentation

◆ alpha_damping

double alpha_damping = 0
Examples
plastic.cpp.

Definition at line 145 of file plastic.cpp.

◆ AT

constexpr AssemblyType AT
constexpr
Initial value:
Examples
plastic.cpp.

Definition at line 44 of file plastic.cpp.

◆ atom_test

int atom_test = 0

Atom test.

Examples
plastic.cpp, and poisson_2d_homogeneous.cpp.

Definition at line 121 of file plastic.cpp.

◆ b_iso

double b_iso = 16.93

Saturation exponent.

Examples
plastic.cpp, and PlasticOps.hpp.

Definition at line 132 of file plastic.cpp.

◆ C1_k

double C1_k = 0

Kinematic hardening.

Examples
plastic.cpp, and PlasticOps.hpp.

Definition at line 133 of file plastic.cpp.

◆ cn0

double cn0 = 1
Examples
plastic.cpp, and PlasticOpsGeneric.hpp.

Definition at line 135 of file plastic.cpp.

◆ cn1

double cn1 = 1
Examples
plastic.cpp, and PlasticOpsGeneric.hpp.

Definition at line 136 of file plastic.cpp.

◆ CONTACT_SPACE

constexpr FieldSpace CONTACT_SPACE = ElementsAndOps<SPACE_DIM>::CONTACT_SPACE
constexpr
Examples
plastic.cpp.

Definition at line 52 of file plastic.cpp.

◆ do_eval_field

PetscBool do_eval_field = PETSC_FALSE

Evaluate field.

Examples
plastic.cpp, and PlasticOpsMonitor.hpp.

Definition at line 119 of file plastic.cpp.

◆ ep_order

int ep_order = order - 1

Order of ep files.

Examples
plastic.cpp.

Definition at line 140 of file plastic.cpp.

◆ geom_order

int geom_order = 2

Order if fixed.

Examples
adolc_plasticity.cpp, and plastic.cpp.

Definition at line 141 of file plastic.cpp.

◆ H

double H = 129

Hardening.

Examples
ADOLCPlasticityMaterialModels.hpp, HenckyOps.hpp, plastic.cpp, and PlasticOps.hpp.

Definition at line 128 of file plastic.cpp.

◆ help

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

[TestOperators]

Examples
plastic.cpp.

Definition at line 1558 of file plastic.cpp.

◆ is_large_strains

PetscBool is_large_strains = PETSC_TRUE

Large strains.

Examples
plastic.cpp, and PlasticOps.hpp.

Definition at line 117 of file plastic.cpp.

◆ is_quasi_static

PetscBool is_quasi_static = PETSC_TRUE
Examples
NonlinearElasticElementInterface.hpp, and plastic.cpp.

Definition at line 143 of file plastic.cpp.

◆ IT

constexpr IntegrationType IT
constexpr
Initial value:
Examples
plastic.cpp.

Definition at line 47 of file plastic.cpp.

◆ order

int order = 2

Order displacement.

Examples
plastic.cpp.

Definition at line 138 of file plastic.cpp.

◆ poisson_ratio

double poisson_ratio = 0.29

◆ Qinf

double Qinf = 265

Saturation yield stress.

Examples
plastic.cpp, and PlasticOps.hpp.

Definition at line 131 of file plastic.cpp.

◆ rho

double rho = 0.0

◆ scale

double scale = 1.

◆ set_timer

PetscBool set_timer = PETSC_FALSE

Set timer.

Examples
plastic.cpp.

Definition at line 118 of file plastic.cpp.

◆ sigmaY

double sigmaY = 450

Yield stress.

Examples
ADOLCPlasticityMaterialModels.hpp, plastic.cpp, and PlasticOps.hpp.

Definition at line 127 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:
Examples
plastic.cpp.

Definition at line 40 of file plastic.cpp.

◆ tau_order

int tau_order = order - 2

Order of tau files.

Examples
plastic.cpp.

Definition at line 139 of file plastic.cpp.

◆ visH

double visH = 0

Viscous hardening.

Examples
plastic.cpp, and PlasticOps.hpp.

Definition at line 129 of file plastic.cpp.

◆ young_modulus

double young_modulus = 206913

◆ zeta

double zeta = 5e-2

Viscous hardening.

Examples
plastic.cpp, PlasticOpsGeneric.hpp, and plot_base.cpp.

Definition at line 130 of file plastic.cpp.

MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
EXECUTABLE_DIMENSION
#define EXECUTABLE_DIMENSION
Definition: plastic.cpp:13
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
sigmaY
double sigmaY
Yield stress.
Definition: plastic.cpp:127
MoFEM::PETSC
@ PETSC
Definition: FormsIntegrators.hpp:105
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
sdf.r
int r
Definition: sdf.py:8
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:2010
iso_hardening_exp
double iso_hardening_exp(double tau, double b_iso)
Definition: plastic.cpp:64
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
Example
[Example]
Definition: plastic.cpp:216
help
static char help[]
[TestOperators]
Definition: plastic.cpp:1558
C1_k
double C1_k
Kinematic hardening.
Definition: plastic.cpp:133
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:136
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:139
FTensor::Index< 'i', DIM >
b_iso
double b_iso
Saturation exponent.
Definition: plastic.cpp:132
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:385
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
FTensor::Ddg
Definition: Ddg_value.hpp:7
Qinf
double Qinf
Saturation yield stress.
Definition: plastic.cpp:131
MoFEM::BLOCK_SCHUR
@ BLOCK_SCHUR
Definition: FormsIntegrators.hpp:108
FTensor::Kronecker_Delta_symmetric
Kronecker Delta class symmetric.
Definition: Kronecker_Delta.hpp:49
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
H
double H
Hardening.
Definition: plastic.cpp:128
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21