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

#include <BTDiagnostics.H>

Inheritance diagram for BTDiagnostics:
Diagnostics

Public Member Functions

 BTDiagnostics (int i, const std::string &name)
 
- Public Member Functions inherited from Diagnostics
 Diagnostics (int i, std::string name)
 
virtual ~Diagnostics ()
 
 Diagnostics (Diagnostics const &)=delete
 
Diagnosticsoperator= (Diagnostics const &)=delete
 
 Diagnostics (Diagnostics &&)=default
 
Diagnosticsoperator= (Diagnostics &&)=default
 
void ComputeAndPack ()
 
void InitData ()
 
void InitDataBeforeRestart ()
 
void InitDataAfterRestart ()
 
virtual void InitializeFieldFunctorsRZopenPMD ([[maybe_unused]] int lev)
 
void NewIteration ()
 
void FilterComputePackFlush (int step, bool force_flush=false)
 
bool DoDumpLastTimestep () const
 
int getnumbuffers () const
 
virtual amrex::Real gettlab ([[maybe_unused]] int i_buffer)
 
virtual void settlab ([[maybe_unused]] int i_buffer, [[maybe_unused]] amrex::Real tlab)
 
virtual int get_buffer_k_index_hi ([[maybe_unused]] int i_buffer)
 
virtual void set_buffer_k_index_hi ([[maybe_unused]] int i_buffer, [[maybe_unused]] int kindex)
 
virtual amrex::Real get_snapshot_domain_lo ([[maybe_unused]] int i_buffer, [[maybe_unused]] int idim)
 
virtual amrex::Real get_snapshot_domain_hi ([[maybe_unused]] int i_buffer, [[maybe_unused]] int idim)
 
void setSnapshotDomainLo (int i_buffer, int idim, amrex::Real domain_lab_lo)
 
void setSnapshotDomainHi (int i_buffer, int idim, amrex::Real domain_lab_hi)
 
virtual int get_flush_counter ([[maybe_unused]] int i_buffer)
 
virtual void set_flush_counter ([[maybe_unused]] int i_buffer, [[maybe_unused]] int flush_counter)
 
virtual int get_last_valid_Zslice ([[maybe_unused]] int i_buffer)
 
virtual void set_last_valid_Zslice ([[maybe_unused]] int i_buffer, [[maybe_unused]] int last_valid_Zslice)
 
virtual int get_snapshot_full_flag ([[maybe_unused]] int i_buffer)
 
virtual void set_snapshot_full ([[maybe_unused]] int i_buffer, [[maybe_unused]] int snapshot_full)
 

Private Member Functions

void ReadParameters ()
 
void Flush (int i_buffer, bool force_flush) override
 Flush m_mf_output and particles to file. Currently, a temporary customized output format for the buffer data is implemented and called in this function. After implementing OpenPMD and plotfile formats, this function can be defined and implemented in Diagnostics.H, such that, the function call to flush out buffer data for FullDiagnostics and BTDiagnostics is the same. More...
 
bool DoDump (int step, int i_buffer, bool force_flush=false) override
 
bool DoComputeAndPack (int step, bool force_flush=false) override
 
void DerivedInitData () override
 
void InitializeFieldFunctors (int lev) override
 
void InitializeFieldFunctorsRZopenPMD (int lev) override
 
void AddRZModesToOutputNames (const std::string &field, int ncomp, bool cellcenter_data)
 
void InitializeParticleBuffer () override
 
void PrepareBufferData () override
 
void UpdateBufferData () override
 
void PrepareFieldDataForOutput () override
 
void PrepareParticleDataForOutput () override
 
bool GetZSliceInDomainFlag (int i_buffer, int lev)
 
bool GetKIndexInSnapshotBoxFlag (int i_buffer, int lev)
 
void InitializeBufferData (int i_buffer, int lev, bool restart=false) override
 
void DefineCellCenteredMultiFab (int lev)
 
void DefineFieldBufferMultiFab (int i_buffer, int lev)
 
void DefineSnapshotGeometry (int i_buffer, int lev)
 
amrex::Real UpdateCurrentZBoostCoordinate (amrex::Real t_lab, amrex::Real t_boost) const
 
amrex::Real UpdateCurrentZLabCoordinate (amrex::Real t_lab, amrex::Real t_boost) const
 
amrex::Real dz_lab (amrex::Real dt, amrex::Real ref_ratio) const
 
