|
WarpX
|
base class for diagnostics. Contains main routines to filter, compute and flush diagnostics. More...
#include <Diagnostics.H>
Public Member Functions | |
| Diagnostics (int i, std::string name) | |
| virtual | ~Diagnostics () |
| void | ComputeAndPack () |
| virtual void | Flush (int i_buffer)=0 |
| Flush particle and field buffers to file using the FlushFormat member variable. More... | |
| void | InitData () |
| virtual void | InitializeFieldFunctors (int lev)=0 |
| virtual bool | DoComputeAndPack (int step, bool force_flush=false)=0 |
| virtual bool | DoDump (int step, int i_buffer, bool force_flush=false)=0 |
| void | NewIteration () |
| void | FilterComputePackFlush (int step, bool force_flush=false) |
Protected Member Functions | |
| bool | BaseReadParameters () |
| void | InitBaseData () |
| virtual void | InitializeFieldBufferData (int i_buffer, int lev)=0 |
| virtual void | DerivedInitData () |
| virtual void | InitializeParticleBuffer ()=0 |
| virtual void | PrepareFieldDataForOutput () |
| virtual void | MovingWindowAndGalileanDomainShift () |
Protected Attributes | |
| std::string | m_diag_name |
| std::string | m_file_prefix |
| int | m_diag_index |
| amrex::Vector< std::string > | m_varnames |
| std::string | m_format = "plotfile" |
| int | m_already_done = false |
| FlushFormat * | m_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_species_names |
| amrex::Vector< ParticleDiag > | m_all_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< int > | m_rho_per_species_index |
base class for diagnostics. Contains main routines to filter, compute and flush diagnostics.
Each specific diagnostics derives from this class.
| Diagnostics::Diagnostics | ( | int | i, |
| std::string | name | ||
| ) |
|
virtual |
Virtual Destructor to handle clean destruction of derived classes
|
protected |
Read Parameters of the base Diagnostics class
| void Diagnostics::ComputeAndPack | ( | ) |
Pack (stack) all fields in the cell-centered output MultiFab m_mf_output.
Fields are computed (e.g., cell-centered or back-transformed) on-the-fly using a functor.
|
inlineprotectedvirtual |
Initialize member variables and arrays specific to the diagnostics in the derived classes.(FullDiagnostics, BTDiagnostics)
Reimplemented in BTDiagnostics.
|
pure virtual |
whether to compute and pack data in output buffers at this time step
| [in] | step | current time step |
| [in] | force_flush | if true, return true for any step |
Implemented in BTDiagnostics, and FullDiagnostics.
|
pure virtual |
whether to flush at this time step
| [in] | step | current time step |
| [in] | force_flush | if true, return true for any step |
Implemented in FullDiagnostics, and BTDiagnostics.
| void Diagnostics::FilterComputePackFlush | ( | int | step, |
| bool | force_flush = false |
||
| ) |
Perform necessary operations with user-defined diagnostic parameters to filter (coarsen, slice), compute (cell-center, back-transform), and flush the output data stored in buffers, m_mf_output.
| [in] | step | current timestep |
| [in] | force_flush | used to force-fully write data stored in buffers. |
|
pure virtual |
Flush particle and field buffers to file using the FlushFormat member variable.
This function should belong to class Diagnostics and not be virtual, as it flushes the particle buffers (name not found yet) and the field buffers (m_mf_output), both of which are members of Diagnostics. Yet, the implementation is left to derived classes for now because:
| [in] | i_buffer | index of the buffer data to be flushed. |
Implemented in FullDiagnostics, and BTDiagnostics.
|
protected |
Initialize member variables of the base Diagnostics class.
| void Diagnostics::InitData | ( | ) |
Initialize pointers to main fields and allocate output multifab m_mf_output.
|
protectedpure virtual |
Initialize m_mf_output vectors and data required to construct the buffers
| [in] | i_buffer | index of buffer for which the output MultiFab is defined. |
| [in] | lev | level on which the output MultiFab is defined |
Implemented in BTDiagnostics, and FullDiagnostics.
|
pure virtual |
Initialize functors that store pointers to the fields requested by the user.
Derived classes MUST implement this function, and it must allocate m_all_field_functors and fill it with ComputeDiagFunctor objects. The functions is called at intiailization and when the domain is decomposed during the simulation to load-balance.
| [in] | lev | level on which the vector of unique_ptrs to field functors is initialized. |
Implemented in FullDiagnostics, and BTDiagnostics.
|
protectedpure virtual |
This function initialized particle buffers (not implemented in diagnostics, yet)
Implemented in FullDiagnostics, and BTDiagnostics.
|
inlineprotectedvirtual |
Shift the diag-domain boundary for moving window and galilean simulations
Reimplemented in FullDiagnostics.
|
inline |
Start a new iteration, i.e., dump has not been done yet.
|
inlineprotectedvirtual |
Prepare data (either fill-boundary or cell-centered data for back-transform diagnostics) to be processed for diagnostics.
Reimplemented in FullDiagnostics, and BTDiagnostics.
|
protected |
Vector of (pointers to) functors to compute output fields, per level, per component. This allows for simple operations (averaging to cell-center for standard EB fields) as well as more involved operations (back-transformed diagnostics, filtering, reconstructing cartesian fields in cylindrical).
|
protected |
Each element of this vector handles output for 1 species
|
protected |
Whether this iteration has already been dumped, to avoid writing data twice
|
protected |
Coarsening ratio such that, fields are averaged to the coarsened grid. The ratio should render the grid to be coarsenable (as defined by AMReX).
|
protected |
Index of diagnostics in MultiDiagnostics::alldiags
|
protected |
Name of diagnostics: runtime parameter given in the input file.
|
protected |
Prefix for output directories
|
protected |
This class is responsible for flushing the data to file
|
protected |
format for output files, "plotfile" or "openpmd" or "sensei" or "ascent" The checkpoint format is applicable for FullDiagnostics only.
|
protected |
Geometry that defines the domain attributes corresponding to output multifab. Specifically, the user-defined physical co-ordinates for the diagnostics is used to construct the geometry information for each MultiFab at the respective levels. This geometry will be used to write out plotfile data using the WriteToFile() function
|
protected |
Higher corner of the diagnostics output, in physical coordinates
|
protected |
Lower corner of the diagnostics output, in physical coordinates
|
protected |
output multifab, where all fields are computed (cell-centered or back-transformed) and stacked. The first vector is for total number of snapshots. (=1 for FullDiagnostics) The second vector is loops over the total number of levels.
|
protected |
Number of output buffers. The value is set to 1 for all FullDiagnostics
|
protected |
Array of species indices that dump rho per species
|
protected |
Name of species to write to file
|
protected |
Names of each component requested by the user. in cylindrical geometry, this list is appended with automatically-constructed names for all modes of all fields
|
protected |
number of levels to output
|
protected |
Number of levels to be output
|
protected |
max_level to allocate output multifab and vector of field functors.
1.8.13