hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
input_parameters.cc
Go to the documentation of this file.
1#include "input_parameters.h"
2
3namespace hummingbird {
4void from_json(const json& j, InputParams& input_params) {
5 input_params.problem_params = j.get<ProblemParams>();
6 input_params.mesh_params = j.get<MeshParams>();
8 input_params.sem_params = j.get<SpectralElementParams>();
9 input_params.source_iter_params = j.get<SourceIterationParams>();
10}
11
12void from_json(const json& j, ProblemParams& problem_params) {
13 j.at("problem").at("name").get_to(problem_params.name);
14 j.at("problem").at("mode").get_to(problem_params.run_mode);
15 j.at("problem").at("output_format").get_to(problem_params.output_format);
16}
17
18void from_json(const json& j, MeshParams& mesh_params) {
19 j.at("mesh").at("filename").get_to(mesh_params.mesh_file);
20}
21
22void from_json(const json& j,
23 AngularTreatmentParams& angular_treatment_params) {
24 j.at("angular_treatment")
25 .at("quadrature_set")
26 .get_to(angular_treatment_params.angular_quad_set);
27 j.at("angular_treatment")
28 .at("n_azimuthal")
29 .get_to(angular_treatment_params.n_azim);
30 j.at("angular_treatment")
31 .at("n_polar")
32 .get_to(angular_treatment_params.n_polar);
33}
34
35void from_json(const json& j, SpectralElementParams& se_params) {
36 j.at("spectral_elements")
37 .at("transport_form")
38 .get_to(se_params.transport_form);
39 j.at("spectral_elements")
40 .at("fe_formulation")
41 .get_to(se_params.fe_formulation);
42 j.at("spectral_elements").at("n_points").get_to(se_params.n_points);
43}
44
45void from_json(const json& j, SourceIterationParams& source_iter_params) {
46 j.at("source_iteration").at("tolerance").get_to(source_iter_params.tolerance);
47 j.at("source_iteration")
48 .at("max_iterations")
49 .get_to(source_iter_params.max_iterations);
50}
51
52} // namespace hummingbird
void from_json(const json &j, Material &material)
Get the Material information from the json input.
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.