WarpX
Public Member Functions | Private Attributes | List of all members
BackTransformFunctor Class Referencefinal

Functor to back-transform cell-centered data and store result in mf_out. More...

#include <BackTransformFunctor.H>

Inheritance diagram for BackTransformFunctor:
ComputeDiagFunctor

Public Member Functions

 BackTransformFunctor (const amrex::MultiFab *mf_src, int lev, int ncomp, int num_buffers, amrex::Vector< std::string > varnames, amrex::Vector< std::string > varnames_fields, amrex::IntVect crse_ratio=amrex::IntVect(1))
 
void operator() (amrex::MultiFab &mf_dst, int dcomp, int i_buffer) const override
 Lorentz-transform mf_src for the ith buffer and write the result in mf_dst. More...
 
void PrepareFunctorData (int i_buffer, bool z_slice_in_domain, amrex::Real current_z_boost, amrex::Box buffer_box, int k_index_zlab, int snapshot_full) override
 Prepare data required to back-transform fields for lab-frame snapshot, i_buffer. More...
 
void InitData () override
 
void LorentzTransformZ (amrex::MultiFab &data, amrex::Real gamma_boost, amrex::Real beta_boost) const
 In-place Lorentz-transform of MultiFab, data, from boosted-frame to the lab-frame for all fields, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, and rho. More...
 
- Public Member Functions inherited from ComputeDiagFunctor
 ComputeDiagFunctor (int ncomp, amrex::IntVect crse_ratio)
 
virtual ~ComputeDiagFunctor ()=default
 
 ComputeDiagFunctor (const ComputeDiagFunctor &)=default
 
ComputeDiagFunctoroperator= (const ComputeDiagFunctor &)=default
 
 ComputeDiagFunctor (ComputeDiagFunctor &&)=default
 
ComputeDiagFunctoroperator= (ComputeDiagFunctor &&)=default
 
int nComp () const
 
void InterpolateMFForDiag (amrex::MultiFab &mf_dst, const amrex::MultiFab &mf_src, int dcomp, const amrex::DistributionMapping &dm, bool convertRZmodes2cartesian) const
 

Private Attributes

amrex::MultiFab const *const m_mf_src = nullptr
 
int const m_lev
 
int const m_num_buffers
 
amrex::Vector< amrex::Boxm_buffer_box
 
amrex::Vector< amrex::Real > m_current_z_boost
 
amrex::Vector< intm_perform_backtransform
 
amrex::Vector< intm_k_index_zlab
 
amrex::Vector< std::string > m_varnames
 
amrex::Vector< std::string > m_varnames_fields
 
amrex::Vector< intm_map_varnames
 

Additional Inherited Members

- Protected Attributes inherited from ComputeDiagFunctor
amrex::IntVect m_crse_ratio
 

Detailed Description

Functor to back-transform cell-centered data and store result in mf_out.

The cell-centered data is a ten-component multifab with field-data averaged-down from the finest to coarsest level, and stored as single-level data. For every i^th buffer, a z-slice corresponding to the z-boost location of the slice at the current timestep is extracted. This slice containing field-data in the boosted-frame is Lorentz-transformed to the lab-frame. The user-requested lab-frame field data is then stored in mf_dst.

Constructor & Destructor Documentation

◆ BackTransformFunctor()

BackTransformFunctor::BackTransformFunctor ( const amrex::MultiFab mf_src,
int  lev,
int  ncomp,
int  num_buffers,
amrex::Vector< std::string >  varnames,
amrex::Vector< std::string >  varnames_fields,
amrex::IntVect  crse_ratio = amrex::IntVect(1) 
)

Constructor description

Parameters
[in]mf_srccell-centered multifab containing all user-requested fields in boosted-frame
[in]levmesh-refinement level of multifab.
[in]ncompnumber of components of mf_src to Lorentz-Transform and store in destination multifab.
[in]num_buffersnumber of user-defined snapshots in the back-transformed lab-frame
[in]varnamesnames of the field-components as defined by the user for back-transformed diagnostics.
[in]varnames_fieldsbase names of field-components for the RZ modes
[in]crse_ratiothe coarsening ratio for fields

Member Function Documentation

◆ InitData()

void BackTransformFunctor::InitData ( )
overridevirtual

Allocate and initialize member variables and arrays required to back-transform field-data from boosted-frame to lab-frame.

Reimplemented from ComputeDiagFunctor.

