AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
sphLib::SPHCalcHydroForceFunctor< Particle_T > Class Template Reference

Class that defines the hydrodynamic force functor. More...

#include <SPHCalcHydroForceFunctor.h>

Inheritance diagram for sphLib::SPHCalcHydroForceFunctor< Particle_T >:
Inheritance graph
[legend]
Collaboration diagram for sphLib::SPHCalcHydroForceFunctor< Particle_T >:
Collaboration graph
[legend]

Public Types

using SoAArraysType = typename Particle_T::SoAArraysType
 soa arrays type
 
- Public Types inherited from autopas::PairwiseFunctor< Particle_T, SPHCalcHydroForceFunctor< Particle_T > >
using SoAArraysType = typename Particle_T::SoAArraysType
 Structure of the SoAs defined by the particle.
 
- Public Types inherited from autopas::Functor< Particle_T, CRTP_T >
using SoAArraysType = typename Particle_T::SoAArraysType
 Structure of the SoAs defined by the particle.
 
using Functor_T = CRTP_T
 Make the Implementation type template publicly available.
 

Public Member Functions

virtual std::string getName () override
 Returns name of functor.
 
bool isRelevantForTuning () override
 Specifies whether the functor should be considered for the auto-tuning process.
 
bool allowsNewton3 () override
 Specifies whether the functor is capable of Newton3-like functors.
 
bool allowsNonNewton3 () override
 Specifies whether the functor is capable of non-Newton3-like functors.
 
void AoSFunctor (Particle_T &i, Particle_T &j, bool newton3=true) override
 Calculates the contribution of the interaction of particle i and j to the hydrodynamic force.
 
void SoAFunctorSingle (autopas::SoAView< SoAArraysType > soa, bool newton3) override
 PairwiseFunctor for structure of arrays (SoA)
 
void SoAFunctorPair (autopas::SoAView< SoAArraysType > soa1, autopas::SoAView< SoAArraysType > soa2, bool newton3) override
 PairwiseFunctor for structure of arrays (SoA)
 
void SoAFunctorVerlet (autopas::SoAView< SoAArraysType > soa, const size_t indexFirst, const std::vector< size_t, autopas::AlignedAllocator< size_t > > &neighborList, bool newton3) override
 PairwiseFunctor for structure of arrays (SoA) for neighbor lists.
 
- Public Member Functions inherited from autopas::PairwiseFunctor< Particle_T, SPHCalcHydroForceFunctor< Particle_T > >
 PairwiseFunctor (double cutoff)
 Constructor.
 
virtual void AoSFunctor (Particle_T &i, Particle_T &j, bool newton3)
 PairwiseFunctor for arrays of structures (AoS).
 
virtual void SoAFunctorSingle (SoAView< SoAArraysType > soa, bool newton3)
 PairwiseFunctor for structure of arrays (SoA)
 
virtual void SoAFunctorVerlet (SoAView< SoAArraysType > soa, const size_t indexFirst, const std::vector< size_t, AlignedAllocator< size_t > > &neighborList, bool newton3)
 PairwiseFunctor for structure of arrays (SoA) for neighbor lists.
 
virtual void SoAFunctorPair (SoAView< SoAArraysType > soa1, SoAView< SoAArraysType > soa2, bool newton3)
 PairwiseFunctor for structure of arrays (SoA)
 
- Public Member Functions inherited from autopas::Functor< Particle_T, CRTP_T >
 Functor (double cutoff)
 Constructor.
 
virtual void initTraversal ()
 This function is called at the start of each traversal.
 
virtual void endTraversal (bool newton3)
 This function is called at the end of each traversal.
 
template<class ParticleCell >
void SoALoader (ParticleCell &cell, SoA< SoAArraysType > &soa, size_t offset, bool skipSoAResize)
 Copies the AoS data of the given cell in the given soa.
 
