www.mooseframework.org
GeneralizedPlaneStrainUserObjectBasePD.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<ElementUserObjectBasePD>();
18  params.addClassDescription("Base class for calculating the scalar residual and diagonal Jacobian "
19  "entry for generalized plane strain formulation");
20 
21  MooseEnum strainType("SMALL", "SMALL");
22  params.addParam<MooseEnum>("strain", strainType, "Strain formulation");
23  params.addParam<FunctionName>(
24  "out_of_plane_pressure",
25  "0",
26  "Function used to prescribe pressure in the out-of-plane direction");
27  params.addParam<Real>("factor", 1.0, "Scale factor applied to prescribed pressure");
28  params.set<ExecFlagEnum>("execute_on") = EXEC_LINEAR;
29 
30  return params;
31 }
32 
34  const InputParameters & parameters)
35  : ElementUserObjectBasePD(parameters),
36  _strain(getParam<MooseEnum>("strain")),
37  _Cijkl(getMaterialProperty<RankFourTensor>("elasticity_tensor")),
38  _pressure(getFunction("out_of_plane_pressure")),
39  _factor(getParam<Real>("factor"))
40 {
41 }
42 
43 void
45 {
46  _residual = 0;
47  _jacobian = 0;
48 }
49 
50 void
52 {
54  static_cast<const GeneralizedPlaneStrainUserObjectBasePD &>(uo);
55  _residual += gpsuo._residual;
56  _jacobian += gpsuo._jacobian;
57 }
58 
59 void
61 {
62  gatherSum(_residual);
63  gatherSum(_jacobian);
64 }
65 
66 Real
68 {
69  return _residual;
70 }
71 
72 Real
74 {
75  return _jacobian;
76 }
GeneralizedPlaneStrainUserObjectBasePD.h
GeneralizedPlaneStrainUserObjectBasePD::returnResidual
Real returnResidual() const
Function to return the computed residual.
Definition: GeneralizedPlaneStrainUserObjectBasePD.C:67
validParams< ElementUserObjectBasePD >
InputParameters validParams< ElementUserObjectBasePD >()
Definition: ElementUserObjectBasePD.C:16
GeneralizedPlaneStrainUserObjectBasePD::initialize
virtual void initialize() override
Definition: GeneralizedPlaneStrainUserObjectBasePD.C:44
validParams< GeneralizedPlaneStrainUserObjectBasePD >
InputParameters validParams< GeneralizedPlaneStrainUserObjectBasePD >()
Definition: GeneralizedPlaneStrainUserObjectBasePD.C:15
GeneralizedPlaneStrainUserObjectBasePD::threadJoin
virtual void threadJoin(const UserObject &uo) override
Definition: GeneralizedPlaneStrainUserObjectBasePD.C:51
GeneralizedPlaneStrainUserObjectBasePD::_jacobian
Real _jacobian
Jacobian parameter.
Definition: GeneralizedPlaneStrainUserObjectBasePD.h:60
GeneralizedPlaneStrainUserObjectBasePD::GeneralizedPlaneStrainUserObjectBasePD
GeneralizedPlaneStrainUserObjectBasePD(const InputParameters &parameters)
Definition: GeneralizedPlaneStrainUserObjectBasePD.C:33
GeneralizedPlaneStrainUserObjectBasePD
Base userObject class to compute the residual and diagonal Jacobian components for scalar out-of-plan...
Definition: GeneralizedPlaneStrainUserObjectBasePD.h:23
GeneralizedPlaneStrainUserObjectBasePD::_residual
Real _residual
Residual parameter.
Definition: GeneralizedPlaneStrainUserObjectBasePD.h:57
ElementUserObjectBasePD
Base element userobject class for peridynamics.
Definition: ElementUserObjectBasePD.h:23
RankFourTensorTempl
Definition: ACGrGrElasticDrivingForce.h:20
GeneralizedPlaneStrainUserObjectBasePD::finalize
virtual void finalize() override
Definition: GeneralizedPlaneStrainUserObjectBasePD.C:60
GeneralizedPlaneStrainUserObjectBasePD::returnJacobian
Real returnJacobian() const
Function to return the computed diagonal Jacobian.
Definition: GeneralizedPlaneStrainUserObjectBasePD.C:73