![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Utility class used to move the objects between patches. More...
#include <shamrock/include/shamrock/scheduler/ReattributeDataUtility.hpp>
Public Member Functions | |
| ReattributeDataUtility (PatchScheduler &sched) | |
| Constructor. | |
| template<class T > | |
| shambase::DistributedData< sycl::buffer< u64 > > | compute_new_pid (SerialPatchTree< T > &sptree, u32 ipos) |
| Computes the new patch owner IDs for the objects in the patches based on their position in space. | |
| shambase::DistributedDataShared< shamrock::patch::PatchDataLayer > | extract_elements (shambase::DistributedData< sycl::buffer< u64 > > new_pid) |
| Extracts elements that do not belong to a patch from the patch data based on the new patch IDs. | |
| template<class T > | |
| void | reatribute_patch_objects (SerialPatchTree< T > &sptree, std::string position_field) |
| Reattribute objects based on a given position field. | |
Utility class used to move the objects between patches.
The class is used to recompute the ownership of the objects in the patches based on their position in space.
Definition at line 38 of file ReattributeDataUtility.hpp.
|
inline |
Constructor.
| sched | The PatchScheduler to work on. |
Definition at line 47 of file ReattributeDataUtility.hpp.
|
inline |
Computes the new patch owner IDs for the objects in the patches based on their position in space.
| sptree | The SerialPatchTree used to compute the patch owners. |
| ipos | The index of the position field in the PatchData. |
| std::runtime_error | If a new ID could not be computed for an object (out of bound). |
Definition at line 62 of file ReattributeDataUtility.hpp.
Here is the call graph for this function:
|
inline |
Extracts elements that do not belong to a patch from the patch data based on the new patch IDs.
This function iterates over the patch data and extracts elements that need to be moved to a different patch. It uses the new patch IDs to determine which elements to extract and where to move them.
| new_pid | A distributed data object containing the new patch IDs. |
Definition at line 116 of file ReattributeDataUtility.hpp.
Here is the call graph for this function:
|
inline |
Reattribute objects based on a given position field.
This function computes new patch IDs for each object in the PatchData, extracts elements to be exchanged between patches, and then updates the patch data with the received elements.
| sptree | the SerialPatchTree |
| position_field | the name of the main field used to determine the new patch IDs |
Definition at line 216 of file ReattributeDataUtility.hpp.
Here is the call graph for this function: