|
Molecular Dynamics
v0.4
Project for the Practical hosted by the Scientific Computing Chair
|
This class implements the simulation of the particle system. More...
#include <Simulator.h>

Public Member Functions | |
| Simulator ()=delete | |
| Simulator (SimulationSettings &simulationSettings, FileHandler::outputFormat outputFormat) | |
| Constructor to contruct a new simulation evironment. More... | |
| Simulator (DirectSumSimulationParameters ¶meters, std::string &inputFilePath, FileHandler::outputFormat outputFormat, int outputFrequency, std::string &outputFileBaseName) | |
| Legacy constructor to construct a new simulation environment using the direct sum algorithm. More... | |
| void | run (bool benchmark) |
| Run the simulation. More... | |
| void | loadState (std::string &pathToMolecules) |
| Load the state of all molecules from a previous simulation back into this simulation. More... | |
| void | saveState () |
| Export the current state of all molecules to a txt file for using them in a new simulation. More... | |
| ParticleContainer & | getParticles () |
| Get the Particle container of this simulator. More... | |
| unsigned long long | getTotalMoleculeUpdates () const |
Private Attributes | |
| bool | computeProfiles |
| std::unique_ptr< Statistics > | statistics |
| std::array< double, 3 > | domainSize {} |
| std::unique_ptr< Thermostat > | thermostat |
| int | nThermostat |
| bool | useThermostat |
| bool | initialiseSystemWithBrownianMotion |
| bool | applyScalingGradually |
| std::unique_ptr< Force > | force |
| std::unique_ptr< Model > | model |
| double | deltaT |
| double | endT |
| int | outputFrequency |
| std::string | outputFileBaseName |
| unsigned long long | totalMoleculeUpdates |
This class implements the simulation of the particle system.
Using Newton's axioms and the Störmer-Verlet equations force, velocity and position of all particles are computed in fixed discrete time steps. Results are written to files.
|
delete |
| Simulator::Simulator | ( | SimulationSettings & | simulationSettings, |
| FileHandler::outputFormat | outputFormat | ||
| ) |
Constructor to contruct a new simulation evironment.
| simulationSettings | Specify all parameters of the simulation environment. |
| outputFormat | Format of the output files. |
| Simulator::Simulator | ( | DirectSumSimulationParameters & | parameters, |
| std::string & | inputFilePath, | ||
| FileHandler::outputFormat | outputFormat, | ||
| int | outputFrequency, | ||
| std::string & | outputFileBaseName | ||
| ) |
Legacy constructor to construct a new simulation environment using the direct sum algorithm.
| parameters | Simulation parameters for the direct sum model. |
| inputFilePath | Path to the input file which comprises the particles going to be simulated. |
| outputFormat | Format of the output file. Supported formats are vtk and xyz. |
| outputFrequency | Specifies after how much time steps an output file is written. For example an output frequency of 10 means that after each 10 iterations an output file is written. |
| outputFileBaseName | Base name of the output files. |
To create a new simulation environment you have to provide an input file containing the particles you want to simulate.
| ParticleContainer & Simulator::getParticles | ( | ) |
| unsigned long long Simulator::getTotalMoleculeUpdates | ( | ) | const |

| void Simulator::loadState | ( | std::string & | pathToMolecules | ) |
Load the state of all molecules from a previous simulation back into this simulation.
| pathToMolecules | Path pointing to the txt file which stores the state of the molecules. |
| void Simulator::run | ( | bool | benchmark | ) |
Run the simulation.
After configuration of the parameters the simulation can be run calling this method. When no configuration is done before, the default parameters will be used.
| benchmark | Activate or deactivate time measurement |

| void Simulator::saveState | ( | ) |
Export the current state of all molecules to a txt file for using them in a new simulation.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |