ARTEMIS
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
FieldReduction Class Reference

#include <FieldReduction.H>

Inheritance diagram for FieldReduction:
ReducedDiags

Public Member Functions

 FieldReduction (std::string rd_name)
 
virtual void ComputeDiags (int step) override final
 
template<typename ReduceOp >
void ComputeFieldReduction ()
 
- Public Member Functions inherited from ReducedDiags
 ReducedDiags (std::string rd_name)
 
virtual ~ReducedDiags ()=default
 
virtual void InitData ()
 
virtual void LoadBalance ()
 
virtual void WriteToFile (int step) const
 
void BackwardCompatibility ()
 

Private Attributes

std::unique_ptr< amrex::Parserm_parser
 
int m_reduction_type
 

Static Private Attributes

static constexpr int m_nvars = 9
 

Additional Inherited Members

- Public Attributes inherited from ReducedDiags
std::string m_path = "./diags/reducedfiles/"
 output path (default) More...
 
std::string m_extension = "txt"
 output extension (default) More...
 
std::string m_rd_name
 diags name More...
 
utils::parser::IntervalsParser m_intervals
 output intervals More...
 
int m_IsNotRestart = 1
 check if it is a restart run More...
 
std::string m_sep = " "
 separator in the output file More...
 
std::vector< amrex::Real > m_data
 output data More...
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ FieldReduction()

FieldReduction::FieldReduction ( std::string  rd_name)

constructor

Parameters
[in]rd_namereduced diags names

Member Function Documentation

◆ ComputeDiags()

void FieldReduction::ComputeDiags ( int  step)
finaloverridevirtual

This function is called at every time step, and if necessary calls the templated function ComputeFieldReduction(), which does the actual reduction computation.

Parameters
[in]stepthe timestep

Implements ReducedDiags.

◆ ComputeFieldReduction()

template<typename ReduceOp >
void FieldReduction::ComputeFieldReduction ( )
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.

Template Parameters
ReduceOpthe type of reduction that is performed. This is typically amrex::ReduceOpMax, amrex::ReduceOpMin or amrex::ReduceOpSum.

Member Data Documentation

◆ m_nvars

constexpr int FieldReduction::m_nvars = 9
staticconstexprprivate

Parser to read expression to be reduced from the input file. 9 elements are x, y, z, Ex, Ey, Ez, Bx, By, Bz

◆ m_parser

std::unique_ptr<amrex::Parser> FieldReduction::m_parser
private

◆ m_reduction_type

int FieldReduction::m_reduction_type
private

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