◆ LorentzTransformZ()

void BackTransformFunctor::LorentzTransformZ ( amrex::MultiFab data,
amrex::Real  gamma_boost,
amrex::Real  beta_boost 
) const

In-place Lorentz-transform of MultiFab, data, from boosted-frame to the lab-frame for all fields, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, and rho.

Parameters
[in]dataz-slice field-data MultiFab to be back-transformed in-place from boosted-frame to lab-frame
[in]gamma_boostThe Lorentz factor of the boosted-frame in which the simulation is run
[in]beta_boostThe ratio of boost velocity to the speed of light

◆ operator()()

void BackTransformFunctor::operator() ( amrex::MultiFab mf_dst,
int  dcomp,
int  i_buffer 
) const
overridevirtual

Lorentz-transform mf_src for the ith buffer and write the result in mf_dst.

The source multifab, is a ten-component cell-centered multifab storing field-data in the boosted-frame. An z-slice is generated at the z-boost location for the ith buffer, stored in m_current_z_boost[i_buffer]. The data is then lorentz-transformed in-place using LorenzTransformZ (). The user-requested fields are then copied to mf_dst.

Parameters
[out]mf_dstoutput MultiFab where the back-transformed data is written
[in]dcompfirst component of mf_dst in which the back-transformed lab-frame data for the user-request fields is written.
[in]i_bufferbuffer index for which the data is transformed.

Implements ComputeDiagFunctor.

◆ PrepareFunctorData()

void BackTransformFunctor::PrepareFunctorData ( int  i_buffer,
bool  z_slice_in_domain,
amrex::Real  current_z_boost,
amrex::Box  buffer_box,
int  k_index_zlab,
int  snapshot_full 
)
overridevirtual

Prepare data required to back-transform fields for lab-frame snapshot, i_buffer.

Parameters
[in]i_bufferindex of the snapshot
[in]z_slice_in_domainif the z-slice at current_z_boost is within the boosted-frame and lab-frame domain. The fields are sliced and back-transformed only if this value is true.
[in]current_z_boostcurrent z coordinate in the boosted-frame
[in]buffer_boxBox with index-space in lab-frame for the ith buffer
[in]k_index_zlabk-index in the lab-frame corresponding to the current z co-ordinate in the lab-frame for the ith buffer.
[in]snapshot_fullif the current snapshot, with index, i_buffer, is full (1) or not (0). If it is full, then Lorentz-transform is not performed by setting m_perform_backtransform to 0.

Reimplemented from ComputeDiagFunctor.

Member Data Documentation

◆ m_buffer_box

amrex::Vector<amrex::Box> BackTransformFunctor::m_buffer_box
private

Vector of amrex::Box with index-space in the lab-frame

◆ m_current_z_boost

amrex::Vector<amrex::Real> BackTransformFunctor::m_current_z_boost
private

Vector of current z co-ordinate in the boosted-frame for each buffer

◆ m_k_index_zlab

amrex::Vector<int> BackTransformFunctor::m_k_index_zlab
private

Vector of k-index correspoding to the current lab-frame z co-ordinate for each buffer

◆ m_lev

int const BackTransformFunctor::m_lev
private

level at which m_mf_src is defined

◆ m_map_varnames

amrex::Vector<int> BackTransformFunctor::m_map_varnames
private

Indices that map user-defined fields to plot to the fields stored in the cell-centered MultiFab, m_mf_src. The cell-centered MultiFab stores Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, and rho.

◆ m_mf_src

amrex::MultiFab const* const BackTransformFunctor::m_mf_src = nullptr
private

pointer to source multifab (cell-centered multi-component multifab)

◆ m_num_buffers

int const BackTransformFunctor::m_num_buffers
private

Number of buffers or snapshots

◆ m_perform_backtransform

amrex::Vector<int> BackTransformFunctor::m_perform_backtransform
private

Vector of 0s and 1s stored to check if back-transformation is to be performed for the ith buffer. The value is set 0 (false) or 1 (true) using the boolean z_slice_in_domain in PrepareFunctorData().

◆ m_varnames

amrex::Vector< std::string > BackTransformFunctor::m_varnames
private

Vector of user-defined field names to be stored in the output multifab

◆ m_varnames_fields

amrex::Vector< std::string > BackTransformFunctor::m_varnames_fields
private

Vector of user-defined field names without modifications for rz modes


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