31 MoleculeLJ(
const std::array<double, 3> &pos,
const std::array<double, 3> &v,
unsigned long moleculeId,
32 unsigned long typeId = 0);
67 double ,
double ,
double ,
double ,
double ,
68 double ,
double ,
double ,
double ,
76 template <AttributeNames attribute, std::enable_if_t<attribute == AttributeNames::ptr,
bool> = true>
77 constexpr typename std::tuple_element<attribute, SoAArraysType>::type::value_type
get() {
87 template <AttributeNames attribute, std::enable_if_t<attribute != AttributeNames::ptr,
bool> = true>
88 constexpr typename std::tuple_element<attribute, SoAArraysType>::type::value_type
get()
const {
89 if constexpr (attribute == AttributeNames::id) {
91 }
else if constexpr (attribute == AttributeNames::posX) {
93 }
else if constexpr (attribute == AttributeNames::posY) {
95 }
else if constexpr (attribute == AttributeNames::posZ) {
97 }
else if constexpr (attribute == AttributeNames::velocityX) {
99 }
else if constexpr (attribute == AttributeNames::velocityY) {
101 }
else if constexpr (attribute == AttributeNames::velocityZ) {
103 }
else if constexpr (attribute == AttributeNames::forceX) {
105 }
else if constexpr (attribute == AttributeNames::forceY) {
107 }
else if constexpr (attribute == AttributeNames::forceZ) {
109 }
else if constexpr (attribute == AttributeNames::oldForceX) {
111 }
else if constexpr (attribute == AttributeNames::oldForceY) {
113 }
else if constexpr (attribute == AttributeNames::oldForceZ) {
115 }
else if constexpr (attribute == AttributeNames::typeId) {
117 }
else if constexpr (attribute == AttributeNames::ownershipState) {
131 template <AttributeNames attribute>
132 constexpr void set(
typename std::tuple_element<attribute, SoAArraysType>::type::value_type value) {
133 if constexpr (attribute == AttributeNames::id) {
135 }
else if constexpr (attribute == AttributeNames::posX) {
137 }
else if constexpr (attribute == AttributeNames::posY) {
139 }
else if constexpr (attribute == AttributeNames::posZ) {
141 }
else if constexpr (attribute == AttributeNames::velocityX) {
143 }
else if constexpr (attribute == AttributeNames::velocityY) {
145 }
else if constexpr (attribute == AttributeNames::velocityZ) {
147 }
else if constexpr (attribute == AttributeNames::forceX) {
149 }
else if constexpr (attribute == AttributeNames::forceY) {
151 }
else if constexpr (attribute == AttributeNames::forceZ) {
153 }
else if constexpr (attribute == AttributeNames::oldForceX) {
155 }
else if constexpr (attribute == AttributeNames::oldForceY) {
157 }
else if constexpr (attribute == AttributeNames::oldForceZ) {
159 }
else if constexpr (attribute == AttributeNames::typeId) {
161 }
else if constexpr (attribute == AttributeNames::ownershipState) {
172 [[nodiscard]]
const std::array<double, 3> &
getOldF()
const;
178 void setOldF(
const std::array<double, 3> &oldForce);
196 [[nodiscard]] std::string
toString()
const override;
211 std::array<double, 3>
_oldF = {0., 0., 0.};
Minimal definition of a basic particle.
Definition: ParticleBase.h:33
void setID(idType id)
Set the id of the particle.
Definition: ParticleBase.h:171
std::array< floatType, 3 > _r
Particle position as 3D coordinates.
Definition: ParticleBase.h:78
OwnershipState _ownershipState
Defines the state of the ownership of the particle.
Definition: ParticleBase.h:105
std::array< floatType, 3 > _f
Force the particle experiences as 3D vector.
Definition: ParticleBase.h:95
idType getID() const
Get the id of the particle.
Definition: ParticleBase.h:165
const std::array< double, 3 > & getV() const
Get the velocity of the particle.
Definition: ParticleBase.h:265
std::array< floatType, 3 > _v
Particle velocity as 3D vector.
Definition: ParticleBase.h:90
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
Molecule class for the LJFunctor.
Definition: MoleculeLJ.h:20
size_t getTypeId() const
Get TypeId.
Definition: MoleculeLJ.cpp:17
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 AttributeNam...
Definition: MoleculeLJ.h:132
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get()
Non-const getter for the pointer of this object.
Definition: MoleculeLJ.h:77
std::string toString() const override
Creates a string containing all data of the particle.
Definition: MoleculeLJ.cpp:20
typename autopas::utils::SoAType< MoleculeLJ *, size_t, double, double, double, double, double, double, double, double, double, double, double, double, size_t, autopas::OwnershipState >::Type SoAArraysType
The type for the SoA storage.
Definition: MoleculeLJ.h:69
void setOldF(const std::array< double, 3 > &oldForce)
Set old force.
Definition: MoleculeLJ.cpp:15
AttributeNames
Enums used as ids for accessing and creating a dynamically sized SoA.
Definition: MoleculeLJ.h:39
const std::array< double, 3 > & getOldF() const
Get the old force.
Definition: MoleculeLJ.cpp:14
std::array< double, 3 > _oldF
Old Force of the particle experiences as 3D vector.
Definition: MoleculeLJ.h:211
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: MoleculeLJ.h:88
void setTypeId(size_t typeId)
Set the type id of the Molecule.
Definition: MoleculeLJ.cpp:18
size_t _typeId
Molecule type id.
Definition: MoleculeLJ.h:206
OwnershipState
Enum that specifies the state of ownership.
Definition: OwnershipState.h:19
Helper struct to get a the SoAType.
Definition: SoAType.h:23