Class Particles

Class Documentation

class Particles

Class to store particles data of a single species.

Public Functions

Particles()
Particles(const Particles &other)
Particles(input::InputParticles input_particle)
Particles(int npar)
Particles(int npar, int npar_max)
inline Particles(Particles &&other) noexcept
~Particles()
void AddID(int offset)

Add an integer offset to the particle ID.

Parameters:

offset – Offset to be added

void CleanOut()

Function to clean up particles that are outside of the domain with ParticleStatus::Out status.

inline double *data_double(int i)

Helper function to iterate over double data arrays for HDF5 output.

Currently the index i represents the following data arrays:

i

Data array

Description

0

x

Particle \(x_i\) coordinate

1

y

Particle \(y_i\) coordinate

2

z

Particle \(z_i\) coordinate

3

u

Particle \(v_{x, i}\) velocity

4

v

Particle \(v_{y, i}\) velocity

5

w

Particle \(v_{z, i}\) velocity

Parameters:

i – Index of the data array

Returns:

constexpr double* Pointer to the data array

inline ulong *data_uint32(int i)

Helper function to iterate over ulong data arrays for HDF5 output.

Currently the index i represents the following data arrays:

i

Data array

Description

0

id

Particle ID

1

status

Particle status

Parameters:

i – Index of the data array

Returns:

constexpr ulong* Pointer to the data array

inline Particles &operator=(Particles other)
void pswap(const int i, const int j)

Swap two particles data.

Parameters:
  • i – Index of the first particle

  • j – Index of the second particle

void resize(int new_npar_max)

Resize the size of data arrays.

Parameters:

new_npar_max – New maximum number of particles

Friends

inline friend void swap(Particles &first, Particles &second) noexcept

Function to swap the data between two Particles objects.

This function will swap the data between two Particles objects in-place using std::swap.

Parameters: