hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
material_bank.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_PHYSICS_MATERIAL_BANK_H_
5#define HUMMINGBIRD_PHYSICS_MATERIAL_BANK_H_
6
7#include <nlohmann/json.hpp>
8#include <string>
9#include <unordered_map>
10
11#include "banks/bank_base.h"
12#include "physics/material.h"
13
14using nlohmann::json;
15
16namespace hummingbird {
17
18/**
19 * @brief Get the Material information from the json input
20 *
21 * @param j JSON input
22 * @param material Material struct to populate
23 */
24void from_json(const json& j, Material& material);
25
26/**
27 * @brief Bank holding the materials defined in the input file
28 *
29 */
30class MaterialBank : public BankBase<Material> {
31 public:
32 /**
33 * @brief Construct a new Material Bank object. Material structs are built
34 * using the json input
35 *
36 * @param json_input JSON object containing input file information
37 */
38 MaterialBank(const json& json_input);
39
40 private:
41 /**
42 * @brief Builds the material structs and assigns them to the
43 * id_material_map_ and name_id_map_ members
44 *
45 * @param json_input JSON object containing input file information
46 */
47 void Build(const json& json_input);
48
49 /**
50 * @brief Check that all materials in id_object_map_ have physically valid
51 * cross sections
52 *
53 * @throw std::runtime_error if a material's total cross section is
54 * negative, less than the sum of its scattering and fission cross
55 * sections, or if its scattering, fission, or nu is negative
56 */
57 void CheckMaterials();
58};
59} // namespace hummingbird
60
61#endif // HUMMINGBIRD_PHYSICS_MATERIAL_BANK_H_
Base class for banks that store objects of type T by integer ID and look them up by the name given in...
Definition bank_base.h:21
void CheckMaterials()
Check that all materials in id_object_map_ have physically valid cross sections.
MaterialBank(const json &json_input)
Construct a new Material Bank object. Material structs are built using the json input.
void Build(const json &json_input)
Builds the material structs and assigns them to the id_material_map_ and name_id_map_ members.
void from_json(const json &j, Material &material)
Get the Material information from the json input.
Defines a monoenergetic, constant-properties material.
Definition material.h:13