www.mooseframework.org
CoupledDirectionalMeshHeightInterpolation.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 
9 #include "MooseMesh.h"
10 
11 #include "libmesh/mesh_tools.h"
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<AuxKernel>();
18  params.addRequiredCoupledVar("coupled_var",
19  "The variable whose values are going to be interpolated.");
20 
21  MooseEnum directions("x y z");
22  params.addRequiredParam<MooseEnum>("direction", directions, "The direction to interpolate in.");
23 
24  return params;
25 }
26 
28  const InputParameters & parameters)
29  : AuxKernel(parameters),
30  _coupled_val(coupledValue("coupled_var")),
31  _direction(getParam<MooseEnum>("direction"))
32 {
33  BoundingBox bounding_box = MeshTools::create_bounding_box(_subproblem.mesh());
34 
35  _direction_min = bounding_box.min()(_direction);
36  _direction_max = bounding_box.max()(_direction);
37 }
38 
39 Real
41 {
42  const Node & current_pos = *_current_node;
43 
44  Real percentage_along_direction =
46 
47  return percentage_along_direction * _coupled_val[_qp];
48 }
InputParameters validParams< CoupledDirectionalMeshHeightInterpolation >()
const VariableValue & _coupled_val
The value of a coupled variable to modulate.
CoupledDirectionalMeshHeightInterpolation(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
unsigned int _direction
The direction to interpolate in.