Datatypes¶
A set of simple POD structures.
-
struct
Real3_int
¶ Helper class for packing/unpacking real3 + integer into real4.
Public Functions
-
Real3_int
()¶ defult constructor; NO default values!
-
Real3_int
(real3 vecPart, integer intPart)¶ Constructor from vector and integer.
-
Real3_int
(const real4 r4)¶ Constructor from 4 components vector; the last one will be reinterpreted to integer (not converted)
-
real4
toReal4
() const¶ - Return
- reinterpreted values packed in a real4 (no conversion)
-
void
mark
()¶ Mark this object; see isMarked().
Does not modify the integer part
Public Static Attributes
-
constexpr real
mark_val
= -8.0e10_r¶ A special value used to mark particles.
Marked particles will be deleted during cell list rebuild. For objects, objects with all particles marked will be removed during object redistribution.
-
-
struct
Particle
¶ Structure that holds position, velocity and global index of one particle.
Due to performance reasons it should be aligned to 16 bytes boundary, therefore 8 bytes = 2 integer numbers are extra. The integer fields are used to store the global index
Public Functions
-
Particle
()¶ Default constructor.
Attention
The default constructor DOES NOT initialize any members!
-
void
setId
(int64_t id)¶ Set the global index of the particle.
-
int64_t
getId
() const¶ - Return
- the global index of the particle
-
void
readCoordinate
(const real4 *addr, const int pid)¶ read position from array and stores it internally
- Parameters
addr
: start of the array with size >pid
pid
: particle index
-
void
readVelocity
(const real4 *addr, const int pid)¶ read velocity from array and stores it internally
- Parameters
addr
: pointer to the start of the array. Must be larger thanpid
pid
: particle index
-
void
write2Real4
(real4 *pos, real4 *vel, int pid) const¶ Helps writing particles back to real4 arrays.
- Parameters
pos
: destination array that contains positionsvel
: destination array that contains velocitiespid
: particle index
-
void
mark
()¶ mark the particle; this will erase its position information
-
bool
isMarked
() const¶ - Return
true
if the particle has been marked
-
-
struct
Force
¶ Structure that holds force as real4 (to reduce number of load/store instructions)
Due to performance reasons it should be aligned to 16 bytes boundary. The integer field is not reserved for anything at the moment
-
struct
Stress
¶ Store a symmetric stess tensor in 3 dimensions.
Since it is symmetric, only 6 components are needed (diagonal and upper part
-
struct
COMandExtent
¶ Contains the rigid object center of mass and bounding box Used e.g.
to decide which domain the objects belong to and what particles / cells are close to it
-
struct
ComQ
¶ Contains coordinates of the center of mass and orientation of an object Used to initialize object positions.