10#ifndef IMPACTX_ELEMENTS_DIAGS_BEAMMONITOR_H
11#define IMPACTX_ELEMENTS_DIAGS_BEAMMONITOR_H
23#include <unordered_map>
50 unsigned long long &
offset,
51 unsigned long long &sum)
const;
71 static constexpr auto type =
"BeamMonitor";
84 BeamMonitor (std::string series_name, std::string backend=
"default", std::string encoding=
"g",
int period_sample_intervals=1);
103 std::vector<std::string>
const & real_soa_names,
104 std::vector<std::string>
const & int_soa_names,
131 PinnedContainer::ParIterType & pti,
132 std::vector<std::string>
const & real_soa_names,
133 std::vector<std::string>
const & int_soa_names,
138 using Thin::operator();
141 using LinearTransport::operator();
202 std::unordered_map<std::string, amrex::ParticleReal>
m_rbc;
213 std::string
const & element_name,
#define AMREX_FORCE_INLINE
Array4< int const > offset
amrex::ParticleContainer_impl< ParticleType, NArrayReal, NArrayInt, NewAllocator > ContainerLike
T_ParticleType ParticleType
Definition ImpactXParticleContainer.H:133
int m_MPISize
Definition BeamMonitor.H:54
std::vector< unsigned long long > m_ParticleSizeAtRank
Definition BeamMonitor.H:41
std::vector< unsigned long long > m_ParticleOffsetAtRank
Definition BeamMonitor.H:40
unsigned long GetTotalNumParticles()
Definition BeamMonitor.H:38
void GetParticleOffsetOfProcessor(const long &numParticles, unsigned long long &offset, unsigned long long &sum) const
Definition BeamMonitor.cpp:84
typename ImpactXParticleContainer::ContainerLike< amrex::PinnedArenaAllocator > ParticleContainer
Definition BeamMonitor.H:33
ImpactXParticleCounter(ParticleContainer &pc)
Definition BeamMonitor.cpp:38
typename ParticleContainer::ParIterType ParticleIter
Definition BeamMonitor.H:34
std::vector< unsigned long long > m_ParticleCounterByLevel
Definition BeamMonitor.H:58
int m_MPIRank
Definition BeamMonitor.H:53
unsigned long long m_Total
Definition BeamMonitor.H:56
Definition BeamMonitor.cpp:37
Definition AdditionalProperties.cpp:27
void add_optional_properties(std::string const &element_name, ImpactXParticleContainer &pc)
Definition AdditionalProperties.cpp:29
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > Map6x6
Definition CovarianceMatrix.H:20
static constexpr __host__ __device__ SmallMatrix< T, NRows, NCols, ORDER, StartIndex > Identity() noexcept
Definition ReferenceParticle.H:31
typename ImpactXParticleContainer::ParticleType PType
Definition BeamMonitor.H:72
std::string m_OpenPMDFileType
openPMD filename
Definition BeamMonitor.H:183
void prepare(PinnedContainer &pc, std::vector< std::string > const &real_soa_names, std::vector< std::string > const &int_soa_names, RefPart const &ref_part, int step)
Definition BeamMonitor.cpp:213
AMREX_FORCE_INLINE std::string name() const
Definition BeamMonitor.H:161
typename ImpactXParticleContainer::ContainerLike< amrex::PinnedArenaAllocator > PinnedContainer
Definition BeamMonitor.H:73
static constexpr auto type
Definition BeamMonitor.H:71
BeamMonitor(std::string series_name, std::string backend="default", std::string encoding="g", int period_sample_intervals=1)
Definition BeamMonitor.cpp:126
std::unordered_map< std::string, amrex::ParticleReal > m_rbc
Definition BeamMonitor.H:202
std::string m_series_name
Definition BeamMonitor.H:182
BeamMonitor(BeamMonitor const &other)=default
void finalize()
Definition BeamMonitor.cpp:109
BeamMonitor(BeamMonitor &&other)=default
std::any m_series
openPMD iteration encoding: "v"ariable based, "f"ile based, "g"roup based (default)
Definition BeamMonitor.H:185
AMREX_FORCE_INLINE bool has_name() const
Definition BeamMonitor.H:165
int m_file_min_digits
global step for output
Definition BeamMonitor.H:188
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition BeamMonitor.H:150
int m_period_sample_intervals
minimum number of digits to iteration number in file name
Definition BeamMonitor.H:190
int m_step
openPMD::Series that holds potentially multiple outputs
Definition BeamMonitor.H:186
static std::map< std::string, std::any > m_unique_series
Definition BeamMonitor.H:171
void open()
Definition BeamMonitor.cpp:130
std::vector< uint64_t > m_offset
only output every Nth period (turn or cycle) of periodic lattices
Definition BeamMonitor.H:196
BeamMonitor & operator=(BeamMonitor const &other)=default
std::string m_encoding
openPMD backend: usually HDF5 (h5) or ADIOS2 (bp/bp4/bp5) or ADIOS2 SST (sst)
Definition BeamMonitor.H:184
void operator()(ImpactXParticleContainer &pc, int step, int period)
Definition BeamMonitor.cpp:306
Definition lineartransport.H:29