https://mooseframework.inl.gov
SidesetReaction.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 "SidesetReaction.h"
11 #include "metaphysicl/raw_type.h"
12 
13 registerMooseObject("SolidMechanicsApp", SidesetReaction);
14 registerMooseObject("SolidMechanicsApp", ADSidesetReaction);
15 
16 template <bool is_ad>
19 {
21  params.addClassDescription("Computes the integrated reaction force in a user-specified direction "
22  "on a sideset from the surface traction");
23  params.addRequiredParam<MaterialPropertyName>("stress_tensor", "The rank two stress tensor name");
24  params.addRequiredParam<RealVectorValue>("direction",
25  "Direction in which the force is to be computed");
26  params.set<bool>("use_displaced_mesh") = true;
27  return params;
28 }
29 
30 template <bool is_ad>
32  : SideIntegralPostprocessor(parameters),
33  _tensor(getGenericMaterialProperty<RankTwoTensor, is_ad>("stress_tensor")),
34  _dir(getParam<RealVectorValue>("direction"))
35 {
36 }
37 
38 template <bool is_ad>
39 Real
41 {
42  return _normals[_qp] * (MetaPhysicL::raw_value(_tensor[_qp]) * _dir);
43 }
44 
45 template class SidesetReactionTempl<false>;
46 template class SidesetReactionTempl<true>;
static InputParameters validParams()
T & set(const std::string &name, bool quiet_mode=false)
auto raw_value(const Eigen::Map< T > &in)
registerMooseObject("SolidMechanicsApp", SidesetReaction)
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real computeQpIntegral() override
This postprocessor computes the integral of the force on a sideset in direction _dir.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
SidesetReactionTempl(const InputParameters &parameters)