|
Celeritas 0.7.0-dev.243+develop.3bda42b9
|
Select an element from a material using weighted cross sections. More...
#include <ElementSelector.hh>
Public Types | |
Type aliases | |
| using | SpanReal = Span< real_type > |
| using | MicroXs = units::BarnXs |
Public Member Functions | |
| template<class MicroXsCalc > | |
| ElementSelector (MaterialView const &material, MicroXsCalc &&calc_micro_xs, SpanReal micro_xs_storage) | |
| Construct with material, xs calculator, and storage. | |
| template<class Engine > | |
| ElementComponentId | operator() (Engine &rng) const |
| template<class MicroXsCalc > | |
| auto | store_and_calc_xs (Span< MatElementComponent const > elements, MicroXsCalc &&calc_micro_xs, SpanReal storage) -> MicroXs |
| Fill storage with micro xs, and return the weighted micro xs. | |
Select an element from a material using weighted cross sections.
The element selector chooses a component (atomic element) of a material based on the microscopic cross section and the abundance fraction of the element in the material.
On construction, the element chooser uses the provided arguments to precalculate all the microscopic cross sections in the given storage space. The given function calc_micro_xs must accept an ElementId and return a microscopic cross section in units::BarnXs .
Typical usage:
| auto celeritas::ElementSelector::store_and_calc_xs | ( | Span< MatElementComponent const > | elements, |
| MicroXsCalc && | calc_micro_xs, | ||
| SpanReal | storage | ||
| ) | -> MicroXs |
Fill storage with micro xs, and return the weighted micro xs.
This is called by the constructor.