Skip to content

Storage for particles #1

@chrisrichardson

Description

@chrisrichardson

On each process, we need some storage for the particle data.
Each particle should have the following:

  • a cell (index) to which is it attached
  • a position
  • some values which it carries

All particles should have the same set of attributes (with different values).

Possible implementations:

struct Particle {
int cell;
Eigen::Vector3d x;
std::vector<double> values;
} Particle;

// Storage of particles
std::vector<Particle> particles;

// Offsets for each value in values
std::vector<int> value_layout;

(looks attractive, but requires new std::vector for each particle)

or

std::vector<int> cell_indices;
std::vector<double> particle_values;
std::vector<int> value_layout;

(should be more efficient).

How should the values be set up? Previously, the first value was always the position. Should there be a method to set up the values (e.g. with string names for debugging?) at construction time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions