https://mooseframework.inl.gov
MaterialTensorAverage.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 "MaterialTensorAverage.h"
11 
12 registerMooseObject("SolidMechanicsApp", MaterialTensorAverage);
13 registerMooseObject("SolidMechanicsApp", ADMaterialTensorAverage);
14 
15 template <bool is_ad>
18 {
20  params.addClassDescription("Computes the average of a RankTwoTensor component over a volume.");
21  return params;
22 }
23 
24 template <bool is_ad>
26  : MaterialTensorIntegralTempl<is_ad>(parameters), _volume(0.0)
27 {
28 }
29 
30 template <bool is_ad>
31 void
33 {
35 
36  _volume = 0.0;
37 }
38 
39 template <bool is_ad>
40 void
42 {
44 
45  _volume += this->_current_elem_volume;
46 }
47 
48 template <bool is_ad>
49 Real
51 {
52  return _integral_value / _volume;
53 }
54 
55 template <bool is_ad>
56 void
58 {
61 }
62 
63 template <bool is_ad>
64 void
66 {
68 
69  const auto & pps = static_cast<const MaterialTensorAverageTempl<is_ad> &>(y);
70  _volume += pps._volume;
71 }
72 
static InputParameters validParams()
const std::vector< double > y
registerMooseObject("SolidMechanicsApp", MaterialTensorAverage)
MaterialTensorAverageTempl(const InputParameters &parameters)
virtual void initialize() override
virtual void threadJoin(const UserObject &y) override
virtual void finalize() override
virtual void execute() override
virtual Real getValue() const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This postprocessor computes the volume average of a component of a RankTwoTensor as specified by the ...
virtual void initialize() override
virtual void execute() override
void addClassDescription(const std::string &doc_string)
virtual void threadJoin(const UserObject &y) override
This postprocessor computes an element integral of a component of a material tensor as specified by t...
static InputParameters validParams()