https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DiscreteLineSegmentInterfaceTestAux.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
13
16{
19
20 MooseEnum test_type("axial_coord radial_coord axial_section_index axial_element_index");
21 params.addRequiredParam<MooseEnum>("test_type", test_type, "Type of test");
22
23 params.addClassDescription("Tests DiscreteLineSegmentInterface.");
24
25 return params;
26}
27
29 const InputParameters & params)
30 : AuxKernel(params),
32 _test_type(getParam<MooseEnum>("test_type"))
33{
34}
35
36Real
38{
39 const Point p = isNodal() ? *_current_node : _q_point[_qp];
40
41 if (_test_type == "axial_coord")
43 else if (_test_type == "radial_coord")
45 else if (_test_type == "axial_section_index")
46 return getAxialSectionIndex(p);
47 else if (_test_type == "axial_element_index")
48 return getAxialElementIndex(p);
49 else
50 mooseError("Invalid 'test_type'.");
51}
registerMooseObject("ThermalHydraulicsTestApp", DiscreteLineSegmentInterfaceTestAux)
const Real p
const MooseArray< Point > & _q_point
const Node *const & _current_node
static InputParameters validParams()
DiscreteLineSegmentInterfaceTestAux(const InputParameters &params)
const MooseEnum & _test_type
Which interface to test.
Defines a discretized line segment in 3D space.
Real computeAxialCoordinate(const Point &p) const
unsigned int getAxialElementIndex(const Point &p_center) const
Real computeRadialCoordinate(const Point &p) const
unsigned int getAxialSectionIndex(const Point &p) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const