int k_index_zlab (int i_buffer, int lev) const
 
bool buffer_full (int i_buffer)
 
bool buffer_empty (int i_buffer)
 
void NullifyFirstFlush (int i_buffer)
 
void ResetBufferCounter (int i_buffer)
 
void IncrementBufferFlushCounter (int i_buffer)
 
void SetSnapshotFullStatus (int i_buffer)
 
void MergeBuffersForPlotfile (int i_snapshot)
 
void InterleaveBufferAndSnapshotHeader (const std::string &buffer_Header, const std::string &snapshot_Header)
 
void InterleaveFabArrayHeader (const std::string &Buffer_FabHeader_path, const std::string &snapshot_FabHeader_path, const std::string &newsnapshot_FabFilename)
 
void InterleaveSpeciesHeader (const std::string &buffer_species_Header_path, const std::string &snapshot_species_Header_path, const std::string &species_name, int new_data_index)
 
void InterleaveParticleDataHeader (const std::string &buffer_ParticleHdrFilename, const std::string &snapshot_ParticleHdrFilename)
 
void InitializeParticleFunctors () override
 
void ResetTotalParticlesInBuffer (int i_buffer)
 
void ClearParticleBuffer (int i_buffer)
 
void RedistributeParticleBuffer (int i_buffer)
 
void UpdateVarnamesForRZopenPMD ()
 
amrex::Real gettlab (int i_buffer) override
 
void settlab (int i_buffer, amrex::Real tlab) override
 
int get_buffer_k_index_hi (int i_buffer) override
 
void set_buffer_k_index_hi (int i_buffer, int kindex) override
 
amrex::Real get_snapshot_domain_lo (int i_buffer, int idim) override
 
amrex::Real get_snapshot_domain_hi (int i_buffer, int idim) override
 
int get_flush_counter (int i_buffer) override
 
void set_flush_counter ([[maybe_unused]] int i_buffer, int flush_counter) override
 
int get_last_valid_Zslice (int i_buffer) override
 
void set_last_valid_Zslice (int i_buffer, int last_valid_Zslice) override
 
int get_snapshot_full_flag (int i_buffer) override
 
void set_snapshot_full (int i_buffer, int snapshot_full) override
 

Private Attributes

bool m_plot_raw_fields = false
 
bool m_plot_raw_fields_guards = false
 
utils::parser::BTDIntervalsParser m_intervals
 
bool m_do_back_transformed_fields = true
 
bool m_do_back_transformed_particles = true
 
amrex::Real m_gamma_boost
 
amrex::Real m_beta_boost
 
int m_moving_window_dir
 
int m_num_snapshots_lab = std::numeric_limits<int>::lowest()
 
amrex::Real m_dt_snapshots_lab = std::numeric_limits<amrex::Real>::lowest()
 
amrex::Real m_dz_snapshots_lab = 0.0
 
int m_buffer_size = 256
 
amrex::Vector< amrex::Real > m_t_lab
 
amrex::Vector< amrex::RealBoxm_buffer_domain_lab
 
amrex::Vector< amrex::IntVectm_snapshot_ncells_lab
 
amrex::Vector< amrex::Boxm_snapshot_box
 
amrex::Vector< amrex::Boxm_buffer_box
 
amrex::Vector< amrex::Real > m_current_z_lab
 
amrex::Vector< amrex::Real > m_current_z_boost
 
amrex::Vector< amrex::Real > m_old_z_boost
 
amrex::Vector< amrex::Vector< amrex::Geometry > > m_geom_snapshot
 
amrex::Vector< intm_buffer_counter
 
amrex::Vector< intm_max_buffer_multifabs
 
amrex::Vector< intm_snapshot_full
 
amrex::Vector< intm_lastValidZSlice
 
amrex::Vector< intm_buffer_flush_counter
 
amrex::Vector< intm_buffer_k_index_hi
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > m_cell_centered_data
 
amrex::Vector< amrex::Vector< std::unique_ptr< ComputeDiagFunctor const > > > m_cell_center_functors
 
amrex::Vector< intm_first_flush_after_restart
 
amrex::Vector< intm_snapshot_geometry_defined
 
amrex::Vector< intm_field_buffer_multifab_defined
 
amrex::Vector< std::string > m_cellcenter_varnames
 
amrex::Vector< std::string > m_cellcenter_varnames_fields
 

