https://mooseframework.inl.gov
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 
13 registerMooseObject("SolidMechanicsApp", SumTensorIncrements);
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 
46 void
48 {
49  _tensor[_qp].zero();
50  _tensor_increment[_qp].zero();
51 }
52 
53 void
55 {
56  _tensor_increment[_qp].zero();
57 
58  for (unsigned int i = 0; i < _num_property; ++i)
60 
62 }
SumTensorIncrements update a tensor by summing tensor increments passed as property.
MaterialProperty< RankTwoTensor > & _tensor
virtual void initQpStatefulProperties()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
virtual void computeQpProperties()
void addRequiredParam(const std::string &name, const std::string &doc_string)
MaterialProperty< RankTwoTensor > & _tensor_increment
static InputParameters validParams()
std::vector< MaterialPropertyName > _property_names
registerMooseObject("SolidMechanicsApp", SumTensorIncrements)
static InputParameters validParams()
const MaterialProperty< RankTwoTensor > & _tensor_old
void addClassDescription(const std::string &doc_string)
SumTensorIncrements(const InputParameters &parameters)
std::vector< const MaterialProperty< RankTwoTensor > * > _coupled_tensor_increments