https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CoupledDirectionalMeshHeightInterpolation.C
Go to the documentation of this file.
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
11#include "MooseMesh.h"
12
13#include "libmesh/mesh_tools.h"
14
16
19{
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.");
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
45Real
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}
registerMooseObject("MiscApp", CoupledDirectionalMeshHeightInterpolation)
SubProblem & _subproblem
const Node *const & _current_node
static InputParameters validParams()
Couples to some other value and modulates it by the mesh height in a direction.
CoupledDirectionalMeshHeightInterpolation(const InputParameters &parameters)
unsigned int _direction
The direction to interpolate in.
static InputParameters validParams()
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
const VariableValue & _coupled_val
The value of a coupled variable to modulate.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual MooseMesh & mesh()=0