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