1 #ifndef AMReX_ParticleInSituBridge_H
2 #define AMReX_ParticleInSituBridge_H
4 #include <AMReX_Config.H>
8 #ifdef AMREX_USE_SENSEI_INSITU
11 #include <AnalysisAdaptor.h>
20 class ParticleInSituBridge :
public InSituBridge
23 ParticleInSituBridge() {}
24 ~ParticleInSituBridge() {}
26 ParticleInSituBridge(
const ParticleInSituBridge&) =
delete;
27 void operator=(
const ParticleInSituBridge&) =
delete;
31 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
36 const std::map<std::string, std::vector<int>> & particles_rStructs = {},
37 const std::map<std::string, int> & particles_iStructs = {},
38 const std::map<std::string, std::vector<int>> & particles_rArrays = {},
39 const std::map<std::string, int> & particles_iArrays = {});
42 template<
typename ParticleType,
int NArrayReal,
int NArrayInt>
43 int ParticleInSituBridge::update(
47 const std::map<std::string, std::vector<int>> & particles_rStructs,
48 const std::map<std::string, int> & particles_iStructs,
49 const std::map<std::string, std::vector<int>> & particles_rArrays,
50 const std::map<std::string, int> & particles_iArrays)
53 #if defined(AMREX_USE_SENSEI_INSITU)
56 sensei::TimeEvent<64> event(
"ParticleInSituBridge::update");
58 amrex::Print() <<
"SENSEI Particles Begin update..." << std::endl;
59 auto t0 = std::chrono::high_resolution_clock::now();
63 SENSEI_ERROR(
"no particles presented at update call");
67 ParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt> *data_adaptor
68 = ParticleDataAdaptor<ParticleType, NArrayReal, NArrayInt>::New();
71 data_adaptor->SetCommunicator(comm);
73 data_adaptor->SetDataSource(particles, particles_rStructs,
74 particles_iStructs, particles_rArrays, particles_iArrays);
76 data_adaptor->SetDataTime(time);
77 data_adaptor->SetDataTimeStep(time_step);
78 ret = analysis_adaptor->Execute(data_adaptor,
nullptr) ? 0 : -1;
79 data_adaptor->ReleaseData();
80 data_adaptor->Delete();
82 auto t1 = std::chrono::high_resolution_clock::now();
83 auto dt = std::chrono::duration_cast<std::chrono::duration<double>>(t1 - t0);
84 amrex::Print() <<
"SENSEI update complete (" << dt.count() <<
" sec)" << std::endl;
static constexpr int MPI_COMM_NULL
Definition: AMReX_ccse-mpi.H:55
A distributed container for Particles sorted onto the levels, grids, and tiles of a block-structured ...
Definition: AMReX_ParticleContainer.H:145
This class provides the user with a few print options.
Definition: AMReX_Print.H:35
Definition: AMReX_Amr.cpp:49