Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Member Functions | List of all members
shamrock::DataInserterUtility Class Reference

Class to insert data in the PatchScheduler. More...

#include <shamrock/include/shamrock/scheduler/DataInserterUtility.hpp>

Public Member Functions

 DataInserterUtility (PatchScheduler &sched)
 Constructor.
 
void balance_load (std::function< void(void)> load_balance_update)
 
template<class Tvec >
u64 push_patch_data (shamrock::patch::PatchDataLayer &pdat_ins, std::string main_field_name, u32 split_threshold, std::function< void(void)> load_balance_update)
 Pushes data into the scheduler.
 

Detailed Description

Class to insert data in the PatchScheduler.

This class is used to insert data in the PatchScheduler. It provides a way to push data into the scheduler and handle the insertion of the data into the correct patches.

Warning
This class must be used by all MPI ranks.

Definition at line 37 of file DataInserterUtility.hpp.

Constructor & Destructor Documentation

◆ DataInserterUtility()

shamrock::DataInserterUtility::DataInserterUtility ( PatchScheduler sched)
inline

Constructor.

Parameters
schedThe PatchScheduler to work on.

Definition at line 46 of file DataInserterUtility.hpp.

Member Function Documentation

◆ balance_load()

void shamrock::DataInserterUtility::balance_load ( std::function< void(void)>  load_balance_update)
inline

Definition at line 48 of file DataInserterUtility.hpp.

◆ push_patch_data()

template<class Tvec >
u64 shamrock::DataInserterUtility::push_patch_data ( shamrock::patch::PatchDataLayer pdat_ins,
std::string  main_field_name,
u32  split_threshold,
std::function< void(void)>  load_balance_update 
)
inline

Pushes data into the scheduler.

Warning
This function must be called by all MPI ranks
Todo:

use directly main field at id=0 and deduce type

implement case we more object than the threshold are present

Parameters
pdat_insThe PatchData object containing the data to be inserted.
main_field_nameThe name of the main field.
split_thresholdThe threshold at which the data will be split.
load_balance_updateA function to call after the insertion of the data. This function should call the load balance algorithm.
Returns
The number of objects inserted.

Definition at line 112 of file DataInserterUtility.hpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: