https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADComputeLinearElasticStress.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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#include "RankTwoTensor.h"
12#include "RankFourTensor.h"
15
18
19template <typename R2, typename R4>
22{
24 params.addClassDescription("Compute stress using elasticity for small strains");
25 return params;
26}
27
28template <typename R2, typename R4>
30 const InputParameters & parameters)
31 : ADComputeStressBaseTempl<R2>(parameters),
32 _elasticity_tensor_name(_base_name + "elasticity_tensor"),
33 _elasticity_tensor(this->template getADMaterialProperty<R4>(_elasticity_tensor_name))
34{
35}
36
37template <typename R2, typename R4>
38void
40{
41 if (this->template hasBlockMaterialProperty<R2>(_base_name + "strain_increment"))
42 mooseError("This linear elastic stress calculation only works for small strains; use "
43 "ADComputeFiniteStrainElasticStress for simulations using incremental and finite "
44 "strains.");
45}
46
47template <typename R2, typename R4>
48void
50{
51 // stress = C * e
52 _stress[_qp] = _elasticity_tensor[_qp] * _mechanical_strain[_qp];
53
54 // Assign value for elastic strain, which is equal to the mechanical strain
55 _elastic_strain[_qp] = _mechanical_strain[_qp];
56}
57
registerMooseObject("SolidMechanicsApp", ADComputeLinearElasticStress)
void mooseError(Args &&... args)
ADComputeLinearElasticStress computes the stress following linear elasticity theory (small strains)
ADComputeLinearElasticStressTempl(const InputParameters &parameters)
ADComputeStressBaseTempl is the base class for stress tensors.
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)