Additional Inherited Members

- Protected Member Functions inherited from Diagnostics
bool BaseReadParameters ()
 
void InitBaseData ()
 
virtual void MovingWindowAndGalileanDomainShift (int step)
 
- Protected Attributes inherited from Diagnostics
std::string m_diag_name
 
std::string m_file_prefix
 
int m_file_min_digits = 6
 
int m_diag_index
 
amrex::Vector< std::string > m_varnames
 
amrex::Vector< std::string > m_varnames_fields
 
amrex::Vector< std::string > m_pfield_varnames
 
std::vector< std::string > m_pfield_species
 
std::vector< bool > m_pfield_do_average
 
std::vector< intm_pfield_species_index
 
std::vector< std::string > m_pfield_strings
 
std::vector< bool > m_pfield_dofilter
 
std::vector< std::string > m_pfield_filter_strings
 
bool m_dump_last_timestep = true
 
std::string m_format = "plotfile"
 
int m_already_done = false
 
std::unique_ptr< FlushFormatm_flush_format
 
amrex::Vector< amrex::Vector< amrex::MultiFab > > m_mf_output
 
amrex::Vector< amrex::Vector< amrex::Geometry > > m_geom_output
 
int nlev
 
int nmax_lev
 
int nlev_output
 
std::vector< std::string > m_output_species_names
 
std::vector< std::string > m_all_species_names
 
amrex::Vector< amrex::Vector< ParticleDiag > > m_output_species
 
amrex::Vector< amrex::Vector< std::unique_ptr< ComputeDiagFunctor > > > m_all_field_functors
 
amrex::IntVect m_crse_ratio = amrex::IntVect(1)
 
amrex::Vector< amrex::Real > m_lo
 
amrex::Vector< amrex::Real > m_hi
 
int m_num_buffers
 
amrex::Vector< intm_rho_per_species_index
 
amrex::Vector< amrex::Vector< std::unique_ptr< PinnedMemoryParticleContainer > > > m_particles_buffer
 
amrex::Vector< std::unique_ptr< ComputeParticleDiagFunctor > > m_all_particle_functors
 
amrex::Vector< amrex::Vector< int > > m_totalParticles_in_buffer
 
amrex::Vector< amrex::RealBoxm_snapshot_domain_lab
 

Constructor & Destructor Documentation

◆ BTDiagnostics()

BTDiagnostics::BTDiagnostics ( int  i,
const std::string &  name 
)

Member Function Documentation

◆ AddRZModesToOutputNames()

void BTDiagnostics::AddRZModesToOutputNames ( const std::string &  field,
int  ncomp,
bool  cellcenter_data 
)
private

Populating m_varnames with real and imaginary parts of each RZ mode. Modes are numbered from 0 to (nmodes-1) and mode 0 is purely real. Both m_cellcenter_varnames (storing cell-centered data) and m_varnames (storing back-transformed field data) are modified to include RZ modes to include field_modeid_real/imag. For example, for Er with two modes, the varnames are Er_0_real, Er_1_real, Er_1_imag

Parameters
[in]fieldfield-name
[in]ncompnumber of rz components (if 2 modes, the ncomp is 2*nmodes-1)
[in]cellcenter_dataif true, m_cellcenter_varnames are updated if false, m_varnames is updated

◆ buffer_empty()

bool BTDiagnostics::buffer_empty ( int  i_buffer)
inlineprivate

whether field buffer is empty.

Parameters
[in]i_bufferbuffer id for which the buffer size is checked. returns bool = true is buffer is empty i.e., when buffer counter is zero.

◆ buffer_full()

bool BTDiagnostics::buffer_full ( int  i_buffer)
inlineprivate

whether field buffer is full

Parameters
[in]i_bufferbuffer id for which the buffer size is checked. returns bool = true is buffer is full, that is, when buffer counter is equal to m_buffer_size

◆ ClearParticleBuffer()

void BTDiagnostics::ClearParticleBuffer ( int  i_buffer)
private

Clear particle data stored in the particle buffer

◆ DefineCellCenteredMultiFab()

void BTDiagnostics::DefineCellCenteredMultiFab ( int  lev)
private

Define the cell-centered multi-component MultiFab at level, lev. This function is called when the buffer counter for a snapshot is zero, or when the buffer is empty. Checked using buffer_empty(i_buffer)

Parameters
[in]levlevel at which the cell-centered MultiFab is defined.

◆ DefineFieldBufferMultiFab()

void BTDiagnostics::DefineFieldBufferMultiFab ( int  i_buffer,
int  lev 
)
private

Define the cell-centered multi-component output buffer MultiFab for snapshot, i_buffer, at level, lev

Parameters
[in]i_bufferbuffer-id of the back-transformed snapshot
[in]levmesh-refinement level at which the output buffer MultiFab is defined

◆ DefineSnapshotGeometry()

void BTDiagnostics::DefineSnapshotGeometry ( int  i_buffer,
int  lev 
)
private

Define the geometry object that spans the user-defined region for the ith snapshot, i_buffer, at level, lev.

Parameters
[in]i_bufferid of the back-transformed snapshot
[in]levlevel at which the geometry object is defined

◆ DerivedInitData()

void BTDiagnostics::DerivedInitData ( )
overrideprivatevirtual

Initialize Data required to compute back-transformed diagnostics

Reimplemented from Diagnostics.

◆ DoComputeAndPack()

bool BTDiagnostics::DoComputeAndPack ( int  step,
bool  force_flush = false 
)
overrideprivatevirtual

whether to compute the back-transformed data and store buffer in this timestep The field-data is back-transformed from boosted-frame to lab-frame at every time step within the PIC loop. Back-transformation is not performed at initialization.

Parameters
[in]stepcurrent time step, return true for any step >= 0
[in]force_flushif true, return true for any step

Implements Diagnostics.

◆ DoDump()

bool BTDiagnostics::DoDump ( int  step,
int  i_buffer,
bool  force_flush = false 
)
overrideprivatevirtual

whether to write output files at this time step The data is flushed when the buffer is full and/or when the simulation ends or when forced.

Parameters
[in]stepcurrent time step
[in]i_buffersnapshot index
[in]force_flushif true, return true for any step The return bool is used to determine when to write buffer data out

Implements Diagnostics.

◆ dz_lab()

amrex::Real BTDiagnostics::dz_lab ( amrex::Real  dt,
amrex::Real  ref_ratio 
) const
private

Compute and return cell-size in z-dimension in the lab-frame at level, lev

Parameters
[in]dttimestep in boosted-frame at level, lev
[in]ref_ratiorefinement ratio in the z-direction at level, lev-1. The ref-ratio in the z-direction for single-level diagnostics is 1.

◆ Flush()

void BTDiagnostics::Flush ( int  i_buffer,
bool  force_flush 
)
overrideprivatevirtual

Flush m_mf_output and particles to file. Currently, a temporary customized output format for the buffer data is implemented and called in this function. After implementing OpenPMD and plotfile formats, this function can be defined and implemented in Diagnostics.H, such that, the function call to flush out buffer data for FullDiagnostics and BTDiagnostics is the same.

Implements Diagnostics.

◆ get_buffer_k_index_hi()

int BTDiagnostics::get_buffer_k_index_hi ( int  i_buffer)
inlineoverrideprivate

◆ get_flush_counter()

int BTDiagnostics::get_flush_counter ( int  i_buffer)
inlineoverrideprivate

◆ get_last_valid_Zslice()

int BTDiagnostics::get_last_valid_Zslice ( int  i_buffer)
inlineoverrideprivate

◆ get_snapshot_domain_hi()

amrex::Real BTDiagnostics::get_snapshot_domain_hi ( int  i_buffer,
int  idim 
)
inlineoverrideprivate

◆ get_snapshot_domain_lo()

amrex::Real BTDiagnostics::get_snapshot_domain_lo ( int  i_buffer,
int  idim 
)
inlineoverrideprivate

◆ get_snapshot_full_flag()

int BTDiagnostics::get_snapshot_full_flag ( int  i_buffer)
inlineoverrideprivate

◆ GetKIndexInSnapshotBoxFlag()

bool BTDiagnostics::GetKIndexInSnapshotBoxFlag ( int  i_buffer,
int  lev 
)
private

whether the k-index corresponding to the z-slice for the ith buffer, i_buffer, is within the bounds of the box in index-space

Parameters
[in]i_bufferindex of the buffer for which the k-index is checked.
[in]levmesh-refinement level using which the k-index for the z-slice being filled in the ith buffer is computed Return true if the k-index of the z-slice is within the bounds of the box for the buffer being filled

◆ gettlab()

