Classes | |
| class | AngularQuadratureSet |
| Wrapper class that owns an angular QuadratureBase<Ordinate> of the type corresponding to the given AngularQuadSet. More... | |
| struct | AngularTreatmentParams |
| Parameters from the "angular_treatment" section of the input file. More... | |
| class | BankBase |
| Base class for banks that store objects of type T by integer ID and look them up by the name given in the JSON input file. More... | |
| class | BCBank |
| Bank holding the boundary conditions defined in the input file. More... | |
| class | CGProblem |
| Class defining a Continuous Galerkin formulation of the SAAF transport equation. More... | |
| class | ConstantVolumetricSource |
| Defines a constant-value, isotropic volumetric source. More... | |
| class | Element |
| Defines a subset of the domain (an "element"). More... | |
| class | GaussChebyshev |
| Class defines a Gauss-Chebyshev quadrature set, which approximates the integral of the form: More... | |
| class | GaussLegendre |
| Defines a Gauss-Legendre quadrature set on the interval [-1,1]. More... | |
| class | GaussLegendreChebyshev |
| Class defines a Gauss-Legendre-Chebyshev quadrature set on the unit sphere, where a Gauss-Legendre quadrature set is used along the polar direction, and a Gauss-Chebyshev quadrature set is used along the azimuthal direction. More... | |
| class | GaussLegendreTrapezoid |
| Class defines a Gauss-Legendre-Trapezoid rule on the unit sphere, where a Gauss-Legendre rule is used on the polar coordinate, and a trapezoid rule is used on the azimuthal. More... | |
| class | GaussLobattoLegendre |
| Class defining a 1D Gauss-Legendre-Lobatto quadrature set on [-1,1]. The quadrature set approximates the integral using a set of weights ( \(w_k\)) and abscissas ( \(\xi_k\)): More... | |
| struct | GlobalForcingData |
| Convenience struct for hold the contribution for an entry in a single element to the global forcing vector. More... | |
| struct | GlobalMatrixData |
| Convenience struct for holding the contribution for an entry in a single element to the global matrix. More... | |
| struct | InputParams |
| All parameters parsed from the input file. More... | |
| struct | Material |
| Defines a monoenergetic, constant-properties material. More... | |
| class | MaterialBank |
| Bank holding the materials defined in the input file. More... | |
| class | Mesh |
| Class defing a mesh. More... | |
| struct | MeshParams |
| Parameters from the "mesh" section of the input file. More... | |
| struct | Node |
| A point in the mesh holding its coordinates, boundary info, and flux solution values. More... | |
| class | Ordinate |
| Defines a solid angle, or ordinate, in spherical geometry. More... | |
| class | ParsedVolumetricSource |
| Defines a volumetric source defined by a parsed function passed by the user. More... | |
| class | ProblemBase |
| Base class defining a formulation of the transport equation to be solved. More... | |
| struct | ProblemParams |
| Parameters from the "problem" section of the input file. More... | |
| class | QuadratureBase |
| Base class for defining a quadrature set. More... | |
| struct | QuadraturePair |
| Simple struct holding a function value evaluated at the supplied abscissa value. More... | |
| class | Results |
| Exports simulation results to a file. More... | |
| class | Segment |
| 1D line element defined by two boundary nodes, with interior nodes placed at Gauss-Lobatto-Legendre points More... | |
| class | SEMProblem |
| Wrapper class that owns a ProblemBase of the type corresponding to the given FEFormulation. More... | |
| struct | Simulation |
| Tracks the running state of a simulation across source iterations. More... | |
| class | SourceBank |
| Bank holding the volumetric sources defined in the input file. More... | |
| class | SourceBase |
| Base class for independent sources. More... | |
| struct | SourceIterationParams |
| Parameters from the "source_iteration" section of the input file. More... | |
| struct | SpectralElementParams |
| Parameters from the "spectral_elements" section of the input file. More... | |
Enumerations | |
| enum class | BC { VACUUM , REFLECTIVE , NONE } |
| Available boundary conditions. More... | |
| enum class | Boundary { NORTH , SOUTH , EAST , WEST } |
| Boundary locations. More... | |
| enum class | SourceType { PARSED_FUNCTION } |
| Available volumetric source types. More... | |
| enum class | FEFormulation { CG } |
| Available finite element formulations. More... | |
| enum class | TransportForm { SAAF } |
| Available forms of the transport equation. More... | |
| enum class | AngularQuadSet { GLT , GL , GLC } |
| Angular quadrature set. More... | |
| enum class | RunMode { FIXED_SOURCE } |
| Run modes available. More... | |
| enum class | OutputFormat { VTK , CSV } |
| Output forms available for export. More... | |
Functions | |
| void | from_json (const json &j, Material &material) |
| Get the Material information from the json input. | |
| void | from_json (const json &j, ProblemParams &problem_params) |
| Retrieve problem params from input. | |
| void | from_json (const json &j, MeshParams &mesh_params) |
| Retrieve mesh parameters from input. | |
| void | from_json (const json &j, AngularTreatmentParams &angular_treatment_params) |
| Retrieve the angular treatment params from input. | |
| void | from_json (const json &j, SpectralElementParams &se_params) |
| Retrieve spectral element params from input. | |
| void | from_json (const json &j, SourceIterationParams &source_iter_params) |
| Retrieve the source iteration params from input. | |
| void | from_json (const json &j, InputParams &input_params) |
| Retrieve input parameters from the user. | |
| double | LegendrePolynomial (const int n, const double x) |
| Computes the Legendre polynomial of degree n at a point x using the formula: | |
| double | LegendrePolynomialPrime (const int n, const double x) |
| Computes the first derivative of the Legendre polynomial of degree n at a point x using the recurrence relation: | |
| double | LegendrePolynomialPrimePrime (const int n, const double x) |
| Computes the second derivative of the Legendre polynomial of degree n using Legendre's differential equation: | |
| std::vector< double > | AllLegendreRoots (const int n) |
| Compute all roots of the Legendre polynomial of order n. | |
| double | LegendreRoot (const int n, const int k) |
| Computes the k-th root of the n-th order Legendre polynomial by first approximating the root with ApproximateLegendreRoot, then using Newton's method to converge to the root. | |
| double | ApproximateLegendreRoot (const int n, const int k) |
| Approximates the k-th root of the n-th order Legendre polynomial with: | |
| std::vector< double > | AllLegendrePrimeRoots (const int n) |
| Computes all roots of the \(P'_n(x)\) polynomial. A total of n-1 roots will be computed and returned. | |
| double | LegendrePrimeRoot (const int n, const int k) |
| Computes the k-th root of the n-th order first derivative of the Legendre polynomial by first approximating with ApproximateLegendrePrimeRoot, then using Newton's method to converge. | |
| double | ApproximateLegendrePrimeRoot (const int n, const int k) |
| Approximates the k-th root of the first derivative of the n-th degree Legendre polynomial using the average of the approximations (ApproximateLegendreRoot()) of the surrounding roots of the n-th degree Legendre polynomial. Note that zero-indexing is used, so the roots of the \(P'_4 (x)\) polynomial are \(k=0,1,2\). The approximations of these are given by: | |
| double | DistanceBetweenNodes (const Node &node_1, const Node &node_2) |
| Compute the Euclidean distance between two nodes. | |
| void | UpdateScalarFlux (Node &node, const QuadratureBase< Ordinate > angular_quadrature) |
| Update the scalar flux of a node using the angular quadrature set. | |
| std::vector< double > | ComputeNodeSourceFluxes (const Node &node, const int material_id, const int source_id, const MaterialBank &material_bank, const SourceBank &source_bank, const QuadratureBase< Ordinate > &angular_quadrature) |
| Compute the node source flux values. | |
| void | to_json (nlohmann::json &j, const BC &bc) |
| void | from_json (const nlohmann::json &j, BC &bc) |
| NLOHMANN_JSON_SERIALIZE_ENUM (FEFormulation, {{FEFormulation::CG, "cg"}}) | |
| NLOHMANN_JSON_SERIALIZE_ENUM (TransportForm, {{TransportForm::SAAF, "saaf"}}) | |
| NLOHMANN_JSON_SERIALIZE_ENUM (AngularQuadSet, {{AngularQuadSet::GLT, "gauss_legendre_trapezoid"}, {AngularQuadSet::GLC, "gauss_legendre_chebyshev"}, {AngularQuadSet::GL, "gauss_legendre"}}) | |
| NLOHMANN_JSON_SERIALIZE_ENUM (RunMode, {{RunMode::FIXED_SOURCE, "fixed_source"}}) | |
| NLOHMANN_JSON_SERIALIZE_ENUM (OutputFormat, {{OutputFormat::CSV, "csv"}, {OutputFormat::VTK, "vtk"}}) | |
| json | JSONFromFile (const std::string filename) |
| Create a json object from a string. Will throw an error if the file could not be opened. | |
| bool | DoubleEqual (const double first, const double second, const double tolerance=TOLERANCE) |
| Tests if two double-type numbers are equal using the TOLERANCE value. Taken from https://github.com/starling. | |
| double | RelativeError (const double new_val, const double old_val) |
| Compute the relative error between two values. | |
| void | print_header () |
| Print the program banner, description, and license information. | |
| void | print_input_files (const std::string input, const std::string mesh) |
| Print the paths of the input and mesh files being used. | |
| void | print_columns () |
| Print the column headers for the k-eff/scatter iteration status table. | |
| void | print_k_status (const double k_eff, const double error, const unsigned int iter) |
| Print the k-eff status for the current iteration. | |
| void | print_scatter_status (const double flux_l2_error, const double relative_error, const unsigned int iter) |
| Print the scalar flux convergence status for the current source iteration. | |
| void | print_scatter_complete (const double final_k_eff, const RunMode sim_typ) |
| Print a message indicating source iterations have completed. | |
| void | print_mesh_info (const size_t n_nodes, const size_t n_elements, const unsigned int dimension) |
| Print information about the mesh. | |
Variables | |
| constexpr double | TOLERANCE = 1e-15 |
| General tolerance value for double comparisons. | |
| constexpr double | EXP_NEAR_TOLERANCE = 1e-14 |
| Tolerance value for EXPECT_NEAR in tests. | |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
| std::vector< double > hummingbird::AllLegendrePrimeRoots | ( | const int | n | ) |
Computes all roots of the \(P'_n(x)\) polynomial. A total of n-1 roots will be computed and returned.
| n | Order |
Definition at line 95 of file legendre_polynomials.cc.
| std::vector< double > hummingbird::AllLegendreRoots | ( | const int | n | ) |
Compute all roots of the Legendre polynomial of order n.
| n | Order |
Definition at line 61 of file legendre_polynomials.cc.
| double hummingbird::ApproximateLegendrePrimeRoot | ( | const int | n, |
| const int | k ) |
Approximates the k-th root of the first derivative of the n-th degree Legendre polynomial using the average of the approximations (ApproximateLegendreRoot()) of the surrounding roots of the n-th degree Legendre polynomial. Note that zero-indexing is used, so the roots of the \(P'_4 (x)\) polynomial are \(k=0,1,2\). The approximations of these are given by:
\[x_k\approx \frac{1}{2} \left( \cos \left(\frac{4k+3}{4n+2}\pi\right) + \cos \left(\frac{4(k+1)+3}{4n+2}\pi\right) \right) \]
| n | Order |
| k | Root number (zero-indexed) |
Definition at line 131 of file legendre_polynomials.cc.
| double hummingbird::ApproximateLegendreRoot | ( | const int | n, |
| const int | k ) |
Approximates the k-th root of the n-th order Legendre polynomial with:
\[x_k^{(0)}\approx \cos \left(\frac{4k+3}{4n+2}\pi\right) \]
| n | Order |
| k | Root number |
| std::invalid_argument | Root number must be less than polynomial order |
Definition at line 88 of file legendre_polynomials.cc.
| std::vector< double > hummingbird::ComputeNodeSourceFluxes | ( | const Node & | node, |
| const int | material_id, | ||
| const int | source_id, | ||
| const MaterialBank & | material_bank, | ||
| const SourceBank & | source_bank, | ||
| const QuadratureBase< Ordinate > & | angular_quadrature ) |
| bool hummingbird::DoubleEqual | ( | const double | first, |
| const double | second, | ||
| const double | tolerance = TOLERANCE ) |
Tests if two double-type numbers are equal using the TOLERANCE value. Taken from https://github.com/starling.
| first | First number to compare |
| second | Second number to compare |
| tolerance | Tolerance for the absolute difference between the first and second values |
| void hummingbird::from_json | ( | const json & | j, |
| AngularTreatmentParams & | angular_treatment_params ) |
Retrieve the angular treatment params from input.
| j | JSON object built from input file |
| angular_treatment_params | AngularTreatmentParams struct |
Definition at line 22 of file input_parameters.cc.
| void hummingbird::from_json | ( | const json & | j, |
| InputParams & | input_params ) |
Retrieve input parameters from the user.
| j | JSON object built from input file |
| input_params | InputParams struct |
Definition at line 4 of file input_parameters.cc.
| void hummingbird::from_json | ( | const json & | j, |
| Material & | material ) |
Get the Material information from the json input.
| j | JSON input |
| material | Material struct to populate |
Definition at line 4 of file material_bank.cc.
| void hummingbird::from_json | ( | const json & | j, |
| MeshParams & | mesh_params ) |
Retrieve mesh parameters from input.
| j | JSON object built from input file |
| mesh_params | MeshParams struct |
Definition at line 18 of file input_parameters.cc.
| void hummingbird::from_json | ( | const json & | j, |
| ProblemParams & | problem_params ) |
Retrieve problem params from input.
| j | JSON object built from input file |
| problem_params | ProblemParams struct |
Definition at line 12 of file input_parameters.cc.
| void hummingbird::from_json | ( | const json & | j, |
| SourceIterationParams & | source_iter_params ) |
Retrieve the source iteration params from input.
| j | JSON object built from input file |
| source_iter_params | SourceIterationParams struct |
Definition at line 45 of file input_parameters.cc.
| void hummingbird::from_json | ( | const json & | j, |
| SpectralElementParams & | se_params ) |
Retrieve spectral element params from input.
| j | JSON object built from input file |
| se_params | SpectralElementParams struct |
Definition at line 35 of file input_parameters.cc.
|
inline |
| json hummingbird::JSONFromFile | ( | const std::string | filename | ) |
| double hummingbird::LegendrePolynomial | ( | const int | n, |
| const double | x ) |
Computes the Legendre polynomial of degree n at a point x using the formula:
\[P_{n+1}(x)=\frac{(2n+1)xP_{n}(x)-nP_{n-1}(x)}{n+1} \]
with:
\[P_0=1,\quad P_1=x \]
The above is implemented to evaluate the n-th order Legendre polynomial by building from the bottom up, as opposed to using a recursion relation. This greatly improves the evaluation speed. This algorithm was taken from https://github.com/CambridgeUniversityPress/NumericalMethodsPhysicsWithPython/blob/master/second_edition/codes/legendre.py written by Alex Gezerlis for his book, Numerical Methods in Physics With Python, Second Edition.
Legendre polynomials are defined on the interval \(x\in [-1,1]\).
| n | Order of polynomial to evaluate |
| x | Point to evaluate at |
Definition at line 14 of file legendre_polynomials.cc.
| double hummingbird::LegendrePolynomialPrime | ( | const int | n, |
| const double | x ) |
Computes the first derivative of the Legendre polynomial of degree n at a point x using the recurrence relation:
\[P'_n (x)=\frac{nP_{n-1}(x)-nxP_n(x)}{1-x^2} \]
The value of the derivative at the bounds is special:
\[P'_n(x)=\begin{cases} (-1)^{n-1}\frac{n(n+1)}{2} & x=-1 \\ \frac{n(n+1)}{2} &x=1 \end{cases} \]
| n | Order of polynomial |
| x | Point to evaluate at |
Definition at line 35 of file legendre_polynomials.cc.
| double hummingbird::LegendrePolynomialPrimePrime | ( | const int | n, |
| const double | x ) |
Computes the second derivative of the Legendre polynomial of degree n using Legendre's differential equation:
\[(1-x^2)P_n''(x)-2xP_n'(x)+n(n+1)P_n(x)=0 \]
| n | Order |
| x | Location to evaluate at |
Definition at line 55 of file legendre_polynomials.cc.
| double hummingbird::LegendrePrimeRoot | ( | const int | n, |
| const int | k ) |
Computes the k-th root of the n-th order first derivative of the Legendre polynomial by first approximating with ApproximateLegendrePrimeRoot, then using Newton's method to converge.
| n | Order |
| k | Root number |
Definition at line 107 of file legendre_polynomials.cc.
| double hummingbird::LegendreRoot | ( | const int | n, |
| const int | k ) |
Computes the k-th root of the n-th order Legendre polynomial by first approximating the root with ApproximateLegendreRoot, then using Newton's method to converge to the root.
| n | Order of the polynomial |
| k | Root to find |
Definition at line 73 of file legendre_polynomials.cc.
| hummingbird::NLOHMANN_JSON_SERIALIZE_ENUM | ( | AngularQuadSet | , |
| {{AngularQuadSet::GLT, "gauss_legendre_trapezoid"}, {AngularQuadSet::GLC, "gauss_legendre_chebyshev"}, {AngularQuadSet::GL, "gauss_legendre"}} | ) |
| hummingbird::NLOHMANN_JSON_SERIALIZE_ENUM | ( | FEFormulation | , |
| {{FEFormulation::CG, "cg"}} | ) |
| hummingbird::NLOHMANN_JSON_SERIALIZE_ENUM | ( | OutputFormat | , |
| {{OutputFormat::CSV, "csv"}, {OutputFormat::VTK, "vtk"}} | ) |
| hummingbird::NLOHMANN_JSON_SERIALIZE_ENUM | ( | RunMode | , |
| {{RunMode::FIXED_SOURCE, "fixed_source"}} | ) |
| hummingbird::NLOHMANN_JSON_SERIALIZE_ENUM | ( | TransportForm | , |
| {{TransportForm::SAAF, "saaf"}} | ) |
| void hummingbird::print_columns | ( | ) |
| void hummingbird::print_header | ( | ) |
| void hummingbird::print_input_files | ( | const std::string | input, |
| const std::string | mesh ) |
| void hummingbird::print_k_status | ( | const double | k_eff, |
| const double | error, | ||
| const unsigned int | iter ) |
| void hummingbird::print_mesh_info | ( | const size_t | n_nodes, |
| const size_t | n_elements, | ||
| const unsigned int | dimension ) |
| void hummingbird::print_scatter_complete | ( | const double | final_k_eff, |
| const RunMode | sim_typ ) |
| void hummingbird::print_scatter_status | ( | const double | flux_l2_error, |
| const double | relative_error, | ||
| const unsigned int | iter ) |
Print the scalar flux convergence status for the current source iteration.
| flux_l2_error | L2 norm of the change in scalar flux from the previous iteration |
| relative_error | Relative L2 error in the scalar flux (flux_l2_error normalized by the current iteration's flux L2 norm) |
| iter | Iteration number |
| double hummingbird::RelativeError | ( | const double | new_val, |
| const double | old_val ) |
|
inline |
| void hummingbird::UpdateScalarFlux | ( | Node & | node, |
| const QuadratureBase< Ordinate > | angular_quadrature ) |
|
constexpr |
Tolerance value for EXPECT_NEAR in tests.
Definition at line 13 of file constants.h.
|
constexpr |
General tolerance value for double comparisons.
Definition at line 10 of file constants.h.