|
core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
|
Namespaces | |
| namespace | amr |
| namespace | decomp |
| namespace | geom |
| namespace | halo |
| namespace | interp |
| namespace | python |
| namespace | solver |
Classes | |
| struct | FieldRec |
| One registered field: its flat x-fastest device buffer plus the metadata a consumer needs to exchange or redistribute it. More... | |
| class | FieldSet |
| Name → FieldRec directory. More... | |
| struct | NestedLoop |
| Compile-time-unrolled nested loop over [bgn, end) in row-major (axis 0 fastest) order. More... | |
| struct | NestedLoop< Dim, 0 > |
| struct | Range |
| Half-open range [begin, end) carrying a label (e.g. a block id). Ported from pbs::IndxRange. More... | |
Typedefs | |
| using | Index = std::int64_t |
Signed index type for grids and particles (supersedes block_decomposer's long int IndxT). | |
| using | Real = double |
| Default host floating type. Device kernels may use float; conversions happen at the boundary. | |
| template<int Dim> | |
| using | IVec = std::array< Index, Dim > |
| Multi-dimensional integer index / coordinate (x-fastest order by convention). | |
| template<int Dim> | |
| using | Vec = std::array< Real, Dim > |
| Multi-dimensional real vector. | |
| using | ExecSpace = Kokkos::DefaultExecutionSpace |
| using | MemSpace = ExecSpace::memory_space |
| template<class T > | |
| using | View = Kokkos::View< T *, MemSpace > |
| 1D device array. | |
| template<class T > | |
| using | HostView = decltype(Kokkos::create_mirror_view(std::declval< View< T > >())) |
| Host-accessible mirror of View<T> (identical to View<T> on host backends). | |
| using | IndexView = Kokkos::View< Index *, MemSpace > |
| Device array of grid/particle indices (the matched send/recv/self-copy lists). | |
| template<class T > | |
| using | Field3D = Kokkos::View< T ***, Kokkos::LayoutLeft, MemSpace > |
| 3D structured field in the suite's x-fastest convention: LayoutLeft makes the leftmost (x) index contiguous, i.e. | |
Enumerations | |
| enum class | Centering { Cell , FaceX , FaceY , FaceZ } |
| Where a field's samples sit relative to a cell. More... | |
Functions | |
| Index | wrap (Index x, Index n) |
| Periodic wrap of a coordinate into [0, n): wrap(x, n) = (x % n + n) % n. | |
| template<int Dim, typename Func > | |
| void | forEachInBox (const IVec< Dim > &bgn, const IVec< Dim > &end, Func &&func) |
| Iterate the box [bgn, end) calling func(const IVec<Dim>&). | |
| template<class T > | |
| View< T > | toDevice (const std::vector< T > &h, const std::string &label) |
| Upload a host std::vector into a freshly-sized device View (empty vector => empty view). | |
| template<class V > | |
| std::vector< std::remove_const_t< typename V::value_type > > | toVector (const V &view) |
Copy a (host- or device-resident) Kokkos View of any rank into a contiguous host std::vector, flattened in C/row order (last index fastest) — an Nx3 View comes back as out[i*3 + c] == view(i,c), the suite's particle-SoA Python export order. | |
| using peclet::core::Index = typedef std::int64_t |
| using peclet::core::IVec = typedef std::array<Index, Dim> |
| using peclet::core::Vec = typedef std::array<Real, Dim> |
| using peclet::core::ExecSpace = typedef Kokkos::DefaultExecutionSpace |
| using peclet::core::MemSpace = typedef ExecSpace::memory_space |
| using peclet::core::IndexView = typedef Kokkos::View<Index*, MemSpace> |
| using peclet::core::Field3D = typedef Kokkos::View<T***, Kokkos::LayoutLeft, MemSpace> |
3D structured field in the suite's x-fastest convention: LayoutLeft makes the leftmost (x) index contiguous, i.e.
I = x + y*nx + z*nx*ny — identical to peclet::core::Index linearization and cfd-gpu grids.
|
strong |
Where a field's samples sit relative to a cell.
Scalars/properties are cell-centred; the MAC face-normal velocity components are face-centred. (The staggered solver stores its face fields as cell-indexed arrays, so Centering is metadata for consumers — it does not change the buffer.)
| Enumerator | |
|---|---|
| Cell | |
| FaceX | |
| FaceY | |
| FaceZ | |
Definition at line 32 of file field_set.hpp.
Periodic wrap of a coordinate into [0, n): wrap(x, n) = (x % n + n) % n.
Definition at line 37 of file types.hpp.
Referenced by peclet::core::halo::GridHaloTopology< Dim >::buildTopology(), and peclet::core::halo::ParticleMigrator< Dim >::cellOf().
|
inline |
Iterate the box [bgn, end) calling func(const IVec<Dim>&).
Definition at line 65 of file types.hpp.
References peclet::core::NestedLoop< Dim, Axis >::run().
Upload a host std::vector into a freshly-sized device View (empty vector => empty view).
Definition at line 44 of file view.hpp.
Referenced by peclet::core::amr::assembleFaceGeom(), peclet::core::amr::assembleFv(), peclet::core::amr::assembleMomentum(), peclet::core::amr::DistributedMultigridView< Dim, Bits >::build(), peclet::core::amr::MomentumMG< Bits >::build(), peclet::core::amr::VelocityMG< Bits >::build(), peclet::core::amr::buildFaceGeom(), peclet::core::amr::greedyColoring(), peclet::core::halo::ParticleMigratorView< Dim >::init(), peclet::core::amr::DistributedGatherHalo< Dim, Bits >::init(), peclet::core::halo::GridHalo< T >::init(), peclet::core::halo::ParticleHalo< Dim >::init(), peclet::core::halo::ParticleMigratorView< Dim >::migrate(), peclet::core::amr::AmrFlow< Bits >::setSolid(), and peclet::core::amr::BlockOctreeView< Dim, Bits >::upload().
| std::vector< std::remove_const_t< typename V::value_type > > peclet::core::toVector | ( | const V & | view | ) |
Copy a (host- or device-resident) Kokkos View of any rank into a contiguous host std::vector, flattened in C/row order (last index fastest) — an Nx3 View comes back as out[i*3 + c] == view(i,c), the suite's particle-SoA Python export order.
This replaces the redundant "create_mirror_view → deep_copy → element-by-element loop → std::vector" idiom in the binding getters (S2a) with a single device→host transfer and no hand-written loop. The row-order flatten is layout-correct on every backend: a LayoutLeft (e.g. CUDA-default) device View is transposed on the host hop rather than blindly memcpy'd, so the exported ordering matches across CPU/GPU builds.
Definition at line 63 of file view.hpp.
Referenced by peclet::core::amr::AmrFlow< Bits >::faceField(), peclet::core::amr::AmrFlow< Bits >::pressure(), peclet::core::amr::AmrFlow< Bits >::velocities(), and peclet::core::amr::AmrFlow< Bits >::velocity().