WarpX
Public Member Functions | Public Attributes | List of all members
LabFrameDiag Class Reference

The capability for back-transformed lab-frame data is implemented to generate the full diagnostic snapshot for the entire domain and reduced diagnostic (1D, 2D or 3D 'slices') for a sub-domain. LabFrameDiag class defines the parameters required to backtrasform data from boosted frame at (z_boost,t_boost) to lab-frame at (z_lab, t_lab) using Lorentz transformation. This Lorentz transformation picks out one slice corresponding to both of those times, at position current_z_boost and current_z_lab in the boosted and lab frames, respectively. Two derived classes, namely, LabFrameSnapShot and LabFrameSlice are defined to store the full back-transformed diagnostic snapshot of the entire domain and reduced back-transformed diagnostic for a sub-domain, respectively. The approach here is to define an array of LabFrameDiag which would include both, full domain snapshots and reduced domain 'slices', sorted based on their respective t_lab. This is done to re-use the backtransformed data stored in the slice multifab at (z_lab,t_lab) for the full domain snapshot and sub-domain slices that have the same t_lab, instead of re-generating the backtransformed slice data at z_lab for a given t_lab for each diagnostic. More...

#include <BackTransformedDiagnostic.H>

Inheritance diagram for LabFrameDiag:
LabFrameSlice LabFrameSnapShot

Public Member Functions

void updateCurrentZPositions (amrex::Real t_boost, amrex::Real inv_gamma, amrex::Real inv_beta)
 
void createLabFrameDirectories ()
 
void writeLabFrameHeader ()
 
virtual void AddDataToBuffer (amrex::MultiFab &, int, amrex::Vector< int > const &)
 
virtual void AddPartDataToParticleBuffer (amrex::Vector< WarpXParticleContainer::DiagnosticParticleData > const &, int)
 
virtual ~LabFrameDiag ()=default
 

Public Attributes

std::string m_file_name
 
amrex::Real m_t_lab
 
amrex::RealBox m_prob_domain_lab_
 
amrex::IntVect m_prob_ncells_lab_
 
amrex::RealBox m_diag_domain_lab_
 
amrex::Box m_buff_box_
 
amrex::Real m_current_z_lab
 
amrex::Real m_current_z_boost
 
amrex::Real m_inv_gamma_boost_
 
amrex::Real m_inv_beta_boost_
 
amrex::Real m_dz_lab_
 
amrex::Real m_particle_slice_dx_lab_
 
int m_ncomp_to_dump_
 
std::vector< std::string > m_mesh_field_names_
 
int m_file_num
 
int m_initial_i
 
std::unique_ptr< amrex::MultiFab > m_data_buffer_
 
amrex::Vector< WarpXParticleContainer::DiagnosticParticleDatam_particles_buffer_
 
int m_buff_counter_
 
int m_num_buffer_ = 256
 
int m_max_box_size = 256
 

Detailed Description

The capability for back-transformed lab-frame data is implemented to generate the full diagnostic snapshot for the entire domain and reduced diagnostic (1D, 2D or 3D 'slices') for a sub-domain. LabFrameDiag class defines the parameters required to backtrasform data from boosted frame at (z_boost,t_boost) to lab-frame at (z_lab, t_lab) using Lorentz transformation. This Lorentz transformation picks out one slice corresponding to both of those times, at position current_z_boost and current_z_lab in the boosted and lab frames, respectively. Two derived classes, namely, LabFrameSnapShot and LabFrameSlice are defined to store the full back-transformed diagnostic snapshot of the entire domain and reduced back-transformed diagnostic for a sub-domain, respectively. The approach here is to define an array of LabFrameDiag which would include both, full domain snapshots and reduced domain 'slices', sorted based on their respective t_lab. This is done to re-use the backtransformed data stored in the slice multifab at (z_lab,t_lab) for the full domain snapshot and sub-domain slices that have the same t_lab, instead of re-generating the backtransformed slice data at z_lab for a given t_lab for each diagnostic.

