24 enum AttributeNames :
int { ptr, id, posX, posY, posZ, forceX, forceY, forceZ, ownershipState };
31 double ,
double ,
double ,
double ,
39 template <AttributeNames attribute, std::enable_if_t<attribute == AttributeNames::ptr,
bool> = true>
40 constexpr typename std::tuple_element<attribute, SoAArraysType>::type::value_type
get() {
50 template <AttributeNames attribute, std::enable_if_t<attribute != AttributeNames::ptr,
bool> = true>
51 constexpr typename std::tuple_element<attribute, SoAArraysType>::type::value_type
get()
const {
52 if constexpr (attribute == AttributeNames::id) {
54 }
else if constexpr (attribute == AttributeNames::posX) {
56 }
else if constexpr (attribute == AttributeNames::posY) {
58 }
else if constexpr (attribute == AttributeNames::posZ) {
60 }
else if constexpr (attribute == AttributeNames::forceX) {
62 }
else if constexpr (attribute == AttributeNames::forceY) {
64 }
else if constexpr (attribute == AttributeNames::forceZ) {
66 }
else if constexpr (attribute == AttributeNames::ownershipState) {
A particle class without an actual constructor (only copy, etc.).
Definition: NonConstructibleParticle.h:14
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 Attrib...
Definition: NonConstructibleParticle.h:51
typename autopas::utils::SoAType< NonConstructibleParticle *, size_t, double, double, double, double, double, double, autopas::OwnershipState >::Type SoAArraysType
The type for the SoA storage.
Definition: NonConstructibleParticle.h:32
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get()
Non-const getter for the pointer of this object.
Definition: NonConstructibleParticle.h:40
AttributeNames
Enums used as ids for accessing and creating a dynamically sized SoA.
Definition: NonConstructibleParticle.h:24
NonConstructibleParticle()=delete
Default constructor is deleted.
Minimal definition of a basic particle.
Definition: ParticleBase.h:33
OwnershipState _ownershipState
Defines the state of the ownership of the particle.
Definition: ParticleBase.h:105
idType getID() const
Get the id of the particle.
Definition: ParticleBase.h:165
const std::array< double, 3 > & getF() const
get the force acting on the particle
Definition: ParticleBase.h:135
const std::array< double, 3 > & getR() const
Get the position of the particle.
Definition: ParticleBase.h:177
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
OwnershipState
Enum that specifies the state of ownership.
Definition: OwnershipState.h:19
Helper struct to get a the SoAType.
Definition: SoAType.h:23