amrex::Real BTDiagnostics::gettlab ( int  i_buffer)
inlineoverrideprivate

◆ GetZSliceInDomainFlag()

bool BTDiagnostics::GetZSliceInDomainFlag ( int  i_buffer,
int  lev 
)
private

whether z-slice that corresponds to the buffer, i_buffer, is within the boosted-domain and lab-frame domains at level, lev.

Parameters
[in]i_bufferindex of the buffer for which the z-coordinates are checked Return true if the z co-ordinates stored in m_current_z_boost and m_current_z_lab for buffer, i_buffer, are within the bounds of the boosted-frame and lab-frame domain.
[in]levthe mesh-refinement level

◆ IncrementBufferFlushCounter()

void BTDiagnostics::IncrementBufferFlushCounter ( int  i_buffer)
inlineprivate

Increment buffer counter by one when the buffer of a snapshot has been flushed.

Parameters
[in]i_buffersnapshot index for which the counter is incremented.

◆ InitializeBufferData()

void BTDiagnostics::InitializeBufferData ( int  i_buffer,
int  lev,
bool  restart = false 
)
overrideprivatevirtual

Initialize buffer domain, buffer box and lab-frame parameters such as m_t_lab, and z-positions for the i^th snapshot, i_buffer, and level, lev.

Parameters
[in]i_bufferi^th snapshot or buffer
[in]levmesh-refinement level for which the field and/or particle buffer data is initialized.

Implements Diagnostics.

◆ InitializeFieldFunctors()

void BTDiagnostics::InitializeFieldFunctors ( int  lev)
overrideprivatevirtual

Initialize functors that store pointers to the fields requested by the user. Additionally, the cell-center functors that stores pointers to all fields, namely, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, and rho is also initialized.

Parameters
[in]levlevel on which the vector of unique_ptrs to field functors is initialized.

Implements Diagnostics.

◆ InitializeFieldFunctorsRZopenPMD()

void BTDiagnostics::InitializeFieldFunctorsRZopenPMD ( int  lev)
overrideprivate

Initialize functors that store pointers to the fields in RZ requested by the user. Additionally, the cell-center functors that stores pointers to all fields, namely, Er, Et, Ez, Br, Bt, Bz, jr, jt, jz, and rho is also initialized.

Parameters
[in]levlevel on which the vector of unique_ptrs to field functors is initialized.

◆ InitializeParticleBuffer()

void BTDiagnostics::InitializeParticleBuffer ( )
overrideprivatevirtual

This function allocates and initializes particle buffers for all the snapshots. This is currently an empty function: The particle containers required for this must be added to populate this function.

Implements Diagnostics.

◆ InitializeParticleFunctors()

void BTDiagnostics::InitializeParticleFunctors ( )
overrideprivatevirtual

Initialize particle functors for each species to compute the back-transformed lab-frame data.

Reimplemented from Diagnostics.

◆ InterleaveBufferAndSnapshotHeader()

void BTDiagnostics::InterleaveBufferAndSnapshotHeader ( const std::string &  buffer_Header,
const std::string &  snapshot_Header 
)
private

Interleave lab-frame meta-data of the buffers to be consistent with the merged plotfile lab-frame data.

◆ InterleaveFabArrayHeader()

void BTDiagnostics::InterleaveFabArrayHeader ( const std::string &  Buffer_FabHeader_path,
const std::string &  snapshot_FabHeader_path,
const std::string &  newsnapshot_FabFilename 
)
private

Interleave meta-data of the buffer multifabs to be consistent with the merged plotfile lab-frame data.

◆ InterleaveParticleDataHeader()

void BTDiagnostics::InterleaveParticleDataHeader ( const std::string &  buffer_ParticleHdrFilename,
const std::string &  snapshot_ParticleHdrFilename 
)
private

Interleave lab-frame metadata of the particle header file in the buffers to be consistent with the merged plotfile lab-frame data

◆ InterleaveSpeciesHeader()

void BTDiagnostics::InterleaveSpeciesHeader ( const std::string &  buffer_species_Header_path,
const std::string &  snapshot_species_Header_path,
const std::string &  species_name,
int  new_data_index 
)
private

Interleave lab-frame metadata of the species header file in the buffers to be consistent with the merged plotfile lab-frame data

◆ k_index_zlab()

int BTDiagnostics::k_index_zlab ( int  i_buffer,
int  lev 
) const
private

