13#ifndef DNDS_ARRAY_PAIR_HPP
14# define DNDS_ARRAY_PAIR_HPP
18# include "../ArrayTransformer.hpp"
40 template <rowsize _row_size = 1, rowsize _row_max = _row_size, rowsize _align = NoAlign>
65 fmt::format(
"i {}, Size {}, array: {}",
73 return const_cast<t_self *
>(
this)->
operator[](i);
79 template <DeviceBackend B>
82 template <DeviceBackend B>
85 template <DeviceBackend B>
91 template <DeviceBackend B>
101 template <DeviceBackend B>
125 template <DeviceBackend B>
131 template <DeviceBackend B>
Device-callable view type for ArrayAdjacency. Mirrors the host operator[] returning an AdjacencyRow,...
Core type aliases, constants, and metaprogramming utilities for the DNDS framework.
#define DNDS_DEVICE_CALLABLE
Device memory abstraction layer with backend-specific storage and factory creation.
#define DNDS_assert_info(expr, info)
Debug-only assertion with an extra std::string info message.
#define DNDS_assert(expr)
Debug-only assertion (compiled out when DNDS_NDEBUG is defined). Prints the expression + file/line + ...
Non-owning span (pointer, size) into an ArrayAdjacency row.
Device-callable adjacency view: extends ArrayDeviceView so that indexing into a row returns an Adjace...
Row iterator for ArrayAdjacency, yielding AdjacencyRow per element.
DNDS_DEVICE_CALLABLE iterator(const iterator &)=default
DNDS_DEVICE_CALLABLE ~iterator()=default
std::random_access_iterator_tag iterator_category
DNDS_DEVICE_CALLABLE iterator(const view_type &n_view, index n_iRow)
DNDS_DEVICE_CALLABLE reference operator*()
Mesh-connectivity array: ParArray<index> whose operator[] yields an AdjacencyRow typed view.
AdjacencyRow< const index > operator[](index i) const
Const typed row access.
AdjacencyRow< index > operator[](index i)
Typed row access; returns an AdjacencyRow bound to the row's pointer and width. Past-the-end queries ...
ArrayAdjacency(const t_self &R)=default
ArrayAdjacencyDeviceView< B, index, _row_size, _row_max, _align > t_deviceView
index * rowPtr(index i)
Raw index* pointer to row i (bypasses the typed wrapper).
t_self & operator=(const t_self &R)=default
void clone(const t_self &R)
Shallow copy (same semantics as assignment).
Non-owning device-callable view of an Array, specialised per DeviceBackend.
ArrayAdjacency<1> specialisation with an integer-typed operator[] (returns the single index by refere...
index & operator[](index i)
Direct index& access to row i's single element.
index * rowPtr(index i)
Raw pointer to the element of row i.
CRTP base for row-granularity iterators over an Array / ArrayView.
std::ptrdiff_t difference_type
static std::string GetArrayName()
Human-readable type identifier including element typeid, sizes, and alignment.
void to_device(DeviceBackend backend=DeviceBackend::Host)
Mirror the flat/structural buffers to a target device (e.g. CUDA).
T * operator[](index iRow)
Return a raw pointer to the start of row iRow.
rowsize RowSize() const
Uniform row width for fixed layouts (no row index needed).
void WriteSerializer(Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset offset, Serializer::ArrayGlobalOffset dataOffset=Serializer::ArrayGlobalOffset_Unknown)
Serialize (write) array data to a serializer.
void to_host()
Mirror the flat/structural buffers back to host memory.
T & operator()(index iRow, rowsize iCol=0)
Bounds-checked 2D element access (writable).
index Size() const
Number of rows currently stored. O(1).
void ReadSerializer(Serializer::SerializerBaseSSP serializerP, const std::string &name, Serializer::ArrayGlobalOffset &offset)
Convenience overload that discards the dataOffset output.
std::string getObjectIdentity(const std::string &sig) const
MPI-aware Array: adds a communicator, rank, and global index mapping.
the host side operators are provided as implemented
int64_t index
Global row / DOF index type (signed 64-bit; handles multi-billion-cell meshes).