www.mooseframework.org
ComputePlaneSmallStrain.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 registerMooseObject("TensorMechanicsApp", ComputePlaneSmallStrain);
13 
15 
16 InputParameters
18 {
19  InputParameters params = Compute2DSmallStrain::validParams();
20  params.addClassDescription("Compute a small strain under generalized plane strain assumptions "
21  "where the out of plane strain is generally nonzero.");
22  params.addParam<UserObjectName>("subblock_index_provider",
23  "SubblockIndexProvider user object name");
24  params.addCoupledVar("scalar_out_of_plane_strain",
25  "Scalar variable for generalized plane strain");
26  params.addCoupledVar("out_of_plane_strain", "Nonlinear variable for plane stress condition");
27 
28  return params;
29 }
30 
31 ComputePlaneSmallStrain::ComputePlaneSmallStrain(const InputParameters & parameters)
32  : Compute2DSmallStrain(parameters),
33  _subblock_id_provider(isParamValid("subblock_index_provider")
34  ? &getUserObject<SubblockIndexProvider>("subblock_index_provider")
35  : nullptr),
36  _scalar_out_of_plane_strain_coupled(isParamValid("scalar_out_of_plane_strain")),
37  _out_of_plane_strain_coupled(isCoupled("out_of_plane_strain")),
38  _out_of_plane_strain(_out_of_plane_strain_coupled ? coupledValue("out_of_plane_strain")
39  : _zero),
40  _nscalar_strains(coupledScalarComponents("scalar_out_of_plane_strain"))
41 {
43  mooseError("Must define only one of out_of_plane_strain or scalar_out_of_plane_strain");
44 
46  {
48  for (unsigned int i = 0; i < _nscalar_strains; ++i)
49  _scalar_out_of_plane_strain[i] = &coupledScalarValue("scalar_out_of_plane_strain", i);
50  }
51 }
52 
53 Real
55 {
58  else
59  return _out_of_plane_strain[_qp];
60 }
Compute2DSmallStrain
Compute2DSmallStrain defines a strain tensor, assuming small strains, in 2D geometries / simulations.
Definition: Compute2DSmallStrain.h:25
ComputePlaneSmallStrain::_scalar_out_of_plane_strain_coupled
const bool _scalar_out_of_plane_strain_coupled
Definition: ComputePlaneSmallStrain.h:44
registerMooseObject
registerMooseObject("TensorMechanicsApp", ComputePlaneSmallStrain)
ComputePlaneSmallStrain::computeOutOfPlaneStrain
virtual Real computeOutOfPlaneStrain()
Definition: ComputePlaneSmallStrain.C:54
ComputePlaneSmallStrain::validParams
static InputParameters validParams()
Definition: ComputePlaneSmallStrain.C:17
SubblockIndexProvider
Abstract base class for user objects that provide an index for a given element that is independent of...
Definition: SubblockIndexProvider.h:24
ComputePlaneSmallStrain::ComputePlaneSmallStrain
ComputePlaneSmallStrain(const InputParameters &parameters)
Definition: ComputePlaneSmallStrain.C:31
ComputePlaneSmallStrain
ComputePlaneSmallStrain defines small strains under generalized plane strain and plane stress assumpt...
Definition: ComputePlaneSmallStrain.h:25
ComputePlaneSmallStrain::getCurrentSubblockIndex
unsigned int getCurrentSubblockIndex() const
gets its subblock index for current element
Definition: ComputePlaneSmallStrain.h:36
ComputePlaneSmallStrain::_nscalar_strains
unsigned int _nscalar_strains
Definition: ComputePlaneSmallStrain.h:48
Compute2DSmallStrain::validParams
static InputParameters validParams()
Definition: Compute2DSmallStrain.C:17
ComputePlaneSmallStrain::_scalar_out_of_plane_strain
std::vector< const VariableValue * > _scalar_out_of_plane_strain
Definition: ComputePlaneSmallStrain.h:49
ComputePlaneSmallStrain::_out_of_plane_strain_coupled
const bool _out_of_plane_strain_coupled
Definition: ComputePlaneSmallStrain.h:46
ComputePlaneSmallStrain::_out_of_plane_strain
const VariableValue & _out_of_plane_strain
Definition: ComputePlaneSmallStrain.h:47
ComputePlaneSmallStrain.h
defineLegacyParams
defineLegacyParams(ComputePlaneSmallStrain)