https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SumTensorIncrements.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
10#include "SumTensorIncrements.h"
11#include "libmesh/quadrature.h"
12
14
17{
19 params.addClassDescription("Compute tensor property by summing tensor increments");
20 params.addRequiredParam<MaterialPropertyName>("tensor_name", "Name of strain property");
21 params.addParam<std::vector<MaterialPropertyName>>("coupled_tensor_increment_names",
22 "Name of strain increment properties");
23 return params;
24}
25
28 _property_names(getParam<std::vector<MaterialPropertyName>>("coupled_tensor_increment_names")),
29 _tensor(declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("tensor_name"))),
30 _tensor_old(
31 getMaterialPropertyOld<RankTwoTensor>(getParam<MaterialPropertyName>("tensor_name"))),
32 _tensor_increment(declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("tensor_name") +
33 "_increment"))
34{
36
37 if (_num_property > 0)
38 {
40
41 for (unsigned int i = 0; i < _num_property; ++i)
42 _coupled_tensor_increments[i] = &getMaterialProperty<RankTwoTensor>(_property_names[i]);
43 }
44}
45
46void
52
53void
55{
56 _tensor_increment[_qp].zero();
57
58 for (unsigned int i = 0; i < _num_property; ++i)
60
61 _tensor[_qp] = _tensor_old[_qp] + _tensor_increment[_qp];
62}
registerMooseObject("SolidMechanicsApp", SumTensorIncrements)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
SumTensorIncrements update a tensor by summing tensor increments passed as property.
static InputParameters validParams()
const MaterialProperty< RankTwoTensor > & _tensor_old
SumTensorIncrements(const InputParameters &parameters)
virtual void computeQpProperties()
virtual void initQpStatefulProperties()
MaterialProperty< RankTwoTensor > & _tensor_increment
MaterialProperty< RankTwoTensor > & _tensor
std::vector< MaterialPropertyName > _property_names
std::vector< const MaterialProperty< RankTwoTensor > * > _coupled_tensor_increments