MolSim
Loading...
Searching...
No Matches
Cuboid.h
Go to the documentation of this file.
1
9#pragma once
10
11#include "Cluster.h"
12#include "ParticleContainer.h"
13#include <array>
14#include <string>
15#include <vector>
16
18class Cuboid : public Cluster {
19 private:
21 std::array<size_t, 3> N;
22
24 double k;
25
27 double r_0;
28
30 double fzup;
31
34 std::vector<std::array<int, 3>> specialCases;
35
36 public:
54 Cuboid(ParticleContainer &particles, const std::array<double, 3> &x, const std::array<size_t, 3> &N,
55 const std::array<double, 3> &v, double h, double m, int type = TYPE_DEFAULT,
56 double epsilon = EPSILON_DEFAULT, double sigma = SIGMA_DEFAULT, double k = K_DEFAULT,
57 double r_0 = R0_DEFAULT, double fzup = FZUP_DEFAULT);
58
64 std::array<size_t, 3> &getN();
65
71 const std::array<size_t, 3> &getN() const;
72
80 std::vector<std::array<int, 3>> &getSpecialCases();
81
89 const std::vector<std::array<int, 3>> &getSpecialCases() const;
90
98 bool operator==(const Cuboid &other) const;
99
107 bool operator!=(const Cuboid &other) const;
108
115 void initialize(size_t dimensions = 2) override;
116
123
137 bool specialCase(int x, int y, int z);
138
144 std::string toString() const;
145};
Abstract class for defining clusters of Particle objects.
Class for encapsulating and iterating over multiple Particle objects.
#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
Abstract class which models common information about Particle objects arranged in some cluster.
Definition Cluster.h:14
std::array< double, 3 > v
Starting velocity of the particles in the Cluster (before adding Maxwell-Boltzmann perturbations).
Definition Cluster.h:42
ParticleContainer & particles
Reference to the ParticleContainer object from the Simulation.
Definition Cluster.h:48
double m
Mass of the particles in the Cluster.
Definition Cluster.h:29
std::array< double, 3 > x
Starting coordinate of the Cluster.
Definition Cluster.h:23
double h
Distance between the particles in the Cluster.
Definition Cluster.h:26
double sigma
Distance where the Lennard-Jones potential reaches zero of the particles in the Cluster.
Definition Cluster.h:38
double epsilon
Depth of the potential well of the particles in the Cluster.
Definition Cluster.h:35
Cuboid class storing meta-data about the given cuboids.
Definition Cuboid.h:18
std::string toString() const
Returns a string representation of this Cuboid.
void initializeNeighbours()
Cuboid function for membranes, adds every particle's neighbours to the particle, based on the index i...
std::array< size_t, 3 > N
3D Dimensions of the cuboid.
Definition Cuboid.h:21
bool specialCase(int x, int y, int z)
Determines, whether Particle objects with the given coordinate indices should have a special upward f...
std::array< size_t, 3 > & getN()
Gets the dimensions of this cuboid.
Cuboid(ParticleContainer &particles, const std::array< double, 3 > &x, const std::array< size_t, 3 > &N, const std::array< double, 3 > &v, double h, double m, int type=TYPE_DEFAULT, double epsilon=EPSILON_DEFAULT, double sigma=SIGMA_DEFAULT, double k=K_DEFAULT, double r_0=R0_DEFAULT, double fzup=FZUP_DEFAULT)
Constructs a new Cuboid object with all the needed meta-data.
const std::array< size_t, 3 > & getN() const
Gets the dimensions of this cuboid (const).
double r_0
The average bond length for membrane simulations.
Definition Cuboid.h:27
double k
The stiffness constant for membrane simulations.
Definition Cuboid.h:24
void initialize(size_t dimensions=2) override
Main function of Cuboid class, initializes the particles based on the cuboid meta-data and adds them ...
const std::vector< std::array< int, 3 > > & getSpecialCases() const
Get the vector containing position indices for particles where the constant upward force should be ap...
bool operator!=(const Cuboid &other) const
Overload of the inequality operator for Cuboid objects.
std::vector< std::array< int, 3 > > specialCases
Vector containing position indices for particles where the constant upward force should be applied,...
Definition Cuboid.h:34
bool operator==(const Cuboid &other) const
Overload of the equality operator for Cuboid objects.
double fzup
The constant upward force for membrane simulations.
Definition Cuboid.h:30
std::vector< std::array< int, 3 > > & getSpecialCases()
Get the vector containing position indices for particles where the constant upward force should be ap...
Class for encapsulating multiple Particle objects..
Definition ParticleContainer.h:17
Enumeration class corresponding to the type schema type.
Definition vtk-unstructured.h:2125