23 using idType = size_t;
38 MultisiteMoleculeLJ(std::array<double, 3> r, std::array<double, 3> v, std::array<double, 4> q,
39 std::array<double, 3> angularVel,
unsigned long moleculeId,
unsigned long typeId = 0);
121 template <AttributeNames attribute, std::enable_if_t<attribute == AttributeNames::ptr,
bool> = true>
122 constexpr typename std::tuple_element<attribute, SoAArraysType>::type::value_type
get() {
133 template <AttributeNames attribute, std::enable_if_t<attribute != AttributeNames::ptr,
bool> = true>
134 constexpr typename std::tuple_element<attribute, SoAArraysType>::type::value_type
get()
const {
135 if constexpr (attribute == AttributeNames::id) {
137 }
else if constexpr (attribute == AttributeNames::posX) {
139 }
else if constexpr (attribute == AttributeNames::posY) {
141 }
else if constexpr (attribute == AttributeNames::posZ) {
143 }
else if constexpr (attribute == AttributeNames::velocityX) {
145 }
else if constexpr (attribute == AttributeNames::velocityY) {
147 }
else if constexpr (attribute == AttributeNames::velocityZ) {
149 }
else if constexpr (attribute == AttributeNames::forceX) {
151 }
else if constexpr (attribute == AttributeNames::forceY) {
153 }
else if constexpr (attribute == AttributeNames::forceZ) {
155 }
else if constexpr (attribute == AttributeNames::oldForceX) {
157 }
else if constexpr (attribute == AttributeNames::oldForceY) {
159 }
else if constexpr (attribute == AttributeNames::oldForceZ) {
161 }
else if constexpr (attribute == AttributeNames::quaternion0) {
163 }
else if constexpr (attribute == AttributeNames::quaternion1) {
165 }
else if constexpr (attribute == AttributeNames::quaternion2) {
167 }
else if constexpr (attribute == AttributeNames::quaternion3) {
169 }
else if constexpr (attribute == AttributeNames::angularVelX) {
171 }
else if constexpr (attribute == AttributeNames::angularVelY) {
173 }
else if constexpr (attribute == AttributeNames::angularVelZ) {
175 }
else if constexpr (attribute == AttributeNames::torqueX) {
177 }
else if constexpr (attribute == AttributeNames::torqueY) {
179 }
else if constexpr (attribute == AttributeNames::torqueZ) {
181 }
else if constexpr (attribute == AttributeNames::typeId) {
183 }
else if constexpr (attribute == AttributeNames::ownershipState) {
197 template <AttributeNames attribute>
198 constexpr void set(
typename std::tuple_element<attribute, SoAArraysType>::type::value_type value) {
199 if constexpr (attribute == AttributeNames::id) {
201 }
else if constexpr (attribute == AttributeNames::posX) {
203 }
else if constexpr (attribute == AttributeNames::posY) {
205 }
else if constexpr (attribute == AttributeNames::posZ) {
207 }
else if constexpr (attribute == AttributeNames::velocityX) {
209 }
else if constexpr (attribute == AttributeNames::velocityY) {
211 }
else if constexpr (attribute == AttributeNames::velocityZ) {
213 }
else if constexpr (attribute == AttributeNames::forceX) {
215 }
else if constexpr (attribute == AttributeNames::forceY) {
217 }
else if constexpr (attribute == AttributeNames::forceZ) {
219 }
else if constexpr (attribute == AttributeNames::oldForceX) {
221 }
else if constexpr (attribute == AttributeNames::oldForceY) {
223 }
else if constexpr (attribute == AttributeNames::oldForceZ) {
225 }
else if constexpr (attribute == AttributeNames::quaternion0) {
227 }
else if constexpr (attribute == AttributeNames::quaternion1) {
229 }
else if constexpr (attribute == AttributeNames::quaternion2) {
231 }
else if constexpr (attribute == AttributeNames::quaternion3) {
233 }
else if constexpr (attribute == AttributeNames::angularVelX) {
235 }
else if constexpr (attribute == AttributeNames::angularVelY) {
237 }
else if constexpr (attribute == AttributeNames::angularVelZ) {
239 }
else if constexpr (attribute == AttributeNames::torqueX) {
241 }
else if constexpr (attribute == AttributeNames::torqueY) {
243 }
else if constexpr (attribute == AttributeNames::torqueZ) {
245 }
else if constexpr (attribute == AttributeNames::typeId) {
247 }
else if constexpr (attribute == AttributeNames::ownershipState) {
258 [[nodiscard]]
const std::array<double, 4> &
getQuaternion()
const;
270 [[nodiscard]]
const std::array<double, 3> &
getAngularVel()
const;
288 [[nodiscard]]
const std::array<double, 3> &
getTorque()
const;
294 void setTorque(
const std::array<double, 3> &torque);
300 void addTorque(
const std::array<double, 3> &torque);
306 void subTorque(
const std::array<double, 3> &torque);
312 [[nodiscard]] std::string
toString()
const override;
318 std::array<double, 4>
_q{};
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
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
size_t _typeId
Molecule type id.
Definition: MoleculeLJ.h:206
Standard multi-site LJ molecules.
Definition: MultisiteMoleculeLJ.h:22
std::string toString() const override
Creates a string containing all data of the particle.
Definition: MultisiteMoleculeLJ.cpp:33
void subTorque(const std::array< double, 3 > &torque)
Subracts given torque to the particle's torque.
Definition: MultisiteMoleculeLJ.cpp:29
std::array< double, 3 > _angularVel
Angular velocity of the particle.
Definition: MultisiteMoleculeLJ.h:323
const std::array< double, 3 > & getTorque() const
Get the torque.
Definition: MultisiteMoleculeLJ.cpp:24
void addAngularVel(const std::array< double, 3 > &angularVel)
Adds given angular velocity to the particle's angular velocity.
Definition: MultisiteMoleculeLJ.cpp:20
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: MultisiteMoleculeLJ.h:198
void setTorque(const std::array< double, 3 > &torque)
Set the torque.
Definition: MultisiteMoleculeLJ.cpp:25
void setAngularVel(const std::array< double, 3 > &angularVel)
Set the angular velocity.
Definition: MultisiteMoleculeLJ.cpp:19
std::array< double, 3 > _torque
Torque applied to particle.
Definition: MultisiteMoleculeLJ.h:328
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: MultisiteMoleculeLJ.h:134
~MultisiteMoleculeLJ() override=default
Destructor of the MultisiteMoleculeLJ class.
const std::array< double, 4 > & getQuaternion() const
Get the quaternion defining rotation.
Definition: MultisiteMoleculeLJ.cpp:15
void setQuaternion(const std::array< double, 4 > &q)
Set the quaternion defining rotation.
Definition: MultisiteMoleculeLJ.cpp:16
const std::array< double, 3 > & getAngularVel() const
Get the angular velocity.
Definition: MultisiteMoleculeLJ.cpp:18
AttributeNames
Enums used as ids for accessing and creating a dynamically sized SoA.
Definition: MultisiteMoleculeLJ.h:49
void addTorque(const std::array< double, 3 > &torque)
Adds given torque to the particle's torque.
Definition: MultisiteMoleculeLJ.cpp:26
typename autopas::utils::SoAType< MultisiteMoleculeLJ *, size_t, double, double, double, double, double, double, double, double, double, double, 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: MultisiteMoleculeLJ.h:113
std::array< double, 4 > _q
Rotational direction of particle as quaternion.
Definition: MultisiteMoleculeLJ.h:318
constexpr std::tuple_element< attribute, SoAArraysType >::type::value_type get()
Non-const getter for the pointer of this object.
Definition: MultisiteMoleculeLJ.h:122
OwnershipState
Enum that specifies the state of ownership.
Definition: OwnershipState.h:19
Helper struct to get a the SoAType.
Definition: SoAType.h:23