AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
NonConstructibleParticle Class Reference

A particle class without an actual constructor (only copy, etc.). More...

#include <NonConstructibleParticle.h>

Inheritance diagram for NonConstructibleParticle:
Inheritance graph
[legend]
Collaboration diagram for NonConstructibleParticle:
Collaboration graph
[legend]

Public Types

enum  AttributeNames : int {
  ptr , id , posX , posY ,
  posZ , forceX , forceY , forceZ ,
  ownershipState
}
 Enums used as ids for accessing and creating a dynamically sized SoA.
 
using SoAArraysType = typename autopas::utils::SoAType< NonConstructibleParticle *, size_t, double, double, double, double, double, double, autopas::OwnershipState >::Type
 The type for the SoA storage.
 
- Public Types inherited from autopas::ParticleBase< floatType, idType >
enum  AttributeNames : int {
  ptr , id , posX , posY ,
  posZ , forceX , forceY , forceZ ,
  ownershipState
}
 Enums used as ids for accessing and creating a dynamically sized SoA.
 
using ParticleSoAFloatPrecision = floatType
 Floating Point Type used for this particle.
 
using ParticleIdType = idType
 Id Type used for this particle.
 
using SoAArraysType = typename autopas::utils::SoAType< ParticleBase< floatType, idType > *, idType, floatType, floatType, floatType, floatType, floatType, floatType, OwnershipState >::Type
 The type for the soa storage.
 

Public Member Functions

 NonConstructibleParticle ()=delete
 Default constructor is deleted.
 
template<AttributeNames attribute, std::enable_if_t< attribute==AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get ()
 Non-const getter for the pointer of this object.
 
template<AttributeNames attribute, std::enable_if_t< attribute !=AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get () const
 Getter, which allows access to an attribute using the corresponding attribute name (defined in AttributeNames).
 
- Public Member Functions inherited from autopas::ParticleBase< floatType, idType >
 ParticleBase (const std::array< double, 3 > &r, const std::array< double, 3 > &v, idType id, OwnershipState ownershipState=OwnershipState::owned)
 Constructor of the Particle class.
 
virtual ~ParticleBase ()=default
 Destructor of ParticleBase class.
 
bool operator== (const ParticleBase &rhs) const
 Equality operator for ParticleBase class.
 
bool operator!= (const ParticleBase &rhs) const
 Not-Equals operator for ParticleBase class.
 
const std::array< double, 3 > & getF () const
 get the force acting on the particle
 
void setF (const std::array< double, 3 > &f)
 Set the force acting on the particle.
 
void addF (const std::array< double, 3 > &f)
 Add a partial force to the force acting on the particle.
 
void subF (const std::array< double, 3 > &f)
 Substract a partial force from the force acting on the particle.
 
idType getID () const
 Get the id of the particle.
 
void setID (idType id)
 Set the id of the particle.
 
const std::array< double, 3 > & getR () const
 Get the position of the particle.
 
void setR (const std::array< double, 3 > &r)
 Set the position of the particle.
 
bool setRDistanceCheck (const std::array< double, 3 > &r, double maxDistSquared)
 Add a distance vector to the position of the particle and check if the distance between the old and new position is less than a given max distance.
 
void addR (const std::array< double, 3 > &r)
 Add a distance vector to the position of the particle.
 
bool addRDistanceCheck (const std::array< double, 3 > &r, double maxDistSquared)
 Add a distance vector to the position of the particle and check if the distance between the old and new position is less than a given max distance.
 
const std::array< double, 3 > & getV () const
 Get the velocity of the particle.
 
void setV (const std::array< double, 3 > &v)
 Set the velocity of the particle.
 
void addV (const std::array< double, 3 > &v)
 Add a vector to the current velocity of the particle.
 
virtual std::string toString () const
 Creates a string containing all data of the particle.
 
bool isOwned () const
 Defines whether the particle is owned by the current AutoPas object (aka (MPI-)process)
 
bool isHalo () const
 Defines whether the particle is a halo particle, i.e., not owned by the current AutoPas object (aka (MPI-)process)
 
bool isDummy () const
 Returns whether the particle is a dummy particle.
 
OwnershipState getOwnershipState () const
 Returns the particle's ownership state.
 
void setOwnershipState (OwnershipState ownershipState)
 Set the OwnershipState to the given value.
 
template<AttributeNames attribute, std::enable_if_t< attribute==AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get ()
 Non-const getter for the pointer of this object.
 
template<AttributeNames attribute, std::enable_if_t< attribute !=AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get () const
 Getter, which allows access to an attribute using the corresponding attribute name (defined in AttributeNames).
 
template<AttributeNames attribute>
constexpr void set (typename std::tuple_element< attribute, SoAArraysType >::type::value_type value)
 Setter, which allows set an attribute using the corresponding attribute name (defined in AttributeNames).
 

Additional Inherited Members

- Protected Attributes inherited from autopas::ParticleBase< floatType, idType >
std::array< floatType, 3 > _r
 Particle position as 3D coordinates.
 
std::array< floatType, 3 > _v
 Particle velocity as 3D vector.
 
std::array< floatType, 3 > _f
 Force the particle experiences as 3D vector.
 
idType _id
 Particle id.
 
OwnershipState _ownershipState
 Defines the state of the ownership of the particle.
 

Detailed Description

A particle class without an actual constructor (only copy, etc.).

Member Function Documentation

◆ get() [1/2]

template<AttributeNames attribute, std::enable_if_t< attribute==AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type NonConstructibleParticle::get ( )
inlineconstexpr

Non-const getter for the pointer of this object.

Template Parameters
attributeAttribute name.
Returns
this.

◆ get() [2/2]

template<AttributeNames attribute, std::enable_if_t< attribute !=AttributeNames::ptr, bool > = true>
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type NonConstructibleParticle::get ( ) const
inlineconstexpr

Getter, which allows access to an attribute using the corresponding attribute name (defined in AttributeNames).

Template Parameters
attributeAttribute name.
Returns
Value of the requested attribute.
Note
The value of owned is return as floating point number (true = 1.0, false = 0.0).

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