Celeritas 0.7.0-dev.243+develop.3bda42b9
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
celeritas::ElementSelector Class Reference

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.
 

Detailed Description

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:

ElementSelector select_element(mat, calc_micro, mat.element_scratch());
ElementComponentId id = select_element(rng);
ElementView el = mat.element_record(id);
@ el
Elastic cross section.
Select an element from a material using weighted cross sections.
Definition ElementSelector.hh:41
Access amalgamated data for an element.
Definition ElementView.hh:37

Member Function Documentation

◆ store_and_calc_xs()

template<class MicroXsCalc >
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.


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