https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADComputeIncrementalStrainBase.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 "MooseMesh.h"
12#include "RankTwoTensor.h"
13#include "RankFourTensor.h"
16
17template <typename R2>
24
25template <typename R2>
27 const InputParameters & parameters)
28 : ADComputeStrainBaseTempl<R2>(parameters),
29 _grad_disp_old(3),
30 _strain_rate(this->template declareADProperty<R2>(_base_name + "strain_rate")),
31 _strain_increment(this->template declareADProperty<R2>(_base_name + "strain_increment")),
32 _rotation_increment(
33 this->template declareADProperty<RankTwoTensor>(_base_name + "rotation_increment")),
34 _mechanical_strain_old(
35 this->template getMaterialPropertyOld<R2>(_base_name + "mechanical_strain")),
36 _total_strain_old(this->template getMaterialPropertyOld<R2>(_base_name + "total_strain")),
37 _eigenstrains_old(_eigenstrain_names.size())
38{
39 for (unsigned int i = 0; i < _eigenstrains_old.size(); ++i)
40 _eigenstrains_old[i] = &this->template getMaterialPropertyOld<R2>(_eigenstrain_names[i]);
41}
42
43template <typename R2>
44void
46{
48 for (unsigned int i = 0; i < 3; ++i)
49 {
50 if (this->_fe_problem.isTransient() && i < _ndisp)
51 _grad_disp_old[i] = &this->coupledGradientOld("displacements", i);
52 else
53 _grad_disp_old[i] = &_grad_zero;
54 }
55}
56
57template <typename R2>
58void
60{
61 _mechanical_strain[_qp].zero();
62 _total_strain[_qp].zero();
63}
64
65template <typename R2>
66void
68{
69 for (unsigned int i = 0; i < _eigenstrains.size(); ++i)
70 {
71 strain -= (*_eigenstrains[i])[_qp];
72 strain += (*_eigenstrains_old[i])[_qp];
73 }
74}
75
ADComputeIncrementalStrainBase is the base class for strain tensors using incremental formulations.
std::vector< const MaterialProperty< R2 > * > _eigenstrains_old
ADComputeIncrementalStrainBaseTempl(const InputParameters &parameters)
ADComputeStrainBase is the base class for strain tensors.
std::vector< MaterialPropertyName > _eigenstrain_names
static InputParameters validParams()