Constructor & Destructor Documentation

◆ ~LabFrameDiag()

virtual LabFrameDiag::~LabFrameDiag ( )
virtualdefault

Member Function Documentation

◆ AddDataToBuffer()

virtual void LabFrameDiag::AddDataToBuffer ( amrex::MultiFab &  ,
int  ,
amrex::Vector< int > const &   
)
inlinevirtual

Back-transformed lab-frame field data is copied from tmp_slice to data_buffer where it is stored. For the full diagnostic, all the data in the MultiFab is copied. For the reduced diagnostic, the data is selectively copied if the extent of the z_lab multifab intersects with the user-defined sub-domain for the reduced diagnostic (i.e., a 1D, 2D, or 3D region of the domain).

Reimplemented in LabFrameSlice, and LabFrameSnapShot.

◆ AddPartDataToParticleBuffer()

virtual void LabFrameDiag::AddPartDataToParticleBuffer ( amrex::Vector< WarpXParticleContainer::DiagnosticParticleData > const &  ,
int   
)
inlinevirtual

Back-transformed lab-frame particles is copied from tmp_particle_buffer to particles_buffer. For the full diagnostic, all the particles are copied, while for the reduced diagnostic, particles are selectively copied if their position in within the user-defined sub-domain +/- 1 cell size width for the reduced slice diagnostic.

Reimplemented in LabFrameSlice, and LabFrameSnapShot.

◆ createLabFrameDirectories()

void LabFrameDiag::createLabFrameDirectories ( )

◆ updateCurrentZPositions()

void LabFrameDiag::updateCurrentZPositions ( amrex::Real  t_boost,
amrex::Real  inv_gamma,
amrex::Real  inv_beta 
)

◆ writeLabFrameHeader()

void LabFrameDiag::writeLabFrameHeader ( )

Member Data Documentation

◆ m_buff_box_

amrex::Box LabFrameDiag::m_buff_box_

◆ m_buff_counter_

int LabFrameDiag::m_buff_counter_

◆ m_current_z_boost

amrex::Real LabFrameDiag::m_current_z_boost

◆ m_current_z_lab

amrex::Real LabFrameDiag::m_current_z_lab

◆ m_data_buffer_

std::unique_ptr<amrex::MultiFab> LabFrameDiag::m_data_buffer_

◆ m_diag_domain_lab_

amrex::RealBox LabFrameDiag::m_diag_domain_lab_

◆ m_dz_lab_

amrex::Real LabFrameDiag::m_dz_lab_

◆ m_file_name

std::string LabFrameDiag::m_file_name

◆ m_file_num

int LabFrameDiag::m_file_num

◆ m_initial_i

int LabFrameDiag::m_initial_i

◆ m_inv_beta_boost_

amrex::Real LabFrameDiag::m_inv_beta_boost_

◆ m_inv_gamma_boost_

amrex::Real LabFrameDiag::m_inv_gamma_boost_

◆ m_max_box_size

int LabFrameDiag::m_max_box_size = 256

◆ m_mesh_field_names_

std::vector<std::string> LabFrameDiag::m_mesh_field_names_

◆ m_ncomp_to_dump_

int LabFrameDiag::m_ncomp_to_dump_

◆ m_num_buffer_

int LabFrameDiag::m_num_buffer_ = 256

◆ m_particle_slice_dx_lab_

amrex::Real LabFrameDiag::m_particle_slice_dx_lab_

◆ m_particles_buffer_

amrex::Vector<WarpXParticleContainer::DiagnosticParticleData> LabFrameDiag::m_particles_buffer_

◆ m_prob_domain_lab_

amrex::RealBox LabFrameDiag::m_prob_domain_lab_

◆ m_prob_ncells_lab_

amrex::IntVect LabFrameDiag::m_prob_ncells_lab_

◆ m_t_lab

amrex::Real LabFrameDiag::m_t_lab

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