template<typename ParticleCell >
void SoAExtractor (ParticleCell &cell, SoA< SoAArraysType > &soa, size_t offset)
 Copies the data stored in the soa back into the cell.
 
virtual bool allowsNewton3 ()=0
 Specifies whether the functor is capable of Newton3-like functors.
 
virtual bool allowsNonNewton3 ()=0
 Specifies whether the functor is capable of non-Newton3-like functors.
 
virtual bool isRelevantForTuning ()=0
 Specifies whether the functor should be considered for the auto-tuning process.
 
virtual std::string getName ()=0
 Returns name of functor.
 
double getCutoff () const
 Getter for the functor's cutoff.
 
virtual size_t getNumFLOPs () const
 Get the number of FLOPs.
 
virtual double getHitRate () const
 Get the hit rate.
 

Static Public Member Functions

static constexpr auto getNeededAttr ()
 Get attributes needed for computation.
 
static constexpr auto getNeededAttr (std::false_type)
 Get attributes needed for computation without N3 optimization.
 
static constexpr auto getComputedAttr ()
 Get attributes computed by this functor.
 
- Static Public Member Functions inherited from autopas::Functor< Particle_T, CRTP_T >
static constexpr std::array< typename Particle_T::AttributeNames, 0 > getNeededAttr ()
 Get attributes needed for computation.
 
static constexpr std::array< typename Particle_T::AttributeNames, 0 > getNeededAttr (std::false_type)
 Get attributes needed for computation without N3 optimization.
 
static constexpr std::array< typename Particle_T::AttributeNames, 0 > getComputedAttr ()
 Get attributes computed by this functor.
 

Detailed Description

template<class Particle_T>
class sphLib::SPHCalcHydroForceFunctor< Particle_T >

Class that defines the hydrodynamic force functor.

It is used to calculate the force based on the given SPH kernels.

Template Parameters
Particle_T

Member Function Documentation

◆ allowsNewton3()

template<class Particle_T >
bool sphLib::SPHCalcHydroForceFunctor< Particle_T >::allowsNewton3 ( )
inlineoverridevirtual

Specifies whether the functor is capable of Newton3-like functors.

If the functor provides an interface to soa or aos functions that utilize Newton's third law of motion (actio = reactio) to reduce the computational complexity this function should return true. If this is not the case this function should return false.

Returns
true if and only if this functor provides an interface to Newton3-like functions.

Implements autopas::Functor< Particle_T, CRTP_T >.

◆ allowsNonNewton3()

template<class Particle_T >
bool sphLib::SPHCalcHydroForceFunctor< Particle_T >::allowsNonNewton3 ( )
inlineoverridevirtual

Specifies whether the functor is capable of non-Newton3-like functors.

If the functor provides an interface to soa or aos functions that do not utilize Newton's third law of motion (actio = reactio) this function should return true. If this is not the case this function should return false.

Returns
true if and only if this functor provides an interface to functions that do not utilize Newton3.

Implements autopas::Functor< Particle_T, CRTP_T >.

◆ AoSFunctor()

template<class Particle_T >
void sphLib::SPHCalcHydroForceFunctor< Particle_T >::AoSFunctor ( Particle_T &  i,
Particle_T &  j,
bool  newton3 = true 
)
inlineoverridevirtual

Calculates the contribution of the interaction of particle i and j to the hydrodynamic force.

It is not symmetric, because the smoothing lenghts of the two particles can be different.

Parameters
ifirst particle of the interaction
jsecond particle of the interaction
newton3defines whether or whether not to use newton 3

Reimplemented from autopas::PairwiseFunctor< Particle_T, SPHCalcHydroForceFunctor< Particle_T > >.

◆ getComputedAttr()

template<class Particle_T >
static constexpr auto sphLib::SPHCalcHydroForceFunctor< Particle_T >::getComputedAttr ( )
inlinestaticconstexpr

Get attributes computed by this functor.

Returns
Attributes computed by this functor.
Todo:
C++20: make this function virtual

◆ getName()

template<class Particle_T >
virtual std::string sphLib::SPHCalcHydroForceFunctor< Particle_T >::getName ( )
inlineoverridevirtual

Returns name of functor.

Intended for use with the iteration logger, to differentiate between calls to computeInteractions using different functors in the logs.

Returns
name of functor.

Implements autopas::Functor< Particle_T, CRTP_T >.

◆ getNeededAttr() [1/2]

template<class Particle_T >
static constexpr auto sphLib::SPHCalcHydroForceFunctor< Particle_T >::getNeededAttr ( )
inlinestaticconstexpr

Get attributes needed for computation.

Returns
Attributes needed for computation.
Todo:
C++20: make this function virtual

◆ getNeededAttr() [2/2]

template<class Particle_T >
static constexpr auto sphLib::SPHCalcHydroForceFunctor< Particle_T >::getNeededAttr ( std::false_type  )
inlinestaticconstexpr

Get attributes needed for computation without N3 optimization.

Returns
Attributes needed for computation.
Todo:
C++20: make this function virtual

◆ isRelevantForTuning()

template<class Particle_T >
bool sphLib::SPHCalcHydroForceFunctor< Particle_T >::isRelevantForTuning ( )
inlineoverridevirtual

Specifies whether the functor should be considered for the auto-tuning process.

Returns
true if and only if this functor is relevant for auto-tuning.

Implements autopas::Functor< Particle_T, CRTP_T >.

◆ SoAFunctorPair()

template<class Particle_T >
void sphLib::SPHCalcHydroForceFunctor< Particle_T >::SoAFunctorPair ( autopas::SoAView< SoAArraysType soa1,
autopas::SoAView< SoAArraysType soa2,
bool  newton3 
)
inlineoverridevirtual

PairwiseFunctor for structure of arrays (SoA)

This functor should calculate the forces or any other pair-wise interaction between all particles of soa1 and soa2. This should include a cutoff check if needed!

Parameters
soa1First structure of arrays.
soa2Second structure of arrays.
newton3defines whether or whether not to use newton 3

Reimplemented from autopas::PairwiseFunctor< Particle_T, SPHCalcHydroForceFunctor< Particle_T > >.

◆ SoAFunctorSingle()

template<class Particle_T >
void sphLib::SPHCalcHydroForceFunctor< Particle_T >::SoAFunctorSingle ( autopas::SoAView< SoAArraysType soa,
bool  newton3 
)
inlineoverridevirtual

PairwiseFunctor for structure of arrays (SoA)

This functor should calculate the forces or any other pair-wise interaction between all particles in an soa. This should include a cutoff check if needed!

Parameters
soaStructure of arrays
newton3defines whether or whether not to use newton 3 This functor ignores the newton3 value, as we do not expect any benefit from disabling newton3.

Reimplemented from autopas::PairwiseFunctor< Particle_T, SPHCalcHydroForceFunctor< Particle_T > >.

◆ SoAFunctorVerlet()

template<class Particle_T >
void sphLib::SPHCalcHydroForceFunctor< Particle_T >::SoAFunctorVerlet ( autopas::SoAView< SoAArraysType soa,
const size_t  indexFirst,
const std::vector< size_t, autopas::AlignedAllocator< size_t > > &  neighborList,
bool  newton3 
)
inlineoverridevirtual

PairwiseFunctor for structure of arrays (SoA) for neighbor lists.

This functor should calculate the forces or any other pair-wise interaction between the particle in the SoA with index indexFirst and all particles with indices in the neighborList. This should include a cutoff check if needed!

Parameters
soaStructure of arrays
indexFirstThe index of the first particle for each interaction
neighborListThe list of neighbors
newton3defines whether or whether not to use newton 3

Reimplemented from autopas::PairwiseFunctor< Particle_T, SPHCalcHydroForceFunctor< Particle_T > >.


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