SubCoordinates< Base > Class Template Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
A contiguous window into the linear index range of another coordinate system. More...
#include <coordinates.hh>
Public Types | |
| using | ctype = typename Base::ctype |
Public Member Functions | |
| SubCoordinates (const Base &base, size_t offset, size_t size) | |
| device::array< size_t, dim > KOKKOS_FORCEINLINE_FUNCTION | sizes () const |
| size_t KOKKOS_FORCEINLINE_FUNCTION | size () const |
| device::array< size_t, dim > KOKKOS_INLINE_FUNCTION | from_linear_index (size_t s) const |
| template<typename... I> requires (std::is_convertible_v<std::decay_t<I>, size_t> && ...) | |
| KOKKOS_FORCEINLINE_FUNCTION device::array< ctype, dim > | forward (I &&...i) const |
| template<typename IT > | |
| KOKKOS_INLINE_FUNCTION device::array< ctype, dim > | forward (device::array< IT, dim > i) const |
| Takes a base multi-index, i.e. what from_linear_index() above returns. | |
| std::string | to_string () const |
Static Public Attributes | |
| static constexpr size_t | dim = Base::dim |
Private Attributes | |
| size_t | m_offset |
| size_t | m_size |
Detailed Description
class DiFfRG::SubCoordinates< Base >
A contiguous window into the linear index range of another coordinate system.
The window is [offset, offset + size) of Base's flattened grid, which is exactly the shape MapScheduler hands out (part(G, r, j)), and it is deliberately not a per-axis box. An earlier version derived one, by running Base::from_linear_index() on both ends and subtracting; that is only the same set when dim == 1, which is why splitting used to be restricted to one-dimensional grids and the expensive multi-angle vertex flows were assigned whole to a single rank.
Carrying the linear offset instead makes the window exact in any dimension, at no cost: from_linear_index(s) returns the base multi-index of global point offset + s, and forward() is then Base::forward unchanged. So the position computed for a windowed point is the same fp64 value as the unwindowed run computes for that global point, which is what keeps a distributed result bitwise identical to a serial one.
Only MapScheduler's four map() call sites construct this.
Member Typedef Documentation
◆ ctype
| using DiFfRG::SubCoordinates< Base >::ctype = typename Base::ctype |
Constructor & Destructor Documentation
◆ SubCoordinates()
|
inline |
Member Function Documentation
◆ forward() [1/2]
|
inline |
Takes a base multi-index, i.e. what from_linear_index() above returns.
◆ forward() [2/2]
requires (std::is_convertible_v<std::decay_t<I>, size_t> && ...)
|
inline |
Spelled-out array rather than forward({{i...}}): a braced-init-list cannot deduce the element type of the overload below, so the old spelling was ill-formed the moment anyone called it. Nothing on the map() path does, which is why it never showed up.
◆ from_linear_index()
|
inline |
The base multi-index of the window's s-th point. Note this is a base index: it is fed straight back into Base::forward(), which is what makes the positions identical to the unwindowed ones.
◆ size()
|
inline |
◆ sizes()
|
inline |
Per-axis extents, which a linear window only has when the grid is one-dimensional. Nothing on the map() path calls this – the integrators drive everything off size() and from_linear_index() – so a caller that needs a box should say so at compile time rather than receive a plausible-looking wrong answer.
◆ to_string()
|
inline |
Identifies the window, not just the base grid: the position cache in QuadratureIntegrator keys on this, and two windows into one base grid must not collide.
Member Data Documentation
◆ dim
|
staticconstexpr |
◆ m_offset
|
private |
◆ m_size
|
private |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/coordinates/coordinates.hh
Generated by