Compute k-index corresponding to current lab-frame z co-ordinate (m_current_z_lab) for the ith buffer i_buffer, and at level, lev.

Parameters
[in]i_buffersnapshot index
[in]levmesh-refinement level at which the lab-frame z-index is computed

◆ MergeBuffersForPlotfile()

void BTDiagnostics::MergeBuffersForPlotfile ( int  i_snapshot)
private

Merge the lab-frame buffer multifabs so it can be visualized as a single plotfile

◆ NullifyFirstFlush()

void BTDiagnostics::NullifyFirstFlush ( int  i_buffer)
inlineprivate

Resets integer for first flush to 0 for the ith snapshot (i_buffer). This function is called after flush the first buffer after restarting the simulation

◆ PrepareBufferData()

void BTDiagnostics::PrepareBufferData ( )
overrideprivatevirtual

This function prepares the current z coordinate in the boosted-frame and lab-frame as required by the particle and fields.

Reimplemented from Diagnostics.

◆ PrepareFieldDataForOutput()

void BTDiagnostics::PrepareFieldDataForOutput ( )
overrideprivatevirtual

The cell-centered data for all fields, namely, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, and rho is computed and stored in the multi-level cell-centered multifab, m_mf_cc. This MultiFab extends over the entire domain and is coarsened using the user-defined crse_ratio. For every lab-frame buffer, the data stored in this cell-centered MultiFab is sliced, back-transformed, and stored in the output multifab, m_mf_output.

Reimplemented from Diagnostics.

◆ PrepareParticleDataForOutput()

void BTDiagnostics::PrepareParticleDataForOutput ( )
overrideprivatevirtual

The Particle Geometry, BoxArray, and RealBox are set for the lab-frame output

Reimplemented from Diagnostics.

◆ ReadParameters()

void BTDiagnostics::ReadParameters ( )
private

Read relevant parameters for BTD

◆ RedistributeParticleBuffer()

void BTDiagnostics::RedistributeParticleBuffer ( int  i_buffer)
private

Redistributes particles to the buffer box array in the lab-frame

◆ ResetBufferCounter()

void BTDiagnostics::ResetBufferCounter ( int  i_buffer)
inlineprivate

Reset buffer counter to zero.

Parameters
[in]i_buffersnapshot index for which the counter is set to zero.

◆ ResetTotalParticlesInBuffer()

void BTDiagnostics::ResetTotalParticlesInBuffer ( int  i_buffer)
private

Reset total number of particles in the particle buffer to 0 for ith snapshot

◆ set_buffer_k_index_hi()

void BTDiagnostics::set_buffer_k_index_hi ( int  i_buffer,
int  kindex 
)
inlineoverrideprivate

◆ set_flush_counter()

void BTDiagnostics::set_flush_counter ( [[maybe_unused] ] int  i_buffer,
int  flush_counter 
)
inlineoverrideprivate

◆ set_last_valid_Zslice()

void BTDiagnostics::set_last_valid_Zslice ( int  i_buffer,
int  last_valid_Zslice 
)
inlineoverrideprivate

◆ set_snapshot_full()

void BTDiagnostics::set_snapshot_full ( int  i_buffer,
int  snapshot_full 
)
inlineoverrideprivate

◆ SetSnapshotFullStatus()

void BTDiagnostics::SetSnapshotFullStatus ( int  i_buffer)
private

Set Snapshot full status to 1 if the last valid zslice, m_lastValidZSlice, for the ith snapshot index, given by, i_buffer, is filled.

Parameters
[in]i_buffersnapshot index

◆ settlab()

void BTDiagnostics::settlab ( int  i_buffer,
amrex::Real  tlab 
)
inlineoverrideprivate

◆ UpdateBufferData()

void BTDiagnostics::UpdateBufferData ( )
overrideprivatevirtual

This function increments the buffer counter and identifies if the snapshot is fully populated

Reimplemented from Diagnostics.

◆ UpdateCurrentZBoostCoordinate()

amrex::Real BTDiagnostics::UpdateCurrentZBoostCoordinate ( amrex::Real  t_lab,
amrex::Real  t_boost 
) const
inlineprivate

Compute and return z-position in the boosted-frame at the current timestep

Parameters
[in]t_lablab-frame time of the snapshot
[in]t_boostboosted-frame time at level, lev

◆ UpdateCurrentZLabCoordinate()

