www.mooseframework.org
MaskedBodyForce.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 #include "MaskedBodyForce.h"
8 #include "Function.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<BodyForce>();
15  params.addClassDescription("Kernel that defines a body force modified by a material mask");
16  params.addParam<MaterialPropertyName>("mask", "Material property defining the mask");
17  return params;
18 }
19 
20 MaskedBodyForce::MaskedBodyForce(const InputParameters & parameters)
21  : BodyForce(parameters), _mask(getMaterialProperty<Real>("mask"))
22 {
23 }
24 
25 Real
27 {
28  return BodyForce::computeQpResidual() * _mask[_qp];
29 }
virtual Real computeQpResidual()
const MaterialProperty< Real > & _mask
InputParameters validParams< MaskedBodyForce >()
MaskedBodyForce(const InputParameters &parameters)