https://mooseframework.inl.gov
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 
16 {
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 
26  : SideIntegralPostprocessor(parameters),
27  _origin(getParam<Point>("origin")),
28  _direction(getParam<RealVectorValue>("direction"))
29 {
30  // normalize direction
32 }
33 
34 Real
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 }
RealVectorValue _direction
direction of the axis through the origin
Real computeQpIntegral() override
auto norm() const -> decltype(std::norm(Real()))
static InputParameters validParams()
const MooseArray< Point > & _q_point
Compute the polar moment of inertia of a sideset w.r.t.
PolarMomentOfInertia(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
auto norm_sq() const -> decltype(std::norm(Real()))
static InputParameters validParams()
registerMooseObject("SolidMechanicsApp", PolarMomentOfInertia)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
const Point _origin
origin point or center to compute the moment with respect to