WarpX
|
Functor to calculate per-cell averages of particle properties. More...
#include <ParticleReductionFunctor.H>
Public Member Functions | |
ParticleReductionFunctor (const amrex::MultiFab *mf_src, int lev, amrex::IntVect crse_ratio, const std::string &fn_str, int ispec, bool do_average, bool do_filter, const std::string &filter_str, int ncomp=1) | |
void | operator() (amrex::MultiFab &mf_dst, int dcomp, int) const override |
Compute the average of the function m_map_fn over each grid cell. More... | |
![]() | |
ComputeDiagFunctor (int ncomp, amrex::IntVect crse_ratio) | |
virtual | ~ComputeDiagFunctor ()=default |
ComputeDiagFunctor (const ComputeDiagFunctor &)=default | |
ComputeDiagFunctor & | operator= (const ComputeDiagFunctor &)=default |
ComputeDiagFunctor (ComputeDiagFunctor &&)=default | |
ComputeDiagFunctor & | operator= (ComputeDiagFunctor &&)=default |
int | nComp () const |
virtual void | PrepareFunctorData (int i_buffer, bool z_slice_in_domain, amrex::Real current_z_boost, amrex::Box buffer_box, const int k_index_zlab, const int snapshot_full) |
Prepare data required to process fields in the operator() Note that this function has parameters that are specific to back-transformed diagnostics, that are unused for regular diagnostics. More... | |
virtual void | InitData () |
void | InterpolateMFForDiag (amrex::MultiFab &mf_dst, const amrex::MultiFab &mf_src, int dcomp, const amrex::DistributionMapping &dm, bool convertRZmodes2cartesian) const |
Private Attributes | |
int const | m_lev |
int const | m_ispec |
bool const | m_do_average |
bool const | m_do_filter |
std::unique_ptr< amrex::Parser > | m_map_fn_parser |
std::unique_ptr< amrex::Parser > | m_filter_fn_parser |
amrex::ParserExecutor< 6 > | m_map_fn |
amrex::ParserExecutor< 6 > | m_filter_fn |
Additional Inherited Members | |
![]() | |
amrex::IntVect | m_crse_ratio |
Functor to calculate per-cell averages of particle properties.
ParticleReductionFunctor::ParticleReductionFunctor | ( | const amrex::MultiFab * | mf_src, |
int | lev, | ||
amrex::IntVect | crse_ratio, | ||
const std::string & | fn_str, | ||
int | ispec, | ||
bool | do_average, | ||
bool | do_filter, | ||
const std::string & | filter_str, | ||
int | ncomp = 1 |
||
) |
Constructor.
[in] | mf_src | source multifab. Must be nullptr as no source MF is needed to compute the number of particles per cell, banane. |
[in] | lev | level of multifab. |
[in] | crse_ratio | for interpolating field values from simulation MultiFabs to the output diagnostic MultiFab mf_dst. |
[in] | fn_str | parser string that describes the function to apply to particles and then average over each cell |
[in] | ispec | index of the species over which to calculate the average |
[in] | do_average | Whether to do an average or a sum of the function |
[in] | do_filter | Whether to apply a filter function to particles before averaging |
[in] | filter_str | Parser string for filter function to apply before averaging |
[in] | ncomp | Number of component of mf_src to cell-center in dst multifab. |
|
overridevirtual |
Compute the average of the function m_map_fn over each grid cell.
[out] | mf_dst | output MultiFab where the result is written |
[in] | dcomp | first component of mf_dst in which cell-centered data is stored |
Implements ComputeDiagFunctor.
|
private |
Whether to calculate the average of the data
|
private |
whether to apply m_filter_fn
|
private |
Compiled m_filter_fn_parser
|
private |
Parser function to filter particles before pass to map. Arguments: x, y, z, ux, uy, uz
|
private |
index of species to average over
|
private |
level on which mf_src is defined
|
private |
Compiled m_map_fn_parser
|
private |
Parser function to be averaged by the functor. Arguments: x, y, z, ux, uy, uz