https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15
16template <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
30template <bool is_ad>
32 : SideIntegralPostprocessor(parameters),
33 _tensor(getGenericMaterialProperty<RankTwoTensor, is_ad>("stress_tensor")),
34 _dir(getParam<RealVectorValue>("direction"))
35{
36}
37
38template <bool is_ad>
39Real
41{
42 return _normals[_qp] * (MetaPhysicL::raw_value(_tensor[_qp]) * _dir);
43}
44
45template class SidesetReactionTempl<false>;
46template class SidesetReactionTempl<true>;
registerMooseObject("SolidMechanicsApp", SidesetReaction)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()
This postprocessor computes the integral of the force on a sideset in direction _dir.
SidesetReactionTempl(const InputParameters &parameters)
virtual Real computeQpIntegral() override
static InputParameters validParams()
auto raw_value(const Eigen::Map< T > &in)