amrex::Real BTDiagnostics::UpdateCurrentZLabCoordinate ( amrex::Real  t_lab,
amrex::Real  t_boost 
) const
inlineprivate

Compute and return z-position in the lab-frame at the current timestep

Parameters
[in]t_lablab-frame time of the snapshot
[in]t_boostboosted-frame time at level, lev

◆ UpdateVarnamesForRZopenPMD()

void BTDiagnostics::UpdateVarnamesForRZopenPMD ( )
private

Member Data Documentation

◆ m_beta_boost

amrex::Real BTDiagnostics::m_beta_boost
private

◆ m_buffer_box

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

Vector of Box-dimension in boosted-frame index space corresponding to the buffer that covers a part of the full backtransformed snapshot

◆ m_buffer_counter

amrex::Vector<int> BTDiagnostics::m_buffer_counter
private

Vector of counters tracking number of back-transformed z-slices filled in the output buffer multifab, m_mf_output, for each snapshot. When the buffer counter for a snapshot is equal to the maximum number of buffers (m_buffer_size), i.e., when the buffer is full, the data stored in the buffer multifab is flushed out and the counter is reset is zero.

◆ m_buffer_domain_lab

amrex::Vector<amrex::RealBox> BTDiagnostics::m_buffer_domain_lab
private

Vector of physical region corresponding to the buffer that spans a part of the full back-transformed snapshot

◆ m_buffer_flush_counter

amrex::Vector<int> BTDiagnostics::m_buffer_flush_counter
private

Vector of counters tracking number of times the buffer of multifab is flushed out and emptied before being refilled again for each snapshot

◆ m_buffer_k_index_hi

amrex::Vector<int> BTDiagnostics::m_buffer_k_index_hi
private

Vector of k-indices in the hi-end along the moving window direction for the buffer being filled for each snapshot.

◆ m_buffer_size

int BTDiagnostics::m_buffer_size = 256
private

Number of z-slices in each buffer of the snapshot

◆ m_cell_center_functors

amrex::Vector< amrex::Vector <std::unique_ptr<ComputeDiagFunctor const> > > BTDiagnostics::m_cell_center_functors
private

Vector of pointers to compute cell-centered data, per level, per component using the coarsening-ratio provided by the user.

◆ m_cell_centered_data

amrex::Vector<std::unique_ptr<amrex::MultiFab> > BTDiagnostics::m_cell_centered_data
private

Multi-level cell-centered multifab with all field-data components, namely, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz, and rho. This cell-centered data extending over the entire domain will be used by all snapshots to obtain lab-frame data at the respective z slice location.

◆ m_cellcenter_varnames

amrex::Vector< std::string > BTDiagnostics::m_cellcenter_varnames
private
Initial value:
= {"Er", "Et", "Ez",
"Br", "Bt", "Bz",
"jr", "jt", "jz", "rho"}

Vector of field-data stored in the cell-centered multifab, m_cell_centered_data. All the fields are stored regardless of the specific fields to plot selected by the user.

◆ m_cellcenter_varnames_fields

amrex::Vector< std::string > BTDiagnostics::m_cellcenter_varnames_fields
private
Initial value:
= {"Er", "Et", "Ez",
"Br", "Bt", "Bz",
"jr", "jt", "jz",
"rho"}

◆ m_current_z_boost

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

Vector of boosted-frame z co-ordinate corresponding to each back-transformed snapshot at the current timestep

◆ m_current_z_lab

amrex::Vector<amrex::Real> BTDiagnostics::m_current_z_lab
private

Vector of lab-frame z co-ordinate of each back-transformed snapshot at the current timestep

◆ m_do_back_transformed_fields

bool BTDiagnostics::m_do_back_transformed_fields = true
private

Whether to compute back-tranformed values for field-data. default value is true.

◆ m_do_back_transformed_particles

bool BTDiagnostics::m_do_back_transformed_particles = true
private

Whether to compute back-tranformed values for particle-data default value is true.

◆ m_dt_snapshots_lab

amrex::Real BTDiagnostics::m_dt_snapshots_lab = std::numeric_limits<amrex::Real>::lowest()
private

Time interval in lab-frame between the back-transformed snapshots

◆ m_dz_snapshots_lab

amrex::Real BTDiagnostics::m_dz_snapshots_lab = 0.0
private

Distance between the back-transformed snapshots in lab-frame m_dz_snapshots_lab = m_dt_snapshots_lab/c

