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