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 
19 {
21  params.addRequiredCoupledVar(
22  "coupled_var",
23  "The variable whose values are scaled based on position relative to the model bounds.");
24 
25  MooseEnum directions("x y z");
26  params.addRequiredParam<MooseEnum>("direction", directions, "The direction to interpolate in.");
27  params.addClassDescription(
28  "Scales a variable based on position relative to the model bounds in a specified direction");
29 
30  return params;
31 }
32 
34  const InputParameters & parameters)
35  : AuxKernel(parameters),
36  _coupled_val(coupledValue("coupled_var")),
37  _direction(getParam<MooseEnum>("direction"))
38 {
39  BoundingBox bounding_box = MeshTools::create_bounding_box(_subproblem.mesh());
40 
41  _direction_min = bounding_box.min()(_direction);
42  _direction_max = bounding_box.max()(_direction);
43 }
44 
45 Real
47 {
48  const Node & current_pos = *_current_node;
49 
50  const Real fraction_along_direction =
52 
53  return fraction_along_direction * _coupled_val[_qp];
54 }
virtual MooseMesh & mesh()=0
const VariableValue & _coupled_val
The value of a coupled variable to modulate.
const Node *const & _current_node
CoupledDirectionalMeshHeightInterpolation(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
static const std::string directions[3]
Definition: NS.h:22
unsigned int _direction
The direction to interpolate in.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
registerMooseObject("MiscApp", CoupledDirectionalMeshHeightInterpolation)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Couples to some other value and modulates it by the mesh height in a direction.
SubProblem & _subproblem
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
static InputParameters validParams()
Factory constructor, takes parameters so that all derived classes can be built using the same constru...