In this namespace some helper classes and functions can be found used inside of AutoPas. More...
Namespaces | |
namespace | ArrayMath |
Namespace to handle mathematical operations of std::array. | |
namespace | ArrayUtils |
In this namespace some helper functions for std::array can be found. | |
namespace | AutoPasConfigurationCommunicator |
Provides several functions for handling configurations among mpi ranks. | |
namespace | CompileInfo |
Namespace for functions that provide information about what the code was compiled with. | |
namespace | NumParticlesEstimator |
Functions to estimate numbers of particles. | |
namespace | quaternion |
Array utils specifically for handling quaternions. | |
namespace | StringUtils |
Some functions to parse enums from (input-) strings. | |
namespace | ThreeDimensionalMapping |
Namespace to handle the conversion between one dimensional and three dimensional indices. | |
namespace | TupleUtils |
In this namespace some helper functions for std::tuple can be found. | |
Classes | |
class | ConfigurationAndRankIteratorHandler |
Functionality needed to iterate through ranks and configurations simultaneously in an evenly distributed manner. More... | |
class | DataLayoutConverter |
This converts cells to the target data Layout using the given functor. More... | |
class | EnergySensor |
Measure the energy consumption of a simulation on multiple hardwares. More... | |
class | ExceptionHandler |
Defines and handles the throwing and printing of exceptions. More... | |
struct | is_shared_ptr |
Type trait to determine if a type is a shared pointer at compile time. More... | |
struct | is_shared_ptr< std::shared_ptr< T > > |
True specialization for shared_ptr. More... | |
struct | is_smart_ptr |
Type trait to determine if a type is a smart pointer at compile time. More... | |
struct | is_smart_ptr< std::shared_ptr< T > > |
True specialization for shared_ptr. More... | |
struct | is_smart_ptr< std::unique_ptr< T > > |
True specialization for unique_ptr. More... | |
struct | is_smart_ptr< std::weak_ptr< T > > |
True specialization for weak_ptr. More... | |
struct | is_unique_ptr |
Type trait to determine if a type is a unique pointer at compile time. More... | |
struct | is_unique_ptr< std::unique_ptr< T > > |
True specialization for unique_ptr. More... | |
struct | ParticleTypeTrait |
ParticleTypeTrait class. More... | |
struct | ParticleTypeTrait< autopas::AutoPas< Particle_T > > |
Specialization for the AutoPas class. More... | |
struct | ParticleTypeTrait< std::vector< ParticleCell > > |
Specialization for vectors of ParticleCells. More... | |
class | SoAStorage |
SoAStorage is a helper to access the stored SoA's. More... | |
struct | SoAType |
Helper struct to get a the SoAType. More... | |
class | Timer |
Timer class to stop times. More... | |
Typedefs | |
template<typename FunctorT > | |
using | isPairwiseFunctor = decltype(isPairwiseFunctorImpl(std::declval< FunctorT >())) |
Check whether a Functor Type is inheriting from PairwiseFunctor. | |
template<typename FunctorT > | |
using | isTriwiseFunctor = decltype(isTriwiseFunctorImpl(std::declval< FunctorT >())) |
Check whether a Functor Type is inheriting from TriwiseFunctor. | |
Enumerations | |
enum | ExceptionBehavior { ignore , throwException , printAbort , printCustomAbortFunction } |
Enum that defines the behavior of the expection handling. More... | |
Functions | |
template<typename T > | |
bool | inBox (const std::array< T, 3 > &position, const std::array< T, 3 > &low, const std::array< T, 3 > &high) |
Checks if position is inside of a box defined by low and high. | |
template<typename T > | |
bool | notInBox (const std::array< T, 3 > &position, const std::array< T, 3 > &low, const std::array< T, 3 > &high) |
Checks if position is not inside of a box defined by low and high. | |
template<typename T > | |
bool | boxesOverlap (const std::array< T, 3 > &boxALow, const std::array< T, 3 > &boxAHigh, const std::array< T, 3 > &boxBLow, const std::array< T, 3 > &boxBHigh) |
Checks if two boxes have overlap. | |
template<typename Particle > | |
std::pair< double, double > | calculateHomogeneityAndMaxDensity (const ParticleContainerInterface< Particle > &container) |
Calculates homogeneity and max density of given AutoPas container. | |
template<typename F > | |
decltype(auto) | withStaticBool (bool theBool, F &&func) |
Function to execute the code passed in the lambda with a static bool. | |
template<typename ParticleType , typename F > | |
decltype(auto) | withStaticCellType (autopas::CellType cellType, F &&func) |
Executes the passed function body with the static cell type defined by cellType. | |
In this namespace some helper classes and functions can be found used inside of AutoPas.
These classes reside mostly in the utils directory. However, most commonly used function inside the utils directory might not be in the utils namespace.
using autopas::utils::isPairwiseFunctor = typedef decltype(isPairwiseFunctorImpl(std::declval<FunctorT>())) |
Check whether a Functor Type is inheriting from PairwiseFunctor.
FunctorT |
using autopas::utils::isTriwiseFunctor = typedef decltype(isTriwiseFunctorImpl(std::declval<FunctorT>())) |
Check whether a Functor Type is inheriting from TriwiseFunctor.
FunctorT |
bool autopas::utils::boxesOverlap | ( | const std::array< T, 3 > & | boxALow, |
const std::array< T, 3 > & | boxAHigh, | ||
const std::array< T, 3 > & | boxBLow, | ||
const std::array< T, 3 > & | boxBHigh | ||
) |
Checks if two boxes have overlap.
If the boxes touch (= exact same floating point values), they are not considered to have overlap.
T |
boxALow | |
boxAHigh | |
boxBLow | |
boxBHigh |
std::pair< double, double > autopas::utils::calculateHomogeneityAndMaxDensity | ( | const ParticleContainerInterface< Particle > & | container | ) |
Calculates homogeneity and max density of given AutoPas container.
Both values are computed at once to avoid iterating over the same space twice. homogeneity > 0.0, normally < 1.0, but for extreme scenarios > 1.0 maxDensity > 0.0, normally < 3.0, but for extreme scenarios > 3.0
A homogeneity of 0 describes a perfectly homogeneous scenario, and as the scenario becomes more heterogeneous, this becomes greater. If there are no particles, homogeneity is forced as 0 as this scenario is perfectly homogeneous.
These values are calculated by dividing the container's domain into bins of perfectly equal cuboid shapes.
Not a rigorous proof, but should give an idea:
This is probably still fine for MPI Parallelized Tuning purposes, but be careful with comparing homogeneities and densities.
Particle |
container | container of current simulation |
bool autopas::utils::inBox | ( | const std::array< T, 3 > & | position, |
const std::array< T, 3 > & | low, | ||
const std::array< T, 3 > & | high | ||
) |
Checks if position is inside of a box defined by low and high.
The lower corner is included in, the upper is excluded from the box. i.e. [low[0], high[0]) x [low[1], high[1]) x [low[2], high[2])
T | the type of floating point check |
position | the position that should be checked |
low | the lower corner of the box (inclusive) |
high | the upper corner of the box (exclusive) |
bool autopas::utils::notInBox | ( | const std::array< T, 3 > & | position, |
const std::array< T, 3 > & | low, | ||
const std::array< T, 3 > & | high | ||
) |
Checks if position is not inside of a box defined by low and high.
The lower corner is included in, the upper is excluded from the box. i.e. [low[0], high[0]) x [low[1], high[1]) x [low[2], high[2])
T | the type of floating point check |
position | the position that should be checked |
low | the lower corner of the box (inclusive) |
high | the upper corner of the box (exclusive) |
decltype(auto) autopas::utils::withStaticBool | ( | bool | theBool, |
F && | func | ||
) |
Function to execute the code passed in the lambda with a static bool.
The static value of the boolean will be passed using the first argument of function.
theBool | The bool that should be used statically. |
func | Function to be called, should accept a static bool type, e.g., [&](auto theBool){}; |
decltype(auto) autopas::utils::withStaticCellType | ( | autopas::CellType | cellType, |
F && | func | ||
) |
Executes the passed function body with the static cell type defined by cellType.
ParticleType | The type of the particle, needed to generate a ParticleCell. |
F | The type of the functor. |
cellType | Enum specifying the type of the cell. |
func | Function that takes a ParticleCell as argument. E.g., [&](auto particleCellDummy) {...} . The passed cell will be default constructed and should only be used to infer the type of ParticleCell using decltype(particleCellDummy) . |
c++20 change to explicit template for templates.
function calls also have to be changed to
instead of