◆ m_field_buffer_multifab_defined

amrex::Vector<int> BTDiagnostics::m_field_buffer_multifab_defined
private

Vector of integers to indicate if the field buffer multifab, m_mf_output, is defined in DefineFieldBufferMultifab() function

◆ m_first_flush_after_restart

amrex::Vector<int> BTDiagnostics::m_first_flush_after_restart
private

Vector of integers to indicate if is the first flush for a snapshot so that appropriate meta-data and geometry is written (0 if not, 1 if yes).

◆ m_gamma_boost

amrex::Real BTDiagnostics::m_gamma_boost
private

m_gamma_boost, is a copy of WarpX::gamma_boost That is, the Lorentz factor of the boosted frame in which the simulation is run. The direction for Lorentz transformation is assumed to be along warpx.boost_direction, which is the same as the moving window direction. Currently, back-transformed diagnostics only works if the boost-direction and moving window direction are along the z-direction in Cartesian co-ordinates.

◆ m_geom_snapshot

amrex::Vector< amrex::Vector <amrex::Geometry> > BTDiagnostics::m_geom_snapshot
private

Geometry that defines the domain attributes corresponding to the full snapshot in the back-transformed lab-frame. Specifically, the user-defined physical co-ordinates for the diagnostics is used to construct the geometry information for each snapshot at the respective levels. This geometry will be used to integrate all the buffers that were dumped out with partial field data in the back-transformed frame at a particle snapshot, t_lab. WriteToFile() for BTD will include this additional geometry information to guide the integration process.

◆ m_intervals

utils::parser::BTDIntervalsParser BTDiagnostics::m_intervals
private

Determines timesteps at which BTD diagnostics are written to file

◆ m_lastValidZSlice

amrex::Vector<int> BTDiagnostics::m_lastValidZSlice
private

Vector of integers to store if the last valid slice in the lab-frame is being filled. When the value is 1, then the buffer is flushed, and m_snapshot_full is set to 1 for that snapshot index.

◆ m_max_buffer_multifabs

amrex::Vector<int> BTDiagnostics::m_max_buffer_multifabs
private

Vector of maximum number of buffer multifabs that need to be flushed to generate each lab-frame snapshot. At the final flush, m_buffer_flush_counter will be equal to the predicted m_max_buffer_multifabs for each snapshot.

◆ m_moving_window_dir

int BTDiagnostics::m_moving_window_dir
private

m_moving_window_dir is a copy of WarpX::moving_window_dir Currently, back-transformed diagnostics only works if moving window is in z-direction for both 2D and 3D simulations in the Cartesian frame of reference.

◆ m_num_snapshots_lab

int BTDiagnostics::m_num_snapshots_lab = std::numeric_limits<int>::lowest()
private

Number of back-transformed snapshots in the lab-frame requested by the user

◆ m_old_z_boost

amrex::Vector<amrex::Real> BTDiagnostics::m_old_z_boost
private

Vector of previous boosted-frame z co-ordinate corresponding to each back-transformed snapshot

◆ m_plot_raw_fields

bool BTDiagnostics::m_plot_raw_fields = false
private

Whether to plot raw (i.e., NOT cell-centered) fields

◆ m_plot_raw_fields_guards

bool BTDiagnostics::m_plot_raw_fields_guards = false
private

Whether to plot guard cells of raw fields

◆ m_snapshot_box

amrex::Vector<amrex::Box> BTDiagnostics::m_snapshot_box
private

Vector of Box-dimension in boosted-frame index space for each back-transformed snapshot

◆ m_snapshot_full

amrex::Vector<int> BTDiagnostics::m_snapshot_full
private

Vector of integers to indicate if the snapshot is full (0 not full, 1 for full). If the snapshot is full, then the snapshot files are closed.

◆ m_snapshot_geometry_defined

amrex::Vector<int> BTDiagnostics::m_snapshot_geometry_defined
private

Vector of integers to indicate if the snapshot geometry is defined.

◆ m_snapshot_ncells_lab

amrex::Vector<amrex::IntVect> BTDiagnostics::m_snapshot_ncells_lab
private

Vector of number of cells in the lab-frame for each back-transformed snapshot

◆ m_t_lab

amrex::Vector<amrex::Real> BTDiagnostics::m_t_lab
private

Vector of lab-frame time corresponding to each snapshot


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