blob: d5e0c45b956018026a79a3db514216802cfd62ed (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#ifndef WARPX_PARTPERGRIDFUNCTOR_H_
#define WARPX_PARTPERGRIDFUNCTOR_H_
#include "ComputeDiagFunctor.H"
#include <AMReX_BaseFwd.H>
/**
* \brief Functor to cell-center MF and store result in mf_out.
*/
class
PartPerGridFunctor final : public ComputeDiagFunctor
{
public:
/** Constructor.
* \param[in] mf_src source multifab. Must be nullptr as not source MF is needed
* to compute the number of particles per cell, banane.
* \param[in] lev level of multifab. Used for averaging in rz.
* \param[in] crse_ratio for interpolating field values from simulation MultiFabs
to diags MultiFab mf_dst
* \param[in] ncomp Number of component of mf_src to cell-center in dst multifab.
*/
PartPerGridFunctor(const amrex::MultiFab * mf_src, int lev,
amrex::IntVect crse_ratio, int ncomp=1);
/** \brief Compute the number of particles per cell directly into mf_dst.
*
* \param[out] mf_dst output MultiFab where the result is written
* \param[in] dcomp first component of mf_dst in which cell-centered
* data is stored
*/
virtual void operator()(amrex::MultiFab& mf_dst, int dcomp, int /*i_buffer=0*/) const override;
private:
int const m_lev; /**< level on which mf_src is defined */
};
#endif // WARPX_PARTPERGRIDFUNCTOR_H_
|