WarpX
Loading...
Searching...
No Matches
Resampling Class Reference

This is a general class used for resampling that is instantiated as a member of MultiParticleContainer. It contains a ResamplingTrigger object used to determine if resampling should be done at a given timestep for a given species and a pointer to a ResamplingAlgorithm object used to carry out the resampling. More...

#include <Resampling.H>

Public Member Functions

 Resampling ()=default
 Default constructor of the Resampling class.
 
 Resampling (const std::string &species_name)
 Constructor of the Resampling class. Reads the chosen resampling algorithm from the input file.
 
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.
 
void operator() (const amrex::Geometry &geom_lev, WarpXParIter &pti, int lev, WarpXParticleContainer *pc) const
 A method that uses the ResamplingAlgorithm object to perform resampling.
 

Private Attributes

ResamplingTrigger m_resampling_trigger
 
std::unique_ptr< ResamplingAlgorithmm_resampling_algorithm
 

Detailed Description

This is a general class used for resampling that is instantiated as a member of MultiParticleContainer. It contains a ResamplingTrigger object used to determine if resampling should be done at a given timestep for a given species and a pointer to a ResamplingAlgorithm object used to carry out the resampling.

Constructor & Destructor Documentation

◆ Resampling() [1/2]

Resampling::Resampling ( )
default

Default constructor of the Resampling class.

◆ Resampling() [2/2]

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

Constructor of the Resampling class. Reads the chosen resampling algorithm from the input file.

Parameters
[in]species_namethe name of the resampled species

Member Function Documentation

◆ operator()()

void Resampling::operator() ( const amrex::Geometry & geom_lev,
WarpXParIter & pti,
int lev,
WarpXParticleContainer * pc ) const

A method that uses the ResamplingAlgorithm object to perform resampling.

Parameters
[in]geom_levthe geometry of the current refinement level.
[in]ptiWarpX particle iterator of the particles to resample.
[in]levthe index of the refinement level.
[in]pca pointer to the particle container.

◆ triggered()

bool Resampling::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_resampling_algorithm

std::unique_ptr<ResamplingAlgorithm> Resampling::m_resampling_algorithm
private

◆ m_resampling_trigger

ResamplingTrigger Resampling::m_resampling_trigger
private

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