|
WarpX
|
#include <FieldReduction.H>
Public Member Functions | |
| FieldReduction (const std::string &rd_name) | |
| void | ComputeDiags (int step) final |
| void | BackwardCompatibility () |
| template<typename ReduceOp> | |
| void | ComputeFieldReduction () |
Public Member Functions inherited from ReducedDiags | |
| ReducedDiags (const std::string &rd_name) | |
| virtual | ~ReducedDiags ()=default |
| ReducedDiags (const ReducedDiags &)=default | |
| ReducedDiags & | operator= (const ReducedDiags &)=default |
| ReducedDiags (ReducedDiags &&)=default | |
| ReducedDiags & | operator= (ReducedDiags &&)=default |
| virtual void | InitData () |
| virtual void | LoadBalance () |
| virtual void | ComputeDiagsMidStep (int step) |
| virtual void | WriteToFile (int step) const |
| bool | DoDiags (int step) const |
| virtual void | WriteCheckpointData (std::string const &dir) |
| Write out checkpoint related data. | |
| virtual void | ReadCheckpointData (std::string const &dir) |
| Read in checkpoint related data. | |
| void | BackwardCompatibility () const |
Private Attributes | |
| std::unique_ptr< amrex::Parser > | m_parser |
| ReductionType | m_reduction_type |
Static Private Attributes | |
| static constexpr int | m_nvars = 12 |
Additional Inherited Members | |
Public Attributes inherited from ReducedDiags | |
| std::string | m_path = "./diags/reducedfiles/" |
| output path (default) | |
| std::string | m_extension = "txt" |
| output extension (default) | |
| std::string | m_rd_name |
| diags name | |
| utils::parser::IntervalsParser | m_intervals |
| output intervals | |
| bool | m_write_header = false |
| check if header should be written | |
| std::string | m_sep = " " |
| separator in the output file | |
| int | m_precision = 14 |
| precision for data in the output file | |
| std::vector< amrex::Real > | m_data |
| output data | |
This class contains a function that computes an arbitrary reduction of the fields. The function used in the reduction is defined by an input file parser expression and the reduction operation can be either Maximum, Minimum, or Integral (Sum multiplied by cell volume).
| FieldReduction::FieldReduction | ( | const std::string & | rd_name | ) |
constructor
| [in] | rd_name | reduced diags names |
| void FieldReduction::BackwardCompatibility | ( | ) |
This function queries deprecated input parameters and aborts the run if one of them is specified.
|
finalvirtual |
This function is called at every time step, and if necessary calls the templated function ComputeFieldReduction(), which does the actual reduction computation.
| [in] | step | the timestep |
Implements ReducedDiags.
|
inline |
This function does the actual reduction computation. The fields are first interpolated on the cell centers and the reduction operation is then performed using amrex::ReduceOps.
| ReduceOp | the type of reduction that is performed. This is typically amrex::ReduceOpMax, amrex::ReduceOpMin or amrex::ReduceOpSum. |
|
staticconstexprprivate |
Parser to read expression to be reduced from the input file. 12 elements are x, y, z, Ex, Ey, Ez, Bx, By, Bz, jx, jy, jz
|
private |
|
private |