www.mooseframework.org
OutOfPlanePressure.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 
10 #include "OutOfPlanePressure.h"
11 #include "Function.h"
12 
13 registerMooseObject("SolidMechanicsApp", OutOfPlanePressure);
14 
17 {
19 
20  params.addClassDescription("Apply pressure in the out-of-plane direction in 2D plane stress or "
21  "generalized plane strain models ");
22  params.addParam<FunctionName>("function", "1.0", "Function used to prescribe pressure");
23  params.addParam<PostprocessorName>("postprocessor", "Postprocessor used to prescribe pressure");
24  params.addParam<Real>("factor", 1.0, "Scale factor applied to prescribed pressure");
25 
26  params.set<bool>("use_displaced_mesh") = true;
27 
28  return params;
29 }
30 
32  : Kernel(parameters),
33  _postprocessor(
34  parameters.isParamValid("postprocessor") ? &getPostprocessorValue("postprocessor") : NULL),
35  _function(getFunction("function")),
36  _factor(getParam<Real>("factor"))
37 {
38 }
39 
40 Real
42 {
43  Real val = _factor;
44 
45  val *= _function.value(_t, _q_point[_qp]);
46 
47  if (_postprocessor)
48  val *= *_postprocessor;
49 
50  return val * _test[_i][_qp];
51 }
const Function & _function
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)
const VariableTestValue & _test
Real & _t
OutOfPlanePressure(const InputParameters &parameters)
unsigned int _i
virtual Real computeQpResidual()
const PostprocessorValue *const _postprocessor
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
registerMooseObject("SolidMechanicsApp", OutOfPlanePressure)
void addClassDescription(const std::string &doc_string)
virtual Real value(Real t, const Point &p) const
const MooseArray< Point > & _q_point
unsigned int _qp
OutOfPlanePressure is a kernel used to apply pressure in the out-of-plane direction in 2D plane stres...