www.mooseframework.org
MaterialTensorIntegral.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "MaterialTensorIntegral.h"
11 #include "RankTwoScalarTools.h"
12 
13 registerMooseObject("TensorMechanicsApp", MaterialTensorIntegral);
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<ElementIntegralPostprocessor>();
20  params.addClassDescription("This postprocessor computes an element integral of "
21  "a component of a material tensor as specified by "
22  "the user-supplied indices");
23  params.addRequiredParam<MaterialPropertyName>("rank_two_tensor",
24  "The rank two material tensor name");
25  params.addRequiredRangeCheckedParam<unsigned int>(
26  "index_i",
27  "index_i >= 0 & index_i <= 2",
28  "The index i of ij for the tensor to output (0, 1, 2)");
29  params.addRequiredRangeCheckedParam<unsigned int>(
30  "index_j",
31  "index_j >= 0 & index_j <= 2",
32  "The index j of ij for the tensor to output (0, 1, 2)");
33  params.set<bool>("use_displaced_mesh") = true;
34  return params;
35 }
36 
37 MaterialTensorIntegral::MaterialTensorIntegral(const InputParameters & parameters)
38  : ElementIntegralPostprocessor(parameters),
39  _tensor(getMaterialProperty<RankTwoTensor>("rank_two_tensor")),
40  _i(getParam<unsigned int>("index_i")),
41  _j(getParam<unsigned int>("index_j"))
42 {
43 }
44 
45 Real
47 {
49 }
const MaterialProperty< RankTwoTensor > & _tensor
registerMooseObject("TensorMechanicsApp", MaterialTensorIntegral)
Real component(const RankTwoTensor &r2tensor, unsigned int i, unsigned int j)
InputParameters validParams< MaterialTensorIntegral >()
MaterialTensorIntegral(const InputParameters &parameters)
This postprocessor computes an element integral of a component of a material tensor as specified by t...