hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
input_parameters.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2// Copyright (c) 2026, Liam Pohlmann
3
4#ifndef HUMMINGBIRD_INPUT_PARAMETERS_H_
5#define HUMMINGBIRD_INPUT_PARAMETERS_H_
6
7#include <nlohmann/json.hpp>
8#include <string>
9
10#include "utils/enums.h"
11
12using nlohmann::json;
13
14namespace hummingbird {
15
16/**
17 * @brief Parameters from the "problem" section of the input file
18 *
19 */
21 /// @brief Problem name
22 std::string name;
23
24 /// @brief Run mode for the simulation
26
27 /// @brief Format results are exported in
29};
30
31/**
32 * @brief Retrieve problem params from input
33 *
34 * @param j JSON object built from input file
35 * @param problem_params ProblemParams struct
36 */
37void from_json(const json& j, ProblemParams& problem_params);
38
39/**
40 * @brief Parameters from the "mesh" section of the input file
41 *
42 */
43struct MeshParams {
44 /// @brief Path to the gmsh .msh file
45 std::string mesh_file;
46};
47
48/**
49 * @brief Retrieve mesh parameters from input
50 *
51 * @param j JSON object built from input file
52 * @param mesh_params MeshParams struct
53 */
54void from_json(const json& j, MeshParams& mesh_params);
55
56/**
57 * @brief Parameters from the "angular_treatment" section of the input file
58 *
59 */
61 /// @brief Angular quadrature set to use
63
64 /// @brief Number of azimuthal quadrature points
65 unsigned int n_azim;
66
67 /// @brief Number of polar quadrature points
68 unsigned int n_polar;
69};
70
71/**
72 * @brief Retrieve the angular treatment params from input
73 *
74 * @param j JSON object built from input file
75 * @param angular_treatment_params AngularTreatmentParams struct
76 */
77void from_json(const json& j, AngularTreatmentParams& angular_treatment_params);
78
79/**
80 * @brief Parameters from the "spectral_elements" section of the input file
81 *
82 */
84 /// @brief Form of the transport equation to solve
86
87 /// @brief Finite element formulation to use
89
90 /// @brief Number of points per spectral element
91 unsigned int n_points;
92};
93
94/**
95 * @brief Retrieve spectral element params from input
96 *
97 * @param j JSON object built from input file
98 * @param se_params SpectralElementParams struct
99 */
100void from_json(const json& j, SpectralElementParams& se_params);
101
102/**
103 * @brief Parameters from the "source_iteration" section of the input file
104 *
105 */
107 /// @brief Convergence tolerance for source iteration
108 double tolerance;
109
110 /// @brief Maximum number of source iterations before giving up
111 unsigned int max_iterations;
112};
113
114/**
115 * @brief Retrieve the source iteration params from input
116 *
117 * @param j JSON object built from input file
118 * @param source_iter_params SourceIterationParams struct
119 */
120void from_json(const json& j, SourceIterationParams& source_iter_params);
121
122/**
123 * @brief All parameters parsed from the input file
124 *
125 */
127 /// @brief Problem parameters
129
130 /// @brief Mesh parameters
132
133 /// @brief Angular treatment parameters
135
136 /// @brief Spectral element parameters
138
139 /// @brief Source iteration parameters
141};
142
143/**
144 * @brief Retrieve input parameters from the user
145 *
146 * @param j JSON object built from input file
147 * @param input_params InputParams struct
148 */
149void from_json(const json& j, InputParams& input_params);
150
151} // namespace hummingbird
152
153#endif // HUMMINGBIRD_INPUT_PARAMETERS_H_
RunMode
Run modes available.
Definition enums.h:90
void from_json(const json &j, Material &material)
Get the Material information from the json input.
TransportForm
Available forms of the transport equation.
Definition enums.h:71
AngularQuadSet
Angular quadrature set.
Definition enums.h:79
FEFormulation
Available finite element formulations.
Definition enums.h:63
OutputFormat
Output forms available for export.
Definition enums.h:99
Parameters from the "angular_treatment" section of the input file.
AngularQuadSet angular_quad_set
Angular quadrature set to use.
unsigned int n_polar
Number of polar quadrature points.
unsigned int n_azim
Number of azimuthal quadrature points.
All parameters parsed from the input file.
MeshParams mesh_params
Mesh parameters.
AngularTreatmentParams angular_treatment_params
Angular treatment parameters.
SourceIterationParams source_iter_params
Source iteration parameters.
ProblemParams problem_params
Problem parameters.
SpectralElementParams sem_params
Spectral element parameters.
Parameters from the "mesh" section of the input file.
std::string mesh_file
Path to the gmsh .msh file.
Parameters from the "problem" section of the input file.
OutputFormat output_format
Format results are exported in.
RunMode run_mode
Run mode for the simulation.
std::string name
Problem name.
Parameters from the "source_iteration" section of the input file.
double tolerance
Convergence tolerance for source iteration.
unsigned int max_iterations
Maximum number of source iterations before giving up.
Parameters from the "spectral_elements" section of the input file.
FEFormulation fe_formulation
Finite element formulation to use.
TransportForm transport_form
Form of the transport equation to solve.
unsigned int n_points
Number of points per spectral element.