hummingbird
Solving the self-adjoint angular flux transport equation using spectral elements on Cartesian geometry
Loading...
Searching...
No Matches
hummingbird::MaterialBank Class Reference

Bank holding the materials defined in the input file. More...

#include <material_bank.h>

Inheritance diagram for hummingbird::MaterialBank:
[legend]
Collaboration diagram for hummingbird::MaterialBank:
[legend]

Public Member Functions

 MaterialBank (const json &json_input)
 Construct a new Material Bank object. Material structs are built using the json input.
Public Member Functions inherited from hummingbird::BankBase< Material >
const Material & GetByID (const int id) const
 Get the object by its ID.
const Material & GetByName (const std::string &name) const
 Get the object by its name in the JSON input file.
int GetIDByName (const std::string &name) const
 Get the ID of an object by its name in the JSON input file.

Private Member Functions

void Build (const json &json_input)
 Builds the material structs and assigns them to the id_material_map_ and name_id_map_ members.
void CheckMaterials ()
 Check that all materials in id_object_map_ have physically valid cross sections.

Additional Inherited Members

Protected Attributes inherited from hummingbird::BankBase< Material >
std::unordered_map< int, Material > id_object_map_
 ID to object map.
std::unordered_map< std::string, int > name_id_map_
 name to object ID map

Detailed Description

Bank holding the materials defined in the input file.

Definition at line 30 of file material_bank.h.

Constructor & Destructor Documentation

◆ MaterialBank()

hummingbird::MaterialBank::MaterialBank ( const json & json_input)

Construct a new Material Bank object. Material structs are built using the json input.

Parameters
json_inputJSON object containing input file information

Definition at line 11 of file material_bank.cc.

Member Function Documentation

◆ Build()

void hummingbird::MaterialBank::Build ( const json & json_input)
privatevirtual

Builds the material structs and assigns them to the id_material_map_ and name_id_map_ members.

Parameters
json_inputJSON object containing input file information

Implements hummingbird::BankBase< Material >.

Definition at line 16 of file material_bank.cc.

◆ CheckMaterials()

void hummingbird::MaterialBank::CheckMaterials ( )
private

Check that all materials in id_object_map_ have physically valid cross sections.

Exceptions
std::runtime_errorif a material's total cross section is negative, less than the sum of its scattering and fission cross sections, or if its scattering, fission, or nu is negative

Definition at line 28 of file material_bank.cc.


The documentation for this class was generated from the following files: