https://mooseframework.inl.gov
GeneralizedPlaneStrainUserObjectBasePD.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 
11 #include "RankFourTensor.h"
12 
15 {
17  params.addClassDescription("Base class for calculating the scalar residual and diagonal Jacobian "
18  "entry for generalized plane strain formulation");
19 
20  MooseEnum strainType("SMALL", "SMALL");
21  params.addParam<MooseEnum>("strain", strainType, "Strain formulation");
22  params.addParam<FunctionName>(
23  "out_of_plane_pressure",
24  "0",
25  "Function used to prescribe pressure in the out-of-plane direction");
26  params.addParam<Real>("factor", 1.0, "Scale factor applied to prescribed pressure");
27  params.set<ExecFlagEnum>("execute_on") = EXEC_LINEAR;
28 
29  return params;
30 }
31 
33  const InputParameters & parameters)
34  : ElementUserObjectBasePD(parameters),
35  _strain(getParam<MooseEnum>("strain")),
36  _Cijkl(getMaterialProperty<RankFourTensor>("elasticity_tensor")),
37  _pressure(getFunction("out_of_plane_pressure")),
38  _factor(getParam<Real>("factor"))
39 {
40 }
41 
42 void
44 {
45  _residual = 0;
46  _jacobian = 0;
47 }
48 
49 void
51 {
52  const auto & gpsuo = static_cast<const GeneralizedPlaneStrainUserObjectBasePD &>(uo);
53  _residual += gpsuo._residual;
54  _jacobian += gpsuo._jacobian;
55 }
56 
57 void
59 {
62 }
63 
64 Real
66 {
67  return _residual;
68 }
69 
70 Real
72 {
73  return _jacobian;
74 }
Real returnResidual() const
Function to return the computed residual.
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
Real returnJacobian() const
Function to return the computed diagonal Jacobian.
void gatherSum(T &value)
const ExecFlagType EXEC_LINEAR
Base element userobject class for peridynamics.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void threadJoin(const UserObject &uo) override
GeneralizedPlaneStrainUserObjectBasePD(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
Base userObject class to compute the residual and diagonal Jacobian components for scalar out-of-plan...