![]() |
Shamrock 2025.10.0
Astrophysical Code
|
PatchDataLayer container class, the layout is described in patchdata_layout. More...
#include <shamrock/include/shamrock/patch/PatchDataLayer.hpp>
Public Types | |
| using | field_variant_t = var_t |
Public Member Functions | |
| PatchDataLayerLayout & | pdl () |
| const PatchDataLayerLayout & | pdl () const |
| std::shared_ptr< PatchDataLayerLayout > | get_layout_ptr () const |
| PatchDataLayer (const std::shared_ptr< PatchDataLayerLayout > &pdl) | |
| PatchDataLayer (const PatchDataLayer &other) | |
| PatchDataLayer (PatchDataLayer &&other) noexcept | |
| PatchDataLayer move constructor. | |
| PatchDataLayer & | operator= (PatchDataLayer &&other) noexcept |
| PatchDataLayer move assignment. | |
| PatchDataLayer & | operator= (const PatchDataLayer &other)=delete |
| template<class Functor > | |
| void | for_each_field_any (Functor &&func) |
| template<class Functor > | |
| void | for_each_field_any (Functor &&func) const |
| template<class Func > | |
| PatchDataLayer (const std::shared_ptr< PatchDataLayerLayout > &pdl, Func &&fct_init) | |
| PatchDataLayer | duplicate () |
| std::unique_ptr< PatchDataLayer > | duplicate_to_ptr () |
| void | extract_element (u32 pidx, PatchDataLayer &out_pdat) |
| extract particle at index pidx and insert it in the provided vectors | |
| void | extract_elements (const sham::DeviceBuffer< u32 > &idxs, PatchDataLayer &out_pdat) |
| void | keep_ids (sycl::buffer< u32 > &index_map, u32 len) |
| void | insert_elements (const PatchDataLayer &pdat) |
| template<class T > | |
| void | insert_elements_in_range (PatchDataLayer &pdat, T bmin, T bmax) |
| insert elements of pdat only if they are within the range | |
| void | resize (u32 new_obj_cnt) |
| void | reserve (u32 new_obj_cnt) |
| void | expand (u32 obj_cnt) |
| void | index_remap (sycl::buffer< u32 > &index_map, u32 len) |
| this function remaps the patchdatafield like so val[id] = val[index_map[id]] This function can be used to apply the result of a sort to the field | |
| void | index_remap_resize (sycl::buffer< u32 > &index_map, u32 len) |
| this function remaps the patchdatafield like so val[id] = val[index_map[id]] This function can be used to apply the result of a sort to the field | |
| void | index_remap_resize (sham::DeviceBuffer< u32 > &index_map, u32 len) |
| Same as index_remap_resize with a shamrock device buffer instead. | |
| void | keep_ids (sham::DeviceBuffer< u32 > &index_map, u32 len) |
| Same as keep_ids with a shamrock device buffer instead. | |
| void | remove_ids (const sham::DeviceBuffer< u32 > &indexes, u32 len) |
| remove some particles ids | |
| template<class Tvecbox > | |
| void | split_patchdata (std::array< std::reference_wrapper< PatchDataLayer >, 8 > pdats, std::array< Tvecbox, 8 > min_box, std::array< Tvecbox, 8 > max_box) |
| void | append_subset_to (const std::vector< u32 > &idxs, PatchDataLayer &pdat) |
| void | append_subset_to (sycl::buffer< u32 > &idxs_buf, u32 sz, PatchDataLayer &pdat) |
| void | append_subset_to (const sham::DeviceBuffer< u32 > &idxs_buf, u32 sz, PatchDataLayer &pdat) const |
| u32 | get_obj_cnt () const |
| u64 | memsize () |
| bool | is_empty () |
| void | synchronize_buf () |
| void | overwrite (PatchDataLayer &pdat, u32 obj_cnt) |
| template<class T > | |
| bool | check_field_type (u32 idx) |
| template<class T > | |
| PatchDataField< T > & | get_field (u32 idx) |
| template<class T > | |
| const PatchDataField< T > & | get_field (u32 idx) const |
| template<class T > | |
| PatchDataField< T > & | get_field (const std::string &field_name) |
| template<class T > | |
| const PatchDataField< T > & | get_field (const std::string &field_name) const |
| template<class T > | |
| sham::DeviceBuffer< T > & | get_field_buf_ref (u32 idx) |
| template<class T , u32 nvar> | |
| PatchDataFieldSpan< T, nvar > | get_field_span (u32 idx) |
| returns a PatchDataFieldSpan of the field at index idx, with the given nvar value | |
| template<class T > | |
| PatchDataFieldSpan< T, shamrock::dynamic_nvar > | get_field_span_nvar_dynamic (u32 idx) |
| returns a PatchDataFieldSpan of the field at index idx, with a dynamic number of variables | |
| template<class T > | |
| PatchDataFieldSpan< T, shamrock::dynamic_nvar, shamrock::access_t_pointer > | get_field_pointer_span (u32 idx) |
| void | check_field_obj_cnt_match () |
| check that all contained field have the same obj cnt | |
| template<class T , class Functor > | |
| void | for_each_field (Functor &&func) |
| void | serialize_buf (shamalgs::SerializeHelper &serializer) |
| shamalgs::SerializeSize | serialize_buf_byte_size () |
| void | fields_raz () |
| bool | has_nan () |
| bool | has_inf () |
| bool | has_nan_or_inf () |
| template<class T > | |
| void | override_patch_field (std::string field_name, std::vector< T > &vec) |
| template<class T > | |
| std::vector< T > | fetch_data (std::string key) |
| Fetch data of a patchdata field into a std::vector. | |
| template<class T > | |
| void | split_patchdata (std::array< std::reference_wrapper< PatchDataLayer >, 8 > pdats, std::array< T, 8 > min_box, std::array< T, 8 > max_box) |
Static Public Member Functions | |
| static PatchDataLayer | mock_patchdata (u64 seed, u32 obj_cnt, const std::shared_ptr< PatchDataLayerLayout > &pdl) |
| static PatchDataLayer | deserialize_buf (shamalgs::SerializeHelper &serializer, const std::shared_ptr< PatchDataLayerLayout > &pdl) |
Friends | |
| bool | operator== (PatchDataLayer &p1, PatchDataLayer &p2) |
PatchDataLayer container class, the layout is described in patchdata_layout.
Definition at line 35 of file PatchDataLayer.hpp.
Definition at line 45 of file PatchDataLayer.hpp.
|
inline |
Definition at line 52 of file PatchDataLayer.hpp.
|
inline |
Definition at line 56 of file PatchDataLayer.hpp.
|
inlinenoexcept |
|
inline |
Definition at line 113 of file PatchDataLayer.hpp.
| void shamrock::patch::PatchDataLayer::append_subset_to | ( | const sham::DeviceBuffer< u32 > & | idxs_buf, |
| u32 | sz, | ||
| PatchDataLayer & | pdat | ||
| ) | const |
Definition at line 267 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::append_subset_to | ( | const std::vector< u32 > & | idxs, |
| PatchDataLayer & | pdat | ||
| ) |
Definition at line 245 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::append_subset_to | ( | sycl::buffer< u32 > & | idxs_buf, |
| u32 | sz, | ||
| PatchDataLayer & | pdat | ||
| ) |
Definition at line 222 of file PatchDataLayer.cpp.
|
inline |
check that all contained field have the same obj cnt
Definition at line 366 of file PatchDataLayer.hpp.
Here is the call graph for this function:
|
inline |
Definition at line 251 of file PatchDataLayer.hpp.
|
static |
Definition at line 309 of file PatchDataLayer.cpp.
|
inline |
Definition at line 121 of file PatchDataLayer.hpp.
|
inline |
Definition at line 126 of file PatchDataLayer.hpp.
| void shamrock::patch::PatchDataLayer::expand | ( | u32 | obj_cnt | ) |
Definition at line 166 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::extract_element | ( | u32 | pidx, |
| PatchDataLayer & | out_pdat | ||
| ) |
extract particle at index pidx and insert it in the provided vectors
| pidx | |
| out_pdat |
Definition at line 58 of file PatchDataLayer.cpp.
Here is the call graph for this function:| void shamrock::patch::PatchDataLayer::extract_elements | ( | const sham::DeviceBuffer< u32 > & | idxs, |
| PatchDataLayer & | out_pdat | ||
| ) |
Definition at line 80 of file PatchDataLayer.cpp.
|
inline |
Fetch data of a patchdata field into a std::vector.
| T |
| key | |
| pdat |
Definition at line 504 of file PatchDataLayer.hpp.
| void shamrock::patch::PatchDataLayer::fields_raz | ( | ) |
Definition at line 326 of file PatchDataLayer.cpp.
|
inline |
Definition at line 385 of file PatchDataLayer.hpp.
|
inline |
Definition at line 95 of file PatchDataLayer.hpp.
|
inline |
Definition at line 104 of file PatchDataLayer.hpp.
|
inline |
Definition at line 304 of file PatchDataLayer.hpp.
|
inline |
Definition at line 309 of file PatchDataLayer.hpp.
|
inline |
Definition at line 264 of file PatchDataLayer.hpp.
|
inline |
Definition at line 284 of file PatchDataLayer.hpp.
|
inline |
Definition at line 314 of file PatchDataLayer.hpp.
|
inline |
Definition at line 358 of file PatchDataLayer.hpp.
|
inline |
returns a PatchDataFieldSpan of the field at index idx, with the given nvar value
| idx | the index of the field |
Definition at line 340 of file PatchDataLayer.hpp.
|
inline |
returns a PatchDataFieldSpan of the field at index idx, with a dynamic number of variables
| idx | the index of the field |
Definition at line 352 of file PatchDataLayer.hpp.
|
inline |
Definition at line 50 of file PatchDataLayer.hpp.
|
inline |
Definition at line 211 of file PatchDataLayer.hpp.
|
inline |
Definition at line 448 of file PatchDataLayer.hpp.
|
inline |
Definition at line 434 of file PatchDataLayer.hpp.
|
inline |
Definition at line 462 of file PatchDataLayer.hpp.
this function remaps the patchdatafield like so val[id] = val[index_map[id]] This function can be used to apply the result of a sort to the field
| index_map | |
| len | the length of the map (must match with the current count) |
Definition at line 175 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::index_remap_resize | ( | sham::DeviceBuffer< u32 > & | index_map, |
| u32 | len | ||
| ) |
Same as index_remap_resize with a shamrock device buffer instead.
Definition at line 198 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::index_remap_resize | ( | sycl::buffer< u32 > & | index_map, |
| u32 | len | ||
| ) |
this function remaps the patchdatafield like so val[id] = val[index_map[id]] This function can be used to apply the result of a sort to the field
| index_map | |
| len | the length of the map |
Definition at line 187 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::insert_elements | ( | const PatchDataLayer & | pdat | ) |
Definition at line 103 of file PatchDataLayer.cpp.
|
inline |
insert elements of pdat only if they are within the range
| T |
| pdat | |
| bmin | |
| bmax |
Definition at line 533 of file PatchDataLayer.hpp.
Here is the call graph for this function:
|
inline |
Definition at line 238 of file PatchDataLayer.hpp.
| void shamrock::patch::PatchDataLayer::keep_ids | ( | sham::DeviceBuffer< u32 > & | index_map, |
| u32 | len | ||
| ) |
Same as keep_ids with a shamrock device buffer instead.
Definition at line 210 of file PatchDataLayer.cpp.
Here is the call graph for this function:Definition at line 206 of file PatchDataLayer.cpp.
|
inline |
Definition at line 225 of file PatchDataLayer.hpp.
|
static |
Definition at line 31 of file PatchDataLayer.cpp.
|
inlinenoexcept |
|
inline |
| T |
| field_name | |
| vec |
Definition at line 486 of file PatchDataLayer.hpp.
| void shamrock::patch::PatchDataLayer::overwrite | ( | PatchDataLayer & | pdat, |
| u32 | obj_cnt | ||
| ) |
Definition at line 126 of file PatchDataLayer.cpp.
|
inline |
Definition at line 47 of file PatchDataLayer.hpp.
|
inline |
Definition at line 48 of file PatchDataLayer.hpp.
| void shamrock::patch::PatchDataLayer::remove_ids | ( | const sham::DeviceBuffer< u32 > & | indexes, |
| u32 | len | ||
| ) |
remove some particles ids
Definition at line 214 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::reserve | ( | u32 | new_obj_cnt | ) |
Definition at line 157 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::resize | ( | u32 | new_obj_cnt | ) |
Definition at line 148 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::serialize_buf | ( | shamalgs::SerializeHelper & | serializer | ) |
Definition at line 294 of file PatchDataLayer.cpp.
| shamalgs::SerializeSize shamrock::patch::PatchDataLayer::serialize_buf_byte_size | ( | ) |
Definition at line 301 of file PatchDataLayer.cpp.
| void shamrock::patch::PatchDataLayer::split_patchdata | ( | std::array< std::reference_wrapper< PatchDataLayer >, 8 > | pdats, |
| std::array< T, 8 > | min_box, | ||
| std::array< T, 8 > | max_box | ||
| ) |
Definition at line 333 of file PatchDataLayer.cpp.
|
inline |
Definition at line 240 of file PatchDataLayer.hpp.
|
friend |
Definition at line 395 of file PatchDataLayer.hpp.