Function Acts::materialMapperRZ¶
Defined in File MaterialMapUtils.hpp
Function Documentation¶
-
MaterialMapper<detail::Grid<Material::ParametersVector, detail::EquidistantAxis, detail::EquidistantAxis>>
Acts
::
materialMapperRZ
(const std::function<size_t(std::array<size_t, 2> binsRZ, std::array<size_t, 2> nBinsRZ)> &materialVectorToGridMapper, std::vector<double> rPos, std::vector<double> zPos, std::vector<Material> material, double lengthUnit = UnitConstants::mm, )¶ Method to setup the MaterialMapper.
e.g.: we have small grid with the values: r={2,3}, z ={4,5}, the corresponding indices are i (belonging to r) and j (belonging to z), the globalIndex is M (belonging to the values of the Material) and the map is:
In this case the function would look like:
[](std::array<size_t, 2> binsRZ, std::array<size_t, 2> nBinsRZ) { return (binsRZ.at(0) * nBinsRZ.at(1) + binsRZ.at(1)); }
- Note
The values do not need to be sorted or unique (this will be done inside the function)
- Note
The values do not need to be sorted or unique (this will be done inside the function)
- Note
The function localToGlobalBin determines how the material was stored in the vector in respect to the grid values
- Parameters
[in] materialVectorToGridMapper
: Function mapping the vector of material to the map of material values
- Parameters
[in] rPos
: Values of the grid points in r
- Parameters
[in] zPos
: Values of the grid points in z
- Parameters
[in] material
: The material classification values in r and z for all given grid points stored in a vector
- Parameters
[in] lengthUnit
: The unit of the grid points