Peano 4
Loading...
Searching...
No Matches
swift2::ParticleSpecies Class Reference

Represent one type (species) of particles. More...

#include <ParticleSpecies.h>

Collaboration diagram for swift2::ParticleSpecies:

Public Member Functions

 ParticleSpecies ()
 Initialise all data with the data corresponding to a clear, i.e.
 
 ParticleSpecies (const ParticleSpecies &copy)=delete
 
double getMinTimeStepSize () const
 
double getMaxTimeStepSize () const
 
double getMinTimeStamp () const
 
double getMaxTimeStamp () const
 
double getMinSearchRadius () const
 
double getMaxSearchRadius () const
 
double getMinVelocity () const
 
double getMaxVelocity () const
 
bool rerunPreviousGridSweep () const
 Query species whether the last grid sweep/update sweep has to be repeated.
 
void clearRerunPreviousGridSweepFlag ()
 Set the rerun flag back to false.
 
void setRerunPreviousGridSweep ()
 Tell Peano to run through mesh with same action sets again.
 
void setTimeStamp (double t, bool reduceInsteadOfOverwrite=true)
 Set both min and max time stamp.
 
void setTimeStamp (double tMin, double tMax, bool reduceInsteadOfOverwrite=true)
 
void setTimeStepSize (double dt, bool reduceInsteadOfOverwrite=true)
 
void setTimeStepSize (double dtMin, double dtMax, bool reduceInsteadOfOverwrite=true)
 
void setVelocity (double vMin, double vMax, double rMin, double rMax)
 Set the maximum velocity that has been observed in a cell.
 
void startTimeStep ()
 This routine is automatically called for each and every species by the GlobalState object.
 
void finishTimeStep ()
 This routine is automatically called for each and every species by the GlobalState object.
 
void clearSearchRadius ()
 
void clearVelocity ()
 
void clearTimeStampAndTimeStepSize ()
 
void allReduce ()
 

Private Attributes

double _minTimeStepSize
 
double _maxTimeStepSize
 
double _minTimeStamp
 
double _maxTimeStamp
 
double _minSearchRadius
 
double _maxSearchRadius
 
double _minVelocity
 
double _maxVelocity
 
bool _rerunPreviousGridSweep
 

Static Private Attributes

static tarch::logging::Log _log
 
static tarch::multicore::BooleanSemaphore _semaphore
 

Detailed Description

Represent one type (species) of particles.

Every particle type (class) has a static species, i.e. some data tied to the class rather than each individual object. These species data hold information such as global statistics.

Thread-safety

The class is completely thread-safe.

Definition at line 26 of file ParticleSpecies.h.

Constructor & Destructor Documentation

◆ ParticleSpecies() [1/2]

swift2::ParticleSpecies::ParticleSpecies ( )

Initialise all data with the data corresponding to a clear, i.e.

from where they can be properly reduced. The only exception is the time stamp. Both the maximum and minimum time step are set to zero. If we set the max time stamp to inf, the code would immediately terminate, as it thinks at least one particle has reached the final time stamp.

Definition at line 13 of file ParticleSpecies.cpp.

◆ ParticleSpecies() [2/2]

swift2::ParticleSpecies::ParticleSpecies ( const ParticleSpecies & copy)
delete

Member Function Documentation

◆ allReduce()

◆ clearRerunPreviousGridSweepFlag()

void swift2::ParticleSpecies::clearRerunPreviousGridSweepFlag ( )

Set the rerun flag back to false.

This operation has to be called explicitly in your code, i.e. we do not invoke it automatically. A canonical location to call it is the prepare_traversal_kernel event of the corresponding AlgorithmStep of your species.

Definition at line 45 of file ParticleSpecies.cpp.

◆ clearSearchRadius()

void swift2::ParticleSpecies::clearSearchRadius ( )

Definition at line 88 of file ParticleSpecies.cpp.

◆ clearTimeStampAndTimeStepSize()

void swift2::ParticleSpecies::clearTimeStampAndTimeStepSize ( )

Definition at line 98 of file ParticleSpecies.cpp.

References _maxTimeStamp(), _maxTimeStepSize(), _minTimeStamp(), and _minTimeStepSize().

Here is the call graph for this function:

◆ clearVelocity()

void swift2::ParticleSpecies::clearVelocity ( )

Definition at line 93 of file ParticleSpecies.cpp.

◆ finishTimeStep()

void swift2::ParticleSpecies::finishTimeStep ( )

This routine is automatically called for each and every species by the GlobalState object.

Definition at line 108 of file ParticleSpecies.cpp.

◆ getMaxSearchRadius()

double swift2::ParticleSpecies::getMaxSearchRadius ( ) const

Definition at line 73 of file ParticleSpecies.cpp.

◆ getMaxTimeStamp()

double swift2::ParticleSpecies::getMaxTimeStamp ( ) const

Definition at line 69 of file ParticleSpecies.cpp.

References _maxTimeStamp().

Here is the call graph for this function:

◆ getMaxTimeStepSize()

double swift2::ParticleSpecies::getMaxTimeStepSize ( ) const

Definition at line 65 of file ParticleSpecies.cpp.

References _maxTimeStepSize().

Here is the call graph for this function:

◆ getMaxVelocity()

double swift2::ParticleSpecies::getMaxVelocity ( ) const

Definition at line 77 of file ParticleSpecies.cpp.

◆ getMinSearchRadius()

double swift2::ParticleSpecies::getMinSearchRadius ( ) const

Definition at line 71 of file ParticleSpecies.cpp.

◆ getMinTimeStamp()

double swift2::ParticleSpecies::getMinTimeStamp ( ) const

Definition at line 67 of file ParticleSpecies.cpp.

References _minTimeStamp().

Here is the call graph for this function:

◆ getMinTimeStepSize()

double swift2::ParticleSpecies::getMinTimeStepSize ( ) const

Definition at line 63 of file ParticleSpecies.cpp.

References _minTimeStepSize().

Here is the call graph for this function:

◆ getMinVelocity()

double swift2::ParticleSpecies::getMinVelocity ( ) const

Definition at line 75 of file ParticleSpecies.cpp.

◆ rerunPreviousGridSweep()

bool swift2::ParticleSpecies::rerunPreviousGridSweep ( ) const

Query species whether the last grid sweep/update sweep has to be repeated.

This happens if the search radius changes for example.

Definition at line 43 of file ParticleSpecies.cpp.

◆ setRerunPreviousGridSweep()

void swift2::ParticleSpecies::setRerunPreviousGridSweep ( )

Tell Peano to run through mesh with same action sets again.

This flag tells Swift's main function that the step has not been complete, i.e. it has to rerun the same step again once this mesh traversal has completed. Therefore, the name is setRerunPreviousGridSweep() - by the time this information is evaluated it will be after the mesh sweep.

The flag is not automatically reset at any point. You have to do this manually by calling clearRerunPreviousGridSweepFlag(). Consult the documentation there.

The flag is automatically reduced by allReduce(), i.e. after the mesh traversal, all ranks will know if one rank has requested a rerun for the species.

Definition at line 47 of file ParticleSpecies.cpp.

◆ setTimeStamp() [1/2]

void swift2::ParticleSpecies::setTimeStamp ( double t,
bool reduceInsteadOfOverwrite = true )

Set both min and max time stamp.

Definition at line 24 of file ParticleSpecies.cpp.

◆ setTimeStamp() [2/2]

void swift2::ParticleSpecies::setTimeStamp ( double tMin,
double tMax,
bool reduceInsteadOfOverwrite = true )

Definition at line 28 of file ParticleSpecies.cpp.

References _maxTimeStamp(), and _minTimeStamp().

Here is the call graph for this function:

◆ setTimeStepSize() [1/2]

void swift2::ParticleSpecies::setTimeStepSize ( double dt,
bool reduceInsteadOfOverwrite = true )

Definition at line 39 of file ParticleSpecies.cpp.

◆ setTimeStepSize() [2/2]

void swift2::ParticleSpecies::setTimeStepSize ( double dtMin,
double dtMax,
bool reduceInsteadOfOverwrite = true )

Definition at line 52 of file ParticleSpecies.cpp.

References _maxTimeStepSize(), and _minTimeStepSize().

Here is the call graph for this function:

◆ setVelocity()

void swift2::ParticleSpecies::setVelocity ( double vMin,
double vMax,
double rMin,
double rMax )

Set the maximum velocity that has been observed in a cell.

This routine takes the maximum velocity as observed so far and updates it if value is bigger.

The routine is thread-safe.

Definition at line 79 of file ParticleSpecies.cpp.

References logDebug.

◆ startTimeStep()

void swift2::ParticleSpecies::startTimeStep ( )

This routine is automatically called for each and every species by the GlobalState object.

Definition at line 106 of file ParticleSpecies.cpp.

Field Documentation

◆ _log

tarch::logging::Log swift2::ParticleSpecies::_log
staticprivate

Definition at line 28 of file ParticleSpecies.h.

◆ _maxSearchRadius

double swift2::ParticleSpecies::_maxSearchRadius
private

Definition at line 38 of file ParticleSpecies.h.

◆ _maxTimeStamp

double swift2::ParticleSpecies::_maxTimeStamp
private

Definition at line 35 of file ParticleSpecies.h.

◆ _maxTimeStepSize

double swift2::ParticleSpecies::_maxTimeStepSize
private

Definition at line 32 of file ParticleSpecies.h.

◆ _maxVelocity

double swift2::ParticleSpecies::_maxVelocity
private

Definition at line 41 of file ParticleSpecies.h.

◆ _minSearchRadius

double swift2::ParticleSpecies::_minSearchRadius
private

Definition at line 37 of file ParticleSpecies.h.

◆ _minTimeStamp

double swift2::ParticleSpecies::_minTimeStamp
private

Definition at line 34 of file ParticleSpecies.h.

◆ _minTimeStepSize

double swift2::ParticleSpecies::_minTimeStepSize
private

Definition at line 31 of file ParticleSpecies.h.

◆ _minVelocity

double swift2::ParticleSpecies::_minVelocity
private

Definition at line 40 of file ParticleSpecies.h.

◆ _rerunPreviousGridSweep

bool swift2::ParticleSpecies::_rerunPreviousGridSweep
private

Definition at line 43 of file ParticleSpecies.h.

◆ _semaphore

tarch::multicore::BooleanSemaphore swift2::ParticleSpecies::_semaphore
staticprivate

Definition at line 29 of file ParticleSpecies.h.


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