https://mooseframework.inl.gov
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>(
28  "non_positive_gauss_legendre_order", false, "Tests non-positive order in gauss-legendre quadrature");
29  params.addParam<bool>("check_direction", false, "Checks for a non-valid direction index");
30  params.addParam<bool>("orthonormal_vector_zero",
31  false,
32  "Tests getting an orthonormal vector to a vector that has a zero norm");
33 
34  return params;
35 }
36 
38  const InputParameters & parameters)
39  : GeneralUserObject(parameters)
40 {
41  if (getParam<bool>("non_positive_polar_order"))
42  RayTracingAngularQuadrature(2, 0, 1, -1, 1);
43  if (getParam<bool>("non_positive_azimuthal_order"))
44  RayTracingAngularQuadrature(2, 1, 0, -1, 1);
45  if (getParam<bool>("mu_min_larger"))
46  RayTracingAngularQuadrature(2, 1, 1, 1, 0);
47  if (getParam<bool>("mu_min_too_small"))
48  RayTracingAngularQuadrature(2, 1, 1, -2, 0);
49  if (getParam<bool>("mu_max_too_big"))
50  RayTracingAngularQuadrature(2, 1, 1, -1, 2);
51  if (getParam<bool>("dim1"))
52  RayTracingAngularQuadrature(1, 1, 1, -1, 1);
53  if (getParam<bool>("non_positive_gauss_legendre_order"))
54  {
55  std::vector<Real> x, y;
56  RayTracingAngularQuadrature(2, 1, 1, -1, 1).gaussLegendre(0, x, y);
57  }
58  if (getParam<bool>("check_direction"))
59  RayTracingAngularQuadrature(2, 1, 1, -1, 1).checkDirection(1337);
60  if (getParam<bool>("orthonormal_vector_zero"))
62 }
static void gaussLegendre(const unsigned int order, std::vector< Real > &x, std::vector< Real > &w)
Builds Gauss-Legendre quadrature on 0, 1, with weights that sum to 1.
static InputParameters validParams()
const std::vector< double > y
RayTracingAngularQuadratureErrorTest(const InputParameters &parameters)
const std::vector< double > x
registerMooseObject("RayTracingTestApp", RayTracingAngularQuadratureErrorTest)
static libMesh::Point orthonormalVector(const libMesh::Point &v)
Gets the vector that is orthonormal to v.
void checkDirection(const unsigned int l) const
Throws a MooseError if the angular quadrature does not have direction l.