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

This class is used to determine if resampling should be done at a given timestep for a given species. Specifically resampling is performed if the current timestep is included in the IntervalsParser m_resampling_intervals or if the average number of particles per cell of the considered species exceeds the threshold m_max_avg_ppc. More...

#include <ResamplingTrigger.H>

Public Member Functions

 ResamplingTrigger ()=default
 Default constructor of the ResamplingTrigger class. More...
 
 ResamplingTrigger (const std::string &species_name)
 Constructor of the ResamplingTrigger class. Reads the resampling trigger parameters from the input file. More...
 
bool triggered (int timestep, amrex::Real global_numparts) const
 A method that returns true if resampling should be done for the considered species at the considered timestep. More...
 
void initialize_global_numcells () const
 A method that initializes the member m_global_numcells. It is only called once (the first time triggered() is called) and is needed because warpx.boxArray(lev) is not yet initialized when the constructor of this class is called. More...
 

Private Attributes

utils::parser::IntervalsParser m_resampling_intervals
 
amrex::Real m_max_avg_ppc = std::numeric_limits<amrex::Real>::max()
 
amrex::Real m_global_numcells = amrex::Real(0.0)
 
bool m_initialized = false
 

Detailed Description

This class is used to determine if resampling should be done at a given timestep for a given species. Specifically resampling is performed if the current timestep is included in the IntervalsParser m_resampling_intervals or if the average number of particles per cell of the considered species exceeds the threshold m_max_avg_ppc.

Constructor & Destructor Documentation

◆ ResamplingTrigger() [1/2]

ResamplingTrigger::ResamplingTrigger ( )
default

Default constructor of the ResamplingTrigger class.

◆ ResamplingTrigger() [2/2]

ResamplingTrigger::ResamplingTrigger ( const std::string &  species_name)

Constructor of the ResamplingTrigger class. Reads the resampling trigger parameters from the input file.

Member Function Documentation

◆ initialize_global_numcells()

void ResamplingTrigger::initialize_global_numcells ( ) const

A method that initializes the member m_global_numcells. It is only called once (the first time triggered() is called) and is needed because warpx.boxArray(lev) is not yet initialized when the constructor of this class is called.

◆ triggered()

bool ResamplingTrigger::triggered ( int  timestep,
amrex::Real  global_numparts 
) const

A method that returns true if resampling should be done for the considered species at the considered timestep.

Parameters
[in]timestepthe current timestep
[in]global_numpartsthe total number of particles of the considered species

Member Data Documentation

◆ m_global_numcells

amrex::Real ResamplingTrigger::m_global_numcells = amrex::Real(0.0)
mutableprivate

◆ m_initialized

bool ResamplingTrigger::m_initialized = false
mutableprivate

◆ m_max_avg_ppc

amrex::Real ResamplingTrigger::m_max_avg_ppc = std::numeric_limits<amrex::Real>::max()
private

◆ m_resampling_intervals

utils::parser::IntervalsParser ResamplingTrigger::m_resampling_intervals
private

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