33 ContainerType::iterator
begin();
37 ContainerType::iterator
end();
42 ContainerType::const_iterator
begin()
const;
47 ContainerType::const_iterator
end()
const;
70 PairIterator(ContainerType::iterator outer, ContainerType::iterator inner, ContainerType::iterator
begin,
71 ContainerType::iterator
end);
78 std::pair<Particle &, Particle &>
operator*()
const;
196 void addParticle(
const std::array<double, 3> &x,
const std::array<double, 3> &v,
const std::array<double, 3> &f,
197 const std::array<double, 3> &old_f,
double m,
int type,
double eps,
double sigma,
double k,
198 double r_0,
double fzup,
int cellIndex);
Model of a single particle.
#define TYPE_DEFAULT
Definition Particle.h:18
#define K_DEFAULT
Definition Particle.h:21
#define FZUP_DEFAULT
Definition Particle.h:23
#define EPSILON_DEFAULT
Definition Particle.h:20
#define R0_DEFAULT
Definition Particle.h:22
#define SIGMA_DEFAULT
Definition Particle.h:19
Custom pair iterator for iterating through all possible pairs of Particle objects.
Definition ParticleContainer.h:50
std::pair< Particle &, Particle & > operator*() const
Override of the * operator, returning a pair of Particles.
PairIterator(ContainerType::iterator outer, ContainerType::iterator inner, ContainerType::iterator begin, ContainerType::iterator end)
Construct a new Pair Iterator.
bool operator!=(const PairIterator &other) const
Checks if two iterator instances do not point to the same Particle pair.
ContainerType::iterator container_begin
A standard library iterator marking the beginning of the iteration.
Definition ParticleContainer.h:57
ContainerType::iterator container_end
A standard library iterator marking the end of the iteration.
Definition ParticleContainer.h:59
PairIterator & operator++()
Override of the ++ operator.
ContainerType::iterator inner_it
A standard library iterator for iterating through the inner pairs.
Definition ParticleContainer.h:55
ContainerType::iterator outer_it
A standard library iterator for iterating through the outer pairs.
Definition ParticleContainer.h:53
bool operator==(const PairIterator &other) const
Checks if two iterator instances point to the same Particle pair.
Class for encapsulating multiple Particle objects..
Definition ParticleContainer.h:17
virtual ~ParticleContainer()
Destroys the ParticleContainer object.
void addParticle(const Particle &particle)
Adds an already existing Particle to the container.
bool operator==(const ParticleContainer &other) const
Overload of the equality operator. Checks if two ParticleContainers have the same Particle objects.
ParticleContainer(size_t num_particles)
Constructs a ParticleContainer with an empty ContainerType and reserves space for num_particle Partic...
bool isEmpty() const
Checks if the container is empty.
ContainerType::iterator end()
Standard library iterator function for marking the end of the iteration process.
void decrementSpecialForceLimit()
Decrements the number of iterations after which the special upward force will no longer be applied by...
ContainerType m_particles
A ContainerType storing multiple Particle objects, forming the base of this class.
Definition ParticleContainer.h:23
Particle & get(size_t index)
Gets a Particle by index. Performs bounds checking and terminates on invalid index.
size_t size() const
Returns the size of the container.
ContainerType & getParticles()
Gets a reference to the inner Particle container.
const Particle & get(size_t index) const
Gets a const Particle by index. Performs bounds checking and terminates on invalid index.
PairIterator endPairs()
Function marking the end of the pair iteration process.
void addParticle(const std::array< double, 3 > &x, const std::array< double, 3 > &v, double m, int type=TYPE_DEFAULT, double eps=EPSILON_DEFAULT, double sigma=SIGMA_DEFAULT, double k=K_DEFAULT, double r_0=R0_DEFAULT, double fzup=FZUP_DEFAULT)
Creates and adds a new particle to the container.
void addParticle(const std::array< double, 3 > &x, const std::array< double, 3 > &v, const std::array< double, 3 > &f, const std::array< double, 3 > &old_f, double m, int type, double eps, double sigma, double k, double r_0, double fzup, int cellIndex)
Creates and adds a new complete particle to the container.
ContainerType::const_iterator end() const
Standard library iterator function for marking the end of the iteration process of a const ParticleCo...
ParticleContainer()
Constructs a ParticleContainer with an empty default-initialized ContainerType.
size_t nonWallSize() const
Returns the amount of active, mobile, non-wall particles in the container.
int getSpecialForceLimit() const
Gets the number of iterations after which the special upward force will no longer be applied.
size_t activeSize() const
Returns the amount of active particles in the container.
const Particle & operator[](size_t index) const
Override of the [] operator (const).
int m_specialForceLimit
The number of iterations after which the special upward force will no longer be applied,...
Definition ParticleContainer.h:27
Particle & operator[](size_t index)
Override of the [] operator.
void reserve(size_t capacity)
Reserves a certain amount of spaces inside the Particle vector.
std::vector< Particle > ContainerType
The chosen data type for storing Particle objects dynamically and contiguously is a std::vector.
Definition ParticleContainer.h:19
void setSpecialForceLimit(int limit)
Sets the number of iterations after which the special upward force will no longer be applied.
ContainerType::iterator begin()
Standard library iterator function for marking the beginning of the iteration process.
bool operator!=(const ParticleContainer &other) const
Overload of the inequality operator. Checks if two ParticleContainers have the at least one differing...
std::string toString() const
Returns a string representation of this container.
PairIterator beginPairs()
Function marking the beginning of the pair iteration process.
ContainerType::const_iterator begin() const
Standard library iterator function for marking the beginning of the iteration process of a const Part...
Particle class modeling a particle's position, velocity, force, mass and type.
Definition Particle.h:46
Enumeration class corresponding to the type schema type.
Definition vtk-unstructured.h:2125