www.mooseframework.org
SumTensorIncrements.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "SumTensorIncrements.h"
8 #include "libmesh/quadrature.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Material>();
15  params.addClassDescription("Compute tensor property by summing tensor increments");
16  params.addRequiredParam<MaterialPropertyName>("tensor_name", "Name of strain property");
17  params.addParam<std::vector<MaterialPropertyName>>("coupled_tensor_increment_names",
18  "Name of strain increment properties");
19  return params;
20 }
21 
22 SumTensorIncrements::SumTensorIncrements(const InputParameters & parameters)
23  : DerivativeMaterialInterface<Material>(parameters),
24  _property_names(getParam<std::vector<MaterialPropertyName>>("coupled_tensor_increment_names")),
25  _tensor(declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("tensor_name"))),
26  _tensor_old(
27  getMaterialPropertyOld<RankTwoTensor>(getParam<MaterialPropertyName>("tensor_name"))),
28  _tensor_increment(declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("tensor_name") +
29  "_increment"))
30 {
32 
33  if (_num_property > 0)
34  {
36 
37  for (unsigned int i = 0; i < _num_property; ++i)
38  _coupled_tensor_increments[i] = &getMaterialProperty<RankTwoTensor>(_property_names[i]);
39  }
40 }
41 
42 void
44 {
45  _tensor[_qp].zero();
46  _tensor_increment[_qp].zero();
47 }
48 
49 void
51 {
52  _tensor_increment[_qp].zero();
53 
54  for (unsigned int i = 0; i < _num_property; ++i)
56 
57  _tensor[_qp] = _tensor_old[_qp] + _tensor_increment[_qp];
58 }
MaterialProperty< RankTwoTensor > & _tensor
virtual void initQpStatefulProperties()
virtual void computeQpProperties()
MaterialProperty< RankTwoTensor > & _tensor_increment
InputParameters validParams< SumTensorIncrements >()
std::vector< MaterialPropertyName > _property_names
const MaterialProperty< RankTwoTensor > & _tensor_old
SumTensorIncrements(const InputParameters &parameters)
std::vector< const MaterialProperty< RankTwoTensor > * > _coupled_tensor_increments