https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RayTracingAngularQuadratureErrorTest.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
14
17{
18 auto params = GeneralUserObject::validParams();
19
20 params.addParam<bool>("non_positive_polar_order", false, "Tests non-positive polar_order");
21 params.addParam<bool>(
22 "non_positive_azimuthal_order", false, "Tests non-positive azimuthal_order");
23 params.addParam<bool>("mu_min_larger", false, "Tests mu_min being larger than mu_max");
24 params.addParam<bool>("mu_min_too_small", false, "Tests mu_min < -1");
25 params.addParam<bool>("mu_max_too_big", false, "Tests mu_max > 1");
26 params.addParam<bool>("dim1", false, "Tests dimension 1");
27 params.addParam<bool>("non_positive_gauss_legendre_order",
28 false,
29 "Tests non-positive order in gauss-legendre quadrature");
30 params.addParam<bool>("check_direction", false, "Checks for a non-valid direction index");
31 params.addParam<bool>("orthonormal_vector_zero",
32 false,
33 "Tests getting an orthonormal vector to a vector that has a zero norm");
34
35 return params;
36}
37
39 const InputParameters & parameters)
40 : GeneralUserObject(parameters)
41{
42 if (getParam<bool>("non_positive_polar_order"))
43 RayTracingAngularQuadrature(2, 0, 1, -1, 1);
44 if (getParam<bool>("non_positive_azimuthal_order"))
45 RayTracingAngularQuadrature(2, 1, 0, -1, 1);
46 if (getParam<bool>("mu_min_larger"))
47 RayTracingAngularQuadrature(2, 1, 1, 1, 0);
48 if (getParam<bool>("mu_min_too_small"))
49 RayTracingAngularQuadrature(2, 1, 1, -2, 0);
50 if (getParam<bool>("mu_max_too_big"))
51 RayTracingAngularQuadrature(2, 1, 1, -1, 2);
52 if (getParam<bool>("dim1"))
53 RayTracingAngularQuadrature(1, 1, 1, -1, 1);
54 if (getParam<bool>("non_positive_gauss_legendre_order"))
55 {
56 std::vector<Real> x, y;
57 RayTracingAngularQuadrature(2, 1, 1, -1, 1).gaussLegendre(0, x, y);
58 }
59 if (getParam<bool>("check_direction"))
60 RayTracingAngularQuadrature(2, 1, 1, -1, 1).checkDirection(1337);
61 if (getParam<bool>("orthonormal_vector_zero"))
63}
const std::vector< double > y
const std::vector< double > x
registerMooseObject("RayTracingTestApp", RayTracingAngularQuadratureErrorTest)
static InputParameters validParams()
RayTracingAngularQuadratureErrorTest(const InputParameters &parameters)
void checkDirection(const unsigned int l) const
Throws a MooseError if the angular quadrature does not have direction l.
static void gaussLegendre(const unsigned int order, std::vector< Real > &x, std::vector< Real > &w)
Builds Gauss-Legendre quadrature on [0, 1] (symmetric about 0.5), with weights that sum to 1.
static libMesh::Point orthonormalVector(const libMesh::Point &v)
Gets the vector that is orthonormal to v.