www.mooseframework.org
OutOfPlanePressure.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "OutOfPlanePressure.h"
9 #include "Function.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Kernel>();
16 
17  params.addClassDescription("Apply pressure in the out-of-plane direction in 2D plane stress or "
18  "generalized plane strain models ");
19  params.addParam<FunctionName>("function", "1.0", "Function used to prescribe pressure");
20  params.addParam<PostprocessorName>("postprocessor", "Postprocessor used to prescribe pressure");
21  params.addParam<Real>("factor", 1.0, "Scale factor applied to prescribed pressure");
22 
23  params.set<bool>("use_displaced_mesh") = true;
24 
25  return params;
26 }
27 
28 OutOfPlanePressure::OutOfPlanePressure(const InputParameters & parameters)
29  : Kernel(parameters),
30  _postprocessor(
31  parameters.isParamValid("postprocessor") ? &getPostprocessorValue("postprocessor") : NULL),
32  _function(getFunction("function")),
33  _factor(getParam<Real>("factor"))
34 {
35 }
36 
37 Real
39 {
40  Real val = _factor;
41 
42  val *= _function.value(_t, _q_point[_qp]);
43 
44  if (_postprocessor)
45  val *= *_postprocessor;
46 
47  return val * _test[_i][_qp];
48 }
InputParameters validParams< OutOfPlanePressure >()
OutOfPlanePressure(const InputParameters &parameters)
virtual Real computeQpResidual()
const PostprocessorValue *const _postprocessor