ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Particle.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include "config/config.hpp"
23
24#include "BondList.hpp"
25#include "PropagationMode.hpp"
26
27#include <utils/Vector.hpp>
30#include <utils/quaternion.hpp>
31
32#include <boost/container/vector.hpp>
33#include <boost/serialization/is_bitwise_serializable.hpp>
34#include <boost/serialization/level.hpp>
35#include <boost/serialization/vector.hpp>
36
37#include <algorithm>
38#include <cassert>
39#include <cstdint>
40#include <vector>
41
42namespace detail {
43inline bool get_nth_bit(uint8_t const bitfield, unsigned int const bit_idx) {
44 return bitfield & (1u << bit_idx);
45}
46} // namespace detail
47
48#ifdef ENGINE
49/** Properties of a self-propelled particle. */
51 /** Imposed constant force. */
52 double f_swim = 0.;
53 /** Is the particle a swimmer. */
54 bool swimming = false;
55 /** Whether f_swim is applied to the particle or to the fluid. */
57
58 template <class Archive> void serialize(Archive &ar, long int /* version */) {
60 }
61};
62#endif
63
64/** Properties of a particle which are not supposed to
65 * change during the integration, but have to be known
66 * for all ghosts. Ghosts are particles which are
67 * needed in the interaction calculation, but are just copies of
68 * particles stored on different nodes.
69 */
71 /** unique identifier for the particle. */
72 int identity = -1;
73 /** Molecule identifier. */
74 int mol_id = 0;
75 /** particle type, used for non-bonded interactions. */
76 int type = 0;
77 /** which propagation schemes should be applied to the particle **/
79
80#ifdef ROTATION
81 /** Bitfield for the particle axes of rotation.
82 * Values:
83 * - 0: no rotation
84 * - 1: allow rotation around the x axis
85 * - 2: allow rotation around the y axis
86 * - 4: allow rotation around the z axis
87 * By default, the particle cannot rotate.
88 */
89 uint8_t rotation = static_cast<uint8_t>(0b000u);
90#else
91 /** Bitfield for the particle axes of rotation. Particle cannot rotate. */
92 static constexpr uint8_t rotation = static_cast<uint8_t>(0b000u);
93#endif
94
95#ifdef EXTERNAL_FORCES
96 /** Flag for fixed particle coordinates.
97 * Values:
98 * - 0: no fixed coordinates
99 * - 1: fix translation along the x axis
100 * - 2: fix translation along the y axis
101 * - 4: fix translation along the z axis
102 */
103 uint8_t ext_flag = static_cast<uint8_t>(0b000u);
104#else // EXTERNAL_FORCES
105 /** Bitfield for fixed particle coordinates. Coordinates cannot be fixed. */
106 static constexpr uint8_t ext_flag = static_cast<uint8_t>(0b000u);
107#endif // EXTERNAL_FORCES
108
109 /** particle mass */
110#ifdef MASS
111 double mass = 1.0;
112#else
113 constexpr static double mass{1.0};
114#endif
115
116 /** rotational inertia */
117#ifdef ROTATIONAL_INERTIA
118 Utils::Vector3d rinertia = {1., 1., 1.};
119#else
120 static constexpr Utils::Vector3d rinertia = {1., 1., 1.};
121#endif
122
123 /** charge. */
124#ifdef ELECTROSTATICS
125 double q = 0.0;
126#else
127 constexpr static double q{0.0};
128#endif
129
130#ifdef LB_ELECTROHYDRODYNAMICS
131 /** electrophoretic mobility times E-field: mu_0 * E */
132 Utils::Vector3d mu_E = {0., 0., 0.};
133#endif
134
135#ifdef DIPOLES
136 /** dipole moment (absolute value) */
137 double dipm = 0.;
138#endif
139
140#ifdef DIPOLE_FIELD_TRACKING
141 /** total dipole field */
142 Utils::Vector3d dip_fld = {0., 0., 0.};
143#endif
144
145#ifdef VIRTUAL_SITES_RELATIVE
146 /** The following properties define, with respect to which real particle a
147 * virtual site is placed and at what distance. The relative orientation of
148 * the vector pointing from real particle to virtual site with respect to the
149 * orientation of the real particle is stored in the virtual site's
150 * quaternion attribute.
151 */
154 double distance = 0.;
155 /** Relative position of the virtual site. */
158 /** Orientation of the virtual particle in the body fixed frame. */
160
161 template <class Archive> void serialize(Archive &ar, long int) {
162 ar & to_particle_id;
163 ar & distance;
164 ar & rel_orientation;
165 ar & quat;
166 }
168#endif // VIRTUAL_SITES_RELATIVE
169
170#ifdef THERMOSTAT_PER_PARTICLE
171/** Friction coefficient for translation */
172#ifndef PARTICLE_ANISOTROPY
173 double gamma = -1.;
174#else
175 Utils::Vector3d gamma = {-1., -1., -1.};
176#endif // PARTICLE_ANISOTROPY
177#ifdef ROTATION
178/** Friction coefficient for rotation */
179#ifndef PARTICLE_ANISOTROPY
180 double gamma_rot = -1.;
181#else
182 Utils::Vector3d gamma_rot = {-1., -1., -1.};
183#endif // PARTICLE_ANISOTROPY
184#endif // ROTATION
185#endif // THERMOSTAT_PER_PARTICLE
186
187#ifdef EXTERNAL_FORCES
188 /** External force. */
190#ifdef ROTATION
191 /** External torque. */
193#endif // ROTATION
194#endif // EXTERNAL_FORCES
195
196#ifdef ENGINE
198#endif
199
200 template <class Archive> void serialize(Archive &ar, long int /* version */) {
201 ar & identity;
202 ar & mol_id;
203 ar & type;
204 ar & propagation;
205
206#ifdef MASS
207 ar & mass;
208#endif
209#ifdef ROTATIONAL_INERTIA
210 ar & rinertia;
211#endif
212#ifdef ROTATION
213 ar & rotation;
214#endif
215#ifdef ELECTROSTATICS
216 ar & q;
217#endif
218
219#ifdef LB_ELECTROHYDRODYNAMICS
220 ar & mu_E;
221#endif
222#ifdef DIPOLES
223 ar & dipm;
224#endif
225#ifdef DIPOLE_FIELD_TRACKING
226 ar & dip_fld;
227#endif
228#ifdef VIRTUAL_SITES_RELATIVE
229 ar & vs_relative;
230#endif
231
232#ifdef THERMOSTAT_PER_PARTICLE
233 ar & gamma;
234#ifdef ROTATION
235 ar & gamma_rot;
236#endif
237#endif // THERMOSTAT_PER_PARTICLE
238#ifdef EXTERNAL_FORCES
239 ar & ext_flag;
240 ar & ext_force;
241#ifdef ROTATION
242 ar & ext_torque;
243#endif
244#endif // EXTERNAL_FORCES
245
246#ifdef ENGINE
247 ar & swim;
248#endif
249 }
250};
251
252/** Positional information on a particle. Information that is
253 * communicated to calculate interactions with ghost particles.
254 */
256 /** periodically folded position. */
257 Utils::Vector3d p = {0., 0., 0.};
258 /** index of the simulation box image where the particle really sits. */
259 Utils::Vector3i i = {0, 0, 0};
260
261#ifdef ROTATION
262 /** quaternion to define particle orientation */
264 /** unit director calculated from the quaternion */
268#endif
269
270#ifdef BOND_CONSTRAINT
271 /** particle position at the previous time step (RATTLE algorithm) */
273#endif
274
275 template <class Archive> void serialize(Archive &ar, long int /* version */) {
276 ar & p;
277 ar & i;
278#ifdef ROTATION
279 ar & quat;
280#endif
281#ifdef BOND_CONSTRAINT
282 ar & p_last_timestep;
283#endif
284 }
285};
286
287/** Force information on a particle. Forces of ghost particles are
288 * collected and added up to the force of the original particle.
289 */
291 ParticleForce() = default;
292 ParticleForce(ParticleForce const &) = default;
295#ifdef ROTATION
298#endif
299
301 ParticleForce const &rhs) {
302#ifdef ROTATION
303 return {lhs.f + rhs.f, lhs.torque + rhs.torque};
304#else
305 return lhs.f + rhs.f;
306#endif
307 }
308
310 return *this = *this + rhs;
311 }
312
313 /** force. */
314 Utils::Vector3d f = {0., 0., 0.};
315
316#ifdef ROTATION
317 /** torque. */
318 Utils::Vector3d torque = {0., 0., 0.};
319#endif
320
321 template <class Archive> void serialize(Archive &ar, long int /* version */) {
322 ar & f;
323#ifdef ROTATION
324 ar & torque;
325#endif
326 }
327};
328
329/** Momentum information on a particle. Information not contained in
330 * communication of ghost particles so far, but a communication would
331 * be necessary for velocity-dependent potentials.
332 */
334 /** velocity. */
335 Utils::Vector3d v = {0., 0., 0.};
336
337#ifdef ROTATION
338 /** angular velocity.
339 * ALWAYS IN PARTICLE FIXED, I.E., CO-ROTATING COORDINATE SYSTEM.
340 */
341 Utils::Vector3d omega = {0., 0., 0.};
342#endif
343
344 template <class Archive> void serialize(Archive &ar, long int /* version */) {
345 ar & v;
346#ifdef ROTATION
347 ar & omega;
348#endif
349 }
350};
351
352/** Information on a particle that is needed only on the
353 * node the particle belongs to.
354 */
356 /** is particle a ghost particle. */
357 bool ghost = false;
358 short int lees_edwards_flag = 0;
359 /** position from the last Verlet list update. */
360 Utils::Vector3d p_old = {0., 0., 0.};
361 /** Accumulated applied Lees-Edwards offset. */
363
364 template <class Archive> void serialize(Archive &ar, long int /* version */) {
365 ar & ghost;
367 ar & p_old;
369 }
370};
371
372#ifdef BOND_CONSTRAINT
374 /** position/velocity correction */
376
378 ParticleRattle const &rhs) {
379 return {lhs.correction + rhs.correction};
380 }
381
383 return *this = *this + rhs;
384 }
385
386 template <class Archive> void serialize(Archive &ar, long int /* version */) {
387 ar & correction;
388 }
389};
390#endif
391
392/** Struct holding all information for one particle. */
393struct Particle { // NOLINT(bugprone-exception-escape)
394private:
400#ifdef BOND_CONSTRAINT
401 ParticleRattle rattle;
402#endif
403 BondList bl;
404#ifdef EXCLUSIONS
405 /** list of particles, with which this particle has no non-bonded
406 * interactions
407 */
409#endif
410
411public:
412 auto const &id() const { return p.identity; }
413 auto &id() { return p.identity; }
414 auto const &mol_id() const { return p.mol_id; }
415 auto &mol_id() { return p.mol_id; }
416 auto const &type() const { return p.type; }
417 auto &type() { return p.type; }
418
419 auto const &propagation() const { return p.propagation; }
420 auto &propagation() { return p.propagation; }
421
422 bool operator==(Particle const &rhs) const { return id() == rhs.id(); }
423
424 bool operator!=(Particle const &rhs) const { return id() != rhs.id(); }
425
426 auto const &bonds() const { return bl; }
427 auto &bonds() { return bl; }
428
429 auto const &pos() const { return r.p; }
430 auto &pos() { return r.p; }
431 auto const &v() const { return m.v; }
432 auto &v() { return m.v; }
433 auto const &force() const { return f.f; }
434 auto &force() { return f.f; }
435 auto const &force_and_torque() const { return f; }
436 auto &force_and_torque() { return f; }
437
438 bool is_ghost() const { return l.ghost; }
439 void set_ghost(bool const ghost_flag) { l.ghost = ghost_flag; }
440 auto &pos_at_last_verlet_update() { return l.p_old; }
441 auto const &pos_at_last_verlet_update() const { return l.p_old; }
442 auto const &image_box() const { return r.i; }
443 auto &image_box() { return r.i; }
444 auto const &lees_edwards_offset() const { return l.lees_edwards_offset; }
446 auto const &lees_edwards_flag() const { return l.lees_edwards_flag; }
448
449#ifdef MASS
450 auto const &mass() const { return p.mass; }
451 auto &mass() { return p.mass; }
452#else
453 constexpr auto &mass() const { return p.mass; }
454#endif
455#ifdef ROTATION
456 auto const &rotation() const { return p.rotation; }
457 auto &rotation() { return p.rotation; }
458 bool can_rotate() const { return static_cast<bool>(p.rotation); }
459 bool can_rotate_around(unsigned int const axis) const {
460 assert(axis <= 2u);
461 return detail::get_nth_bit(p.rotation, axis);
462 }
463 void set_can_rotate_around(unsigned int const axis, bool const rot_flag) {
464 assert(axis <= 2u);
465 if (rot_flag) {
466 p.rotation |= static_cast<uint8_t>(1u << axis);
467 } else {
468 p.rotation &= static_cast<uint8_t>(~(1u << axis));
469 }
470 }
471 void set_can_rotate_all_axes() { p.rotation = static_cast<uint8_t>(0b111u); }
473 p.rotation = static_cast<uint8_t>(0b000u);
474 }
475 auto const &quat() const { return r.quat; }
476 auto &quat() { return r.quat; }
477 auto const &torque() const { return f.torque; }
478 auto &torque() { return f.torque; }
479 auto const &omega() const { return m.omega; }
480 auto &omega() { return m.omega; }
481#ifdef EXTERNAL_FORCES
482 auto const &ext_torque() const { return p.ext_torque; }
483 auto &ext_torque() { return p.ext_torque; }
484#endif // EXTERNAL_FORCES
485 auto calc_director() const { return r.calc_director(); }
486#else // ROTATION
487 auto can_rotate() const { return false; }
488 auto can_rotate_around(unsigned int const axis) const { return false; }
489#endif // ROTATION
490#ifdef DIPOLES
491 auto const &dipm() const { return p.dipm; }
492 auto &dipm() { return p.dipm; }
493 auto calc_dip() const { return calc_director() * dipm(); }
494#endif
495#ifdef DIPOLE_FIELD_TRACKING
496 auto const &dip_fld() const { return p.dip_fld; }
497 auto &dip_fld() { return p.dip_fld; }
498#endif
499#ifdef ROTATIONAL_INERTIA
500 auto const &rinertia() const { return p.rinertia; }
501 auto &rinertia() { return p.rinertia; }
502#else
503 constexpr auto &rinertia() const { return p.rinertia; }
504#endif
505#ifdef ELECTROSTATICS
506 auto const &q() const { return p.q; }
507 auto &q() { return p.q; }
508#else
509 constexpr auto &q() const { return p.q; }
510#endif
511#ifdef LB_ELECTROHYDRODYNAMICS
512 auto const &mu_E() const { return p.mu_E; }
513 auto &mu_E() { return p.mu_E; }
514#endif
515#ifdef VIRTUAL_SITES
521#else
522 constexpr auto is_virtual() const { return false; }
523#endif // VIRTUAL_SITES
524#ifdef VIRTUAL_SITES_RELATIVE
525 auto const &vs_relative() const { return p.vs_relative; }
526 auto &vs_relative() { return p.vs_relative; }
527#endif // VIRTUAL_SITES_RELATIVE
528#ifdef THERMOSTAT_PER_PARTICLE
529 auto const &gamma() const { return p.gamma; }
530 auto &gamma() { return p.gamma; }
531#ifdef ROTATION
532 auto const &gamma_rot() const { return p.gamma_rot; }
533 auto &gamma_rot() { return p.gamma_rot; }
534#endif // ROTATION
535#endif // THERMOSTAT_PER_PARTICLE
536#ifdef EXTERNAL_FORCES
537 auto const &fixed() const { return p.ext_flag; }
538 auto &fixed() { return p.ext_flag; }
539 bool has_fixed_coordinates() const { return static_cast<bool>(p.ext_flag); }
540 bool is_fixed_along(unsigned int const axis) const {
541 assert(axis <= 2u);
542 return detail::get_nth_bit(p.ext_flag, axis);
543 }
544 void set_fixed_along(int const axis, bool const fixed_flag) {
545 // set new flag
546 if (fixed_flag) {
547 p.ext_flag |= static_cast<uint8_t>(1u << axis);
548 } else {
549 p.ext_flag &= static_cast<uint8_t>(~(1u << axis));
550 }
551 }
552 auto const &ext_force() const { return p.ext_force; }
553 auto &ext_force() { return p.ext_force; }
554#else // EXTERNAL_FORCES
555 constexpr bool has_fixed_coordinates() const { return false; }
556 constexpr bool is_fixed_along(unsigned int const) const { return false; }
557#endif // EXTERNAL_FORCES
558#ifdef ENGINE
559 auto const &swimming() const { return p.swim; }
560 auto &swimming() { return p.swim; }
561#endif
562#ifdef BOND_CONSTRAINT
563 auto const &pos_last_time_step() const { return r.p_last_timestep; }
565 auto const &rattle_params() const { return rattle; }
566 auto &rattle_params() { return rattle; }
567 auto const &rattle_correction() const { return rattle.correction; }
568 auto &rattle_correction() { return rattle.correction; }
569#endif
570
571#ifdef EXCLUSIONS
573 Utils::compact_vector<int> const &exclusions() const { return el; }
574 bool has_exclusion(int pid) const {
575 return std::find(el.begin(), el.end(), pid) != el.end();
576 }
577#endif
578
579private:
580 friend boost::serialization::access;
581 template <class Archive> void serialize(Archive &ar, long int /* version */) {
582 ar & p;
583 ar & r;
584 ar & m;
585 ar & f;
586 ar & l;
587 ar & bl;
588#ifdef EXCLUSIONS
589 ar & el;
590#endif
591 }
592};
593
594BOOST_CLASS_IMPLEMENTATION(Particle, object_serializable)
595#ifdef ENGINE
596BOOST_CLASS_IMPLEMENTATION(ParticleParametersSwimming, object_serializable)
597#endif
598BOOST_CLASS_IMPLEMENTATION(ParticleProperties, object_serializable)
599BOOST_CLASS_IMPLEMENTATION(ParticlePosition, object_serializable)
600BOOST_CLASS_IMPLEMENTATION(ParticleMomentum, object_serializable)
601BOOST_CLASS_IMPLEMENTATION(ParticleForce, object_serializable)
602BOOST_CLASS_IMPLEMENTATION(ParticleLocal, object_serializable)
603#ifdef BOND_CONSTRAINT
604BOOST_CLASS_IMPLEMENTATION(ParticleRattle, object_serializable)
605#endif
606#ifdef VIRTUAL_SITES_RELATIVE
607BOOST_CLASS_IMPLEMENTATION(decltype(ParticleProperties::vs_relative),
608 object_serializable)
609#endif
610
611#ifdef ENGINE
612BOOST_IS_BITWISE_SERIALIZABLE(ParticleParametersSwimming)
613#endif
614BOOST_IS_BITWISE_SERIALIZABLE(ParticleProperties)
615BOOST_IS_BITWISE_SERIALIZABLE(ParticlePosition)
616BOOST_IS_BITWISE_SERIALIZABLE(ParticleMomentum)
617BOOST_IS_BITWISE_SERIALIZABLE(ParticleForce)
618BOOST_IS_BITWISE_SERIALIZABLE(ParticleLocal)
619#ifdef BOND_CONSTRAINT
620BOOST_IS_BITWISE_SERIALIZABLE(ParticleRattle)
621#endif
622#ifdef VIRTUAL_SITES_RELATIVE
623BOOST_IS_BITWISE_SERIALIZABLE(decltype(ParticleProperties::vs_relative))
624#endif
Vector implementation and trait types for boost qvm interoperability.
float f[3]
float u[3]
Bond storage.
Definition BondList.hpp:85
Custom vector container optimized for size.
This file contains the defaults for ESPResSo.
Quaternion algebra.
Vector< T, 3 > convert_quaternion_to_director(Quaternion< T > const &quat)
Convert quaternion to director.
Quaternion implementation and trait types for boost qvm interoperability.
Force information on a particle.
Definition Particle.hpp:290
Utils::Vector3d torque
torque.
Definition Particle.hpp:318
ParticleForce(const Utils::Vector3d &f, const Utils::Vector3d &torque)
Definition Particle.hpp:296
void serialize(Archive &ar, long int)
Definition Particle.hpp:321
Utils::Vector3d f
force.
Definition Particle.hpp:314
friend ParticleForce operator+(ParticleForce const &lhs, ParticleForce const &rhs)
Definition Particle.hpp:300
ParticleForce(const Utils::Vector3d &f)
Definition Particle.hpp:294
ParticleForce(ParticleForce const &)=default
ParticleForce()=default
ParticleForce & operator+=(ParticleForce const &rhs)
Definition Particle.hpp:309
ParticleForce & operator=(ParticleForce const &)=default
Information on a particle that is needed only on the node the particle belongs to.
Definition Particle.hpp:355
bool ghost
is particle a ghost particle.
Definition Particle.hpp:357
short int lees_edwards_flag
Definition Particle.hpp:358
void serialize(Archive &ar, long int)
Definition Particle.hpp:364
double lees_edwards_offset
Accumulated applied Lees-Edwards offset.
Definition Particle.hpp:362
Utils::Vector3d p_old
position from the last Verlet list update.
Definition Particle.hpp:360
Momentum information on a particle.
Definition Particle.hpp:333
Utils::Vector3d v
velocity.
Definition Particle.hpp:335
Utils::Vector3d omega
angular velocity.
Definition Particle.hpp:341
void serialize(Archive &ar, long int)
Definition Particle.hpp:344
Properties of a self-propelled particle.
Definition Particle.hpp:50
void serialize(Archive &ar, long int)
Definition Particle.hpp:58
bool swimming
Is the particle a swimmer.
Definition Particle.hpp:54
bool is_engine_force_on_fluid
Whether f_swim is applied to the particle or to the fluid.
Definition Particle.hpp:56
double f_swim
Imposed constant force.
Definition Particle.hpp:52
Positional information on a particle.
Definition Particle.hpp:255
Utils::Vector3d calc_director() const
unit director calculated from the quaternion
Definition Particle.hpp:265
Utils::Quaternion< double > quat
quaternion to define particle orientation
Definition Particle.hpp:263
Utils::Vector3i i
index of the simulation box image where the particle really sits.
Definition Particle.hpp:259
Utils::Vector3d p_last_timestep
particle position at the previous time step (RATTLE algorithm)
Definition Particle.hpp:272
void serialize(Archive &ar, long int)
Definition Particle.hpp:275
Utils::Vector3d p
periodically folded position.
Definition Particle.hpp:257
The following properties define, with respect to which real particle a virtual site is placed and at ...
Definition Particle.hpp:152
Utils::Quaternion< double > rel_orientation
Relative position of the virtual site.
Definition Particle.hpp:156
Utils::Quaternion< double > quat
Orientation of the virtual particle in the body fixed frame.
Definition Particle.hpp:159
Properties of a particle which are not supposed to change during the integration, but have to be know...
Definition Particle.hpp:70
Utils::Vector3d gamma_rot
Friction coefficient for rotation.
Definition Particle.hpp:182
double mass
particle mass
Definition Particle.hpp:111
double dipm
dipole moment (absolute value)
Definition Particle.hpp:137
Utils::Vector3d rinertia
rotational inertia
Definition Particle.hpp:118
ParticleParametersSwimming swim
Definition Particle.hpp:197
int identity
unique identifier for the particle.
Definition Particle.hpp:72
Utils::Vector3d ext_torque
External torque.
Definition Particle.hpp:192
void serialize(Archive &ar, long int)
Definition Particle.hpp:200
Utils::Vector3d ext_force
External force.
Definition Particle.hpp:189
Utils::Vector3d mu_E
electrophoretic mobility times E-field: mu_0 * E
Definition Particle.hpp:132
int mol_id
Molecule identifier.
Definition Particle.hpp:74
Utils::Vector3d dip_fld
total dipole field
Definition Particle.hpp:142
uint8_t ext_flag
Flag for fixed particle coordinates.
Definition Particle.hpp:103
int propagation
which propagation schemes should be applied to the particle
Definition Particle.hpp:78
struct ParticleProperties::VirtualSitesRelativeParameters vs_relative
Utils::Vector3d gamma
Friction coefficient for translation.
Definition Particle.hpp:175
uint8_t rotation
Bitfield for the particle axes of rotation.
Definition Particle.hpp:89
double q
charge.
Definition Particle.hpp:125
int type
particle type, used for non-bonded interactions.
Definition Particle.hpp:76
friend ParticleRattle operator+(ParticleRattle const &lhs, ParticleRattle const &rhs)
Definition Particle.hpp:377
Utils::Vector3d correction
position/velocity correction
Definition Particle.hpp:375
ParticleRattle & operator+=(ParticleRattle const &rhs)
Definition Particle.hpp:382
void serialize(Archive &ar, long int)
Definition Particle.hpp:386
Struct holding all information for one particle.
Definition Particle.hpp:393
auto const & dip_fld() const
Definition Particle.hpp:496
auto & image_box()
Definition Particle.hpp:443
bool has_exclusion(int pid) const
Definition Particle.hpp:574
auto & ext_torque()
Definition Particle.hpp:483
auto const & swimming() const
Definition Particle.hpp:559
auto const & rattle_params() const
Definition Particle.hpp:565
auto & lees_edwards_offset()
Definition Particle.hpp:445
bool can_rotate() const
Definition Particle.hpp:458
auto const & lees_edwards_offset() const
Definition Particle.hpp:444
auto const & propagation() const
Definition Particle.hpp:419
auto & id()
Definition Particle.hpp:413
auto & bonds()
Definition Particle.hpp:427
auto const & rinertia() const
Definition Particle.hpp:500
auto & dip_fld()
Definition Particle.hpp:497
Utils::compact_vector< int > const & exclusions() const
Definition Particle.hpp:573
auto & rinertia()
Definition Particle.hpp:501
auto & rattle_params()
Definition Particle.hpp:566
auto is_virtual() const
Definition Particle.hpp:516
auto const & mass() const
Definition Particle.hpp:450
Utils::compact_vector< int > & exclusions()
Definition Particle.hpp:572
auto & rotation()
Definition Particle.hpp:457
auto & force_and_torque()
Definition Particle.hpp:436
auto const & quat() const
Definition Particle.hpp:475
bool has_fixed_coordinates() const
Definition Particle.hpp:539
auto const & rotation() const
Definition Particle.hpp:456
auto & rattle_correction()
Definition Particle.hpp:568
auto & propagation()
Definition Particle.hpp:420
bool operator==(Particle const &rhs) const
Definition Particle.hpp:422
auto const & vs_relative() const
Definition Particle.hpp:525
auto & vs_relative()
Definition Particle.hpp:526
void set_can_rotate_around(unsigned int const axis, bool const rot_flag)
Definition Particle.hpp:463
auto const & q() const
Definition Particle.hpp:506
auto & gamma_rot()
Definition Particle.hpp:533
auto & dipm()
Definition Particle.hpp:492
auto & pos_at_last_verlet_update()
Definition Particle.hpp:440
auto const & gamma() const
Definition Particle.hpp:529
auto & lees_edwards_flag()
Definition Particle.hpp:447
auto & mu_E()
Definition Particle.hpp:513
void set_ghost(bool const ghost_flag)
Definition Particle.hpp:439
auto const & pos_at_last_verlet_update() const
Definition Particle.hpp:441
auto const & pos_last_time_step() const
Definition Particle.hpp:563
bool can_rotate_around(unsigned int const axis) const
Definition Particle.hpp:459
auto const & gamma_rot() const
Definition Particle.hpp:532
auto const & force_and_torque() const
Definition Particle.hpp:435
auto const & lees_edwards_flag() const
Definition Particle.hpp:446
auto calc_dip() const
Definition Particle.hpp:493
auto const & v() const
Definition Particle.hpp:431
void set_fixed_along(int const axis, bool const fixed_flag)
Definition Particle.hpp:544
auto const & torque() const
Definition Particle.hpp:477
auto & quat()
Definition Particle.hpp:476
auto const & fixed() const
Definition Particle.hpp:537
auto const & ext_force() const
Definition Particle.hpp:552
auto const & omega() const
Definition Particle.hpp:479
auto const & image_box() const
Definition Particle.hpp:442
auto & force()
Definition Particle.hpp:434
auto & v()
Definition Particle.hpp:432
auto const & type() const
Definition Particle.hpp:416
auto const & ext_torque() const
Definition Particle.hpp:482
auto const & bonds() const
Definition Particle.hpp:426
bool is_ghost() const
Definition Particle.hpp:438
auto & mol_id()
Definition Particle.hpp:415
auto & fixed()
Definition Particle.hpp:538
bool operator!=(Particle const &rhs) const
Definition Particle.hpp:424
auto & ext_force()
Definition Particle.hpp:553
auto const & dipm() const
Definition Particle.hpp:491
auto & swimming()
Definition Particle.hpp:560
auto const & mol_id() const
Definition Particle.hpp:414
auto const & pos() const
Definition Particle.hpp:429
auto & pos()
Definition Particle.hpp:430
void set_cannot_rotate_all_axes()
Definition Particle.hpp:472
bool is_fixed_along(unsigned int const axis) const
Definition Particle.hpp:540
auto & type()
Definition Particle.hpp:417
auto & omega()
Definition Particle.hpp:480
auto & gamma()
Definition Particle.hpp:530
void set_can_rotate_all_axes()
Definition Particle.hpp:471
auto & pos_last_time_step()
Definition Particle.hpp:564
auto const & mu_E() const
Definition Particle.hpp:512
auto const & force() const
Definition Particle.hpp:433
auto & q()
Definition Particle.hpp:507
auto const & id() const
Definition Particle.hpp:412
auto const & rattle_correction() const
Definition Particle.hpp:567
auto & mass()
Definition Particle.hpp:451
auto calc_director() const
Definition Particle.hpp:485
auto & torque()
Definition Particle.hpp:478
Quaternion representation.
static Quaternion< T > identity()
Construct an identity quaternion.