https://mooseframework.inl.gov
solid_mechanics
src
postprocessors
PolarMomentOfInertia.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 "
PolarMomentOfInertia.h
"
11
12
registerMooseObject
(
"SolidMechanicsApp"
,
PolarMomentOfInertia
);
13
14
InputParameters
15
PolarMomentOfInertia::validParams
()
16
{
17
InputParameters
params =
SideIntegralPostprocessor::validParams
();
18
params.
addRequiredParam
<Point>(
"origin"
,
"Axis origin"
);
19
params.
addRequiredParam
<
RealVectorValue
>(
"direction"
,
"Axis direction"
);
20
params.
addClassDescription
(
21
"Compute the polar moment of inertia of a sideset w.r.t. a point and a direction"
);
22
return
params;
23
}
24
25
PolarMomentOfInertia::PolarMomentOfInertia
(
const
InputParameters
& parameters)
26
:
SideIntegralPostprocessor
(parameters),
27
_origin(getParam<Point>(
"origin"
)),
28
_direction(getParam<
RealVectorValue
>(
"direction"
))
29
{
30
// normalize direction
31
_direction
/=
_direction
.
norm
();
32
}
33
34
Real
35
PolarMomentOfInertia::computeQpIntegral
()
36
{
37
auto
dr =
_q_point
[
_qp
] -
_origin
;
38
const
auto
projection =
_direction
* (
_direction
* dr);
39
dr -= projection;
40
41
return
dr.
norm_sq
();
42
}
PolarMomentOfInertia::_direction
RealVectorValue _direction
direction of the axis through the origin
Definition:
PolarMomentOfInertia.h:31
PolarMomentOfInertia::computeQpIntegral
Real computeQpIntegral() override
Definition:
PolarMomentOfInertia.C:35
VectorValue< Real >::norm
auto norm() const -> decltype(std::norm(Real()))
SideIntegralPostprocessor::validParams
static InputParameters validParams()
SideIntegralPostprocessor::_q_point
const MooseArray< Point > & _q_point
PolarMomentOfInertia
Compute the polar moment of inertia of a sideset w.r.t.
Definition:
PolarMomentOfInertia.h:17
VectorValue< Real >
PolarMomentOfInertia::PolarMomentOfInertia
PolarMomentOfInertia(const InputParameters ¶meters)
Definition:
PolarMomentOfInertia.C:25
SideIntegralPostprocessor::_qp
unsigned int _qp
InputParameters::addRequiredParam
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters
VectorValue< Real >::norm_sq
auto norm_sq() const -> decltype(std::norm(Real()))
PolarMomentOfInertia.h
PolarMomentOfInertia::validParams
static InputParameters validParams()
Definition:
PolarMomentOfInertia.C:15
SideIntegralPostprocessor
registerMooseObject
registerMooseObject("SolidMechanicsApp", PolarMomentOfInertia)
Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
PolarMomentOfInertia::_origin
const Point _origin
origin point or center to compute the moment with respect to
Definition:
PolarMomentOfInertia.h:28
Generated on Fri Jul 18 2025 11:57:24 for https://mooseframework.inl.gov by
1.8.14