32 std::array<double, 3>
g;
99 void addCuboid(
const std::array<double, 3> &position,
unsigned N1,
unsigned N2,
unsigned N3,
double h,
double mass,
100 const std::array<double, 3> &initVelocity,
int dimensions,
double brownianMotionAverageVelocity,
101 double epsilon = 5,
double sigma = 1,
bool fixed =
false);
117 void addDisc(
const std::array<double, 3> ¢er,
118 const std::array<double, 3> &initVelocity,
int N,
double h,
double mass,
int dimensions,
119 double brownianMotionAverageVelocity,
double epsilon = 5,
double sigma = 1,
bool fixed =
false);
135 void addSphere(
const std::array<double, 3> ¢er,
const std::array<double, 3> &initVelocity,
int N,
double h,
136 double mass,
int dimensions,
double brownianMotionAverageVelocity,
double epsilon = 5,
double sigma = 1,
180 virtual void step(
int iteration) = 0;
Class for controling the temperature of the simulated system.
Definition: DefaultThermostat.h:11
Wrapper class for file handling.
Definition: FileHandler.h:19
outputFormat
Supported output formats.
Definition: FileHandler.h:31
inputFormat
Supported input formats.
Definition: FileHandler.h:38
Class for controling the temperature of a flow.
Definition: FlowThermostat.h:12
Interface representing the force that the source exerts on the target.
Definition: Force.h:14
Abstract base class for any model for molecule simulation.
Definition: Model.h:17
void updatePositions() const
Helper method to calculate the position of all particles.
Definition: Model.cpp:33
ParticleContainer & particles
Definition: Model.h:28
FileHandler::outputFormat outputFormat
Definition: Model.h:25
void updateForces() const
Helper method to calculate the force between all particles.
Definition: Model.cpp:14
virtual ~Model()=default
Virtual default constructor to guarantee appropriate memory clean up.
void updateVelocities() const
Helper method to calculate the velocity of all particles.
Definition: Model.cpp:41
void plot(int iteration, std::string &baseName)
Write current state of the model to a file.
Definition: Model.cpp:57
void addDisc(const std::array< double, 3 > ¢er, const std::array< double, 3 > &initVelocity, int N, double h, double mass, int dimensions, double brownianMotionAverageVelocity, double epsilon=5, double sigma=1, bool fixed=false)
Add a 2D disc structure to this model.
Definition: Model.cpp:68
void applyGravity()
Add a gravitational force of g * m along the y-axis to each particle inside the simulation domain.
Definition: Model.cpp:49
std::array< double, 3 > g
Definition: Model.h:32
virtual void step(int iteration)=0
Perform one single step in the simulation.
virtual void initializeForces()=0
Calculate forces at the beginning of the simulation that the old force is not 0.
void addViaFile(std::string &filepath, FileHandler::inputFormat inputFormat)
Add new particles / particle structures to the model via a file.
Definition: Model.cpp:86
bool gravityOn
Definition: Model.h:31
double deltaT
Definition: Model.h:30
void addCuboid(const std::array< double, 3 > &position, unsigned N1, unsigned N2, unsigned N3, double h, double mass, const std::array< double, 3 > &initVelocity, int dimensions, double brownianMotionAverageVelocity, double epsilon=5, double sigma=1, bool fixed=false)
Add a cuboid structure to this model.
Definition: Model.cpp:61
ParticleContainer & getParticles() const
Get the Particles of this model.
Definition: Model.h:189
void addSphere(const std::array< double, 3 > ¢er, const std::array< double, 3 > &initVelocity, int N, double h, double mass, int dimensions, double brownianMotionAverageVelocity, double epsilon=5, double sigma=1, bool fixed=false)
Add a 3D sphere structure to this model.
Definition: Model.cpp:75
void saveState()
Export the current state of all molecules to a txt file for using them in a new simulation.
Definition: Model.cpp:90
Model(ParticleContainer &particles, Force &force, double deltaT, FileHandler::outputFormat outputFormat, bool gravityOn, std::array< double, 3 > g={})
Constructor for this model. Cannot be called from any other class but classes that extend this class,...
Definition: Model.cpp:8
void addParticle(Particle &p)
Add a single particle to this model.
Definition: Model.cpp:82
Force & force
Definition: Model.h:29
FileHandler fileHandler
Definition: Model.h:24
Class corresponding to the N1 schema type.
Definition: ConfigurationFile.h:10343
Class corresponding to the N2 schema type.
Definition: ConfigurationFile.h:10437
Class corresponding to the N3 schema type.
Definition: ConfigurationFile.h:11829
Definition: ParticleContainer.h:11
Definition: Particle.h:16
Base class for controling the temperature of the simulated system.
Definition: Thermostat.h:13
int dimensions
Definition: Thermostat.h:29
Enumeration class corresponding to the force schema type.
Definition: ConfigurationFile.h:6026
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Definition: vtk-unstructured.h:270