www.mooseframework.org
Compute2DIncrementalStrain.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
12 #include "libmesh/quadrature.h"
13 
16 {
18  params.addClassDescription("Compute strain increment for incremental strains in 2D geometries.");
19 
20  MooseEnum outOfPlaneDirection("x y z", "z");
21  params.addParam<MooseEnum>(
22  "out_of_plane_direction", outOfPlaneDirection, "The direction of the out-of-plane strain.");
23  return params;
24 }
25 
27  : ComputeIncrementalSmallStrain(parameters),
28  _out_of_plane_direction(getParam<MooseEnum>("out_of_plane_direction"))
29 {
30 }
31 
32 void
34 {
35  for (unsigned int i = 0; i < 3; ++i)
36  {
37  if (_out_of_plane_direction == i)
38  {
39  _disp[i] = &_zero;
40  _grad_disp[i] = &_grad_zero;
41  }
42  else
43  {
44  _disp[i] = &coupledValue("displacements", i);
45  _grad_disp[i] = &coupledGradient("displacements", i);
46  }
47 
49  _grad_disp_old[i] = &coupledGradientOld("displacements", i);
50  else
52  }
53 }
54 
55 void
57 {
58  // Deformation gradient calculation for 2D problems
60  (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
61 
62  // Old Deformation gradient
64  (*_grad_disp_old[0])[_qp], (*_grad_disp_old[1])[_qp], (*_grad_disp_old[2])[_qp]);
65 
66  // Compute the displacement gradient of the out of plane direction for plane strain,
67  // generalized plane strain, or axisymmetric problems
70 
72  _deformation_gradient[_qp].addIa(1.0);
73 
74  A -= Fbar; // very nearly A = gradU - gradUold
75 
76  total_strain_increment = 0.5 * (A + A.transpose());
77 }
78 
79 void
81 {
82  if (_out_of_plane_direction != 2 && _ndisp != 3)
83  mooseError("For 2D simulations where the out-of-plane direction is x or y the number of "
84  "supplied displacements must be three.");
85  else if (_out_of_plane_direction == 2 && _ndisp != 2)
86  mooseError("For 2D simulations where the out-of-plane direction is z the number of supplied "
87  "displacements must be two.");
88 }
Compute2DIncrementalStrain(const InputParameters &parameters)
virtual Real computeOutOfPlaneGradDisp()=0
Computes the current out-of-plane component of the displacement gradient; as a virtual function...
MaterialProperty< RankTwoTensor > & _deformation_gradient
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const VariableGradient & _grad_zero
std::vector< const VariableValue * > _disp
Displacement variables.
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
virtual void displacementIntegrityCheck() override
static InputParameters validParams()
virtual Real computeOutOfPlaneGradDispOld()=0
Computes the old out-of-plane component of the displacement gradient; as a virtual function...
static RankTwoTensorTempl initializeFromRows(const libMesh::TypeVector< Real > &row0, const libMesh::TypeVector< Real > &row1, const libMesh::TypeVector< Real > &row2)
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
virtual const VariableGradient & coupledGradientOld(const std::string &var_name, unsigned int comp=0) const
unsigned int _ndisp
Coupled displacement variables.
ComputeIncrementalSmallStrain defines a strain increment and rotation increment (=1), for small strains.
std::vector< const VariableGradient * > _grad_disp_old
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
virtual bool isTransient() const override
virtual void computeTotalStrainIncrement(RankTwoTensor &total_strain_increment) override
Computes the current and old deformation gradients with the assumptions for 2D geometries, including plane strain, generalized plane strain, and axisymmetric, and returns the total strain increment tensor.
std::vector< const VariableGradient * > _grad_disp
Gradient of displacements.