|
Peano
|
Represent one type (species) of particles. More...
#include <ParticleSpecies.h>

Public Member Functions | |
| ParticleSpecies () | |
| Initialise all data with the data corresponding to a clear, i.e. | |
| ParticleSpecies (const ParticleSpecies ©)=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 () |
| Clear all the time step sizes and time stamps. | |
| 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 |
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.
The class is completely thread-safe.
Definition at line 33 of file ParticleSpecies.h.
| 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 61 of file ParticleSpecies.h.
|
delete |
| void swift2::ParticleSpecies::allReduce | ( | ) |
Definition at line 234 of file ParticleSpecies.h.
References _maxSearchRadius, _maxTimeStamp, _maxTimeStepSize, _maxVelocity, _minSearchRadius, _minTimeStamp, _minTimeStepSize, _minVelocity, _rerunPreviousGridSweep, tarch::mpi::Rank::allReduce(), tarch::mpi::Rank::getInstance(), tarch::services::ServiceRepository::getInstance(), and tarch::services::ServiceRepository::receiveDanglingMessages().

| 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 119 of file ParticleSpecies.h.
References _rerunPreviousGridSweep.
| void swift2::ParticleSpecies::clearSearchRadius | ( | ) |
Definition at line 205 of file ParticleSpecies.h.
References _maxSearchRadius, and _minSearchRadius.
| void swift2::ParticleSpecies::clearTimeStampAndTimeStepSize | ( | ) |
Clear all the time step sizes and time stamps.
These values then can be reduced again through
before they are actually queried through getMinTimeStepSize() and related routines.
Definition at line 226 of file ParticleSpecies.h.
References _maxTimeStamp, _maxTimeStepSize, _minTimeStamp, and _minTimeStepSize.
| void swift2::ParticleSpecies::clearVelocity | ( | ) |
Definition at line 210 of file ParticleSpecies.h.
References _maxVelocity, and _minVelocity.
| void swift2::ParticleSpecies::finishTimeStep | ( | ) |
This routine is automatically called for each and every species by the GlobalState object.
Definition at line 203 of file ParticleSpecies.h.
| double swift2::ParticleSpecies::getMaxSearchRadius | ( | ) | const |
Definition at line 93 of file ParticleSpecies.h.
References _maxSearchRadius.
| double swift2::ParticleSpecies::getMaxTimeStamp | ( | ) | const |
Definition at line 85 of file ParticleSpecies.h.
References _maxTimeStamp.
| double swift2::ParticleSpecies::getMaxTimeStepSize | ( | ) | const |
Definition at line 77 of file ParticleSpecies.h.
References _maxTimeStepSize.
| double swift2::ParticleSpecies::getMaxVelocity | ( | ) | const |
Definition at line 101 of file ParticleSpecies.h.
References _maxVelocity.
| double swift2::ParticleSpecies::getMinSearchRadius | ( | ) | const |
Definition at line 89 of file ParticleSpecies.h.
References _minSearchRadius.
| double swift2::ParticleSpecies::getMinTimeStamp | ( | ) | const |
Definition at line 81 of file ParticleSpecies.h.
References _minTimeStamp.
| double swift2::ParticleSpecies::getMinTimeStepSize | ( | ) | const |
Definition at line 73 of file ParticleSpecies.h.
References _minTimeStepSize.
| double swift2::ParticleSpecies::getMinVelocity | ( | ) | const |
Definition at line 97 of file ParticleSpecies.h.
References _minVelocity.
| 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 109 of file ParticleSpecies.h.
References _rerunPreviousGridSweep.
| 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 138 of file ParticleSpecies.h.
References _rerunPreviousGridSweep, and _semaphore.
| void swift2::ParticleSpecies::setTimeStamp | ( | double | t, |
| bool | reduceInsteadOfOverwrite = true ) |
Set both min and max time stamp.
Definition at line 146 of file ParticleSpecies.h.
References setTimeStamp().
Referenced by setTimeStamp().


| void swift2::ParticleSpecies::setTimeStamp | ( | double | tMin, |
| double | tMax, | ||
| bool | reduceInsteadOfOverwrite = true ) |
Definition at line 150 of file ParticleSpecies.h.
References _maxTimeStamp, _minTimeStamp, and _semaphore.
| void swift2::ParticleSpecies::setTimeStepSize | ( | double | dt, |
| bool | reduceInsteadOfOverwrite = true ) |
Definition at line 161 of file ParticleSpecies.h.
References setTimeStepSize().
Referenced by setTimeStepSize().


| void swift2::ParticleSpecies::setTimeStepSize | ( | double | dtMin, |
| double | dtMax, | ||
| bool | reduceInsteadOfOverwrite = true ) |
Definition at line 165 of file ParticleSpecies.h.
References _maxTimeStepSize, _minTimeStepSize, and _semaphore.
| 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 183 of file ParticleSpecies.h.
References _maxSearchRadius, _maxVelocity, _minSearchRadius, _minVelocity, _semaphore, and logDebug.
| void swift2::ParticleSpecies::startTimeStep | ( | ) |
This routine is automatically called for each and every species by the GlobalState object.
Definition at line 196 of file ParticleSpecies.h.
|
staticprivate |
Definition at line 35 of file ParticleSpecies.h.
|
private |
Definition at line 45 of file ParticleSpecies.h.
Referenced by allReduce(), clearSearchRadius(), getMaxSearchRadius(), and setVelocity().
|
private |
Definition at line 42 of file ParticleSpecies.h.
Referenced by allReduce(), clearTimeStampAndTimeStepSize(), getMaxTimeStamp(), and setTimeStamp().
|
private |
Definition at line 39 of file ParticleSpecies.h.
Referenced by allReduce(), clearTimeStampAndTimeStepSize(), getMaxTimeStepSize(), and setTimeStepSize().
|
private |
Definition at line 48 of file ParticleSpecies.h.
Referenced by allReduce(), clearVelocity(), getMaxVelocity(), and setVelocity().
|
private |
Definition at line 44 of file ParticleSpecies.h.
Referenced by allReduce(), clearSearchRadius(), getMinSearchRadius(), and setVelocity().
|
private |
Definition at line 41 of file ParticleSpecies.h.
Referenced by allReduce(), clearTimeStampAndTimeStepSize(), getMinTimeStamp(), and setTimeStamp().
|
private |
Definition at line 38 of file ParticleSpecies.h.
Referenced by allReduce(), clearTimeStampAndTimeStepSize(), getMinTimeStepSize(), and setTimeStepSize().
|
private |
Definition at line 47 of file ParticleSpecies.h.
Referenced by allReduce(), clearVelocity(), getMinVelocity(), and setVelocity().
|
private |
Definition at line 50 of file ParticleSpecies.h.
Referenced by allReduce(), clearRerunPreviousGridSweepFlag(), rerunPreviousGridSweep(), and setRerunPreviousGridSweep().
|
staticprivate |
Definition at line 36 of file ParticleSpecies.h.
Referenced by setRerunPreviousGridSweep(), setTimeStamp(), setTimeStepSize(), and setVelocity().