www.mooseframework.org
solid_mechanics
src
postprocessors
Mass.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
// This post processor returns the mass value of an element. It is used
11
// to check that mass is conserved (per the evolving density calculation)
12
// when volume changes occur.
13
//
14
#include "
Mass.h
"
15
16
#include "metaphysicl/raw_type.h"
17
18
registerMooseObject
(
"SolidMechanicsApp"
,
Mass
);
19
registerMooseObject
(
"SolidMechanicsApp"
,
ADMass
);
20
21
template
<
bool
is_ad>
22
InputParameters
23
MassTempl<is_ad>::validParams
()
24
{
25
InputParameters
params =
ElementIntegralVariablePostprocessor::validParams
();
26
params.
set
<
bool
>(
"use_displaced_mesh"
) =
true
;
27
return
params;
28
}
29
30
template
<
bool
is_ad>
31
MassTempl<is_ad>::MassTempl
(
const
InputParameters
& parameters)
32
:
ElementIntegralVariablePostprocessor
(parameters),
33
_density(getGenericMaterialProperty<
Real
, is_ad>(
"density"
))
34
{
35
}
36
37
template
<
bool
is_ad>
38
Real
39
MassTempl<is_ad>::computeQpIntegral
()
40
{
41
return
MetaPhysicL::raw_value
(_density[_qp]);
42
}
43
44
template
class
MassTempl<false>
;
45
template
class
MassTempl<true>
;
Mass.h
MassTempl::MassTempl
MassTempl(const InputParameters ¶meters)
Definition:
Mass.C:31
MassTempl::computeQpIntegral
virtual Real computeQpIntegral()
Definition:
Mass.C:39
InputParameters::set
T & set(const std::string &name, bool quiet_mode=false)
ElementIntegralVariablePostprocessor
MetaPhysicL::raw_value
auto raw_value(const Eigen::Map< T > &in)
InputParameters
MassTempl::validParams
static InputParameters validParams()
Definition:
Mass.C:23
ElementIntegralVariablePostprocessor::validParams
static InputParameters validParams()
Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MassTempl
This postprocessor computes the mass by integrating the density over the volume.
Definition:
Mass.h:18
registerMooseObject
registerMooseObject("SolidMechanicsApp", Mass)
Generated on Wed Apr 17 2024 11:25:17 for www.mooseframework.org by
1.8.14