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("TensorMechanicsApp", OutOfPlanePressure);
14 
16 
17 InputParameters
19 {
20  InputParameters params = Kernel::validParams();
21 
22  params.addClassDescription("Apply pressure in the out-of-plane direction in 2D plane stress or "
23  "generalized plane strain models ");
24  params.addParam<FunctionName>("function", "1.0", "Function used to prescribe pressure");
25  params.addParam<PostprocessorName>("postprocessor", "Postprocessor used to prescribe pressure");
26  params.addParam<Real>("factor", 1.0, "Scale factor applied to prescribed pressure");
27 
28  params.set<bool>("use_displaced_mesh") = true;
29 
30  return params;
31 }
32 
33 OutOfPlanePressure::OutOfPlanePressure(const InputParameters & parameters)
34  : Kernel(parameters),
35  _postprocessor(
36  parameters.isParamValid("postprocessor") ? &getPostprocessorValue("postprocessor") : NULL),
37  _function(getFunction("function")),
38  _factor(getParam<Real>("factor"))
39 {
40 }
41 
42 Real
44 {
45  Real val = _factor;
46 
47  val *= _function.value(_t, _q_point[_qp]);
48 
49  if (_postprocessor)
50  val *= *_postprocessor;
51 
52  return val * _test[_i][_qp];
53 }
OutOfPlanePressure.h
registerMooseObject
registerMooseObject("TensorMechanicsApp", OutOfPlanePressure)
OutOfPlanePressure::OutOfPlanePressure
OutOfPlanePressure(const InputParameters &parameters)
Definition: OutOfPlanePressure.C:33
OutOfPlanePressure::_function
const Function & _function
Definition: OutOfPlanePressure.h:40
OutOfPlanePressure::validParams
static InputParameters validParams()
Definition: OutOfPlanePressure.C:18
defineLegacyParams
defineLegacyParams(OutOfPlanePressure)
OutOfPlanePressure::_postprocessor
const PostprocessorValue *const _postprocessor
Definition: OutOfPlanePressure.h:39
validParams
InputParameters validParams()
OutOfPlanePressure
OutOfPlanePressure is a kernel used to apply pressure in the out-of-plane direction in 2D plane stres...
Definition: OutOfPlanePressure.h:28
OutOfPlanePressure::computeQpResidual
virtual Real computeQpResidual()
Definition: OutOfPlanePressure.C:43
OutOfPlanePressure::_factor
const Real _factor
Definition: OutOfPlanePressure.h:41