MolSim
Loading...
Searching...
No Matches
FlowSimulationAnalyzer.h
Go to the documentation of this file.
1
9#pragma once
10
11#include "ParticleContainer.h"
12#include <string>
13#include <vector>
14
17 private:
20
23
26
29
31 double binSize;
32
34 std::vector<double> densities;
35
37 std::vector<double> velocities;
38
40 int n_analyzer{1000};
41
43 std::string dirname{"statistics"};
44
51 std::string basename{"MD_csv"};
52
53 public:
60
73 int n_analyzer, const std::string &dirname = "statistics",
74 const std::string &basename = "MD_csv");
75
87 const std::string &dirname = "statistics", const std::string &basename = "MD_csv");
88
97
103 void analyzeFlow(int currentStep);
104
112 int writeToCSV(int fileNumber);
113
119 int getBinNumber() const;
120
126 double getLeftWallPosX() const;
127
133 double getRightWallPosX() const;
134
140 double getBinSize() const;
141
147 int getFrequency() const;
148
154 const std::string &getDirname() const;
155
162
168 const std::vector<double> &getDensities() const;
169
175 const std::vector<double> &getVelocities() const;
176};
Class for encapsulating and iterating over multiple Particle objects.
Class modeling and analyzer that computes statistics about the state of a nano-scale flow simulation.
Definition FlowSimulationAnalyzer.h:16
ParticleContainer & particles
A reference to the Particle system.
Definition FlowSimulationAnalyzer.h:19
std::string dirname
The name of the directory containing the generated .csv files (default: "statistics").
Definition FlowSimulationAnalyzer.h:43
std::vector< double > densities
The vector corresponding to the number of particles in each bin.
Definition FlowSimulationAnalyzer.h:34
FlowSimulationAnalyzer(ParticleContainer &particles)
Constructs an uninitialized FlowSimulationAnalyzer.
ParticleContainer & getParticles() const
Gets a reference to the analyzed ParticleContainer.
double leftWallPosX
The X coordinate of the left wall of the simulation.
Definition FlowSimulationAnalyzer.h:25
double getLeftWallPosX() const
Gets the X coordinate of the left wall of the simulation.
std::string basename
The base name of the generated .csv files (default: "MD_csv").
Definition FlowSimulationAnalyzer.h:51
double getBinSize() const
Gets the size of the bins used in the computation of statistics.
const std::vector< double > & getVelocities() const
Gets the vector containing the the average velocities of the particles from each bin (const).
FlowSimulationAnalyzer(ParticleContainer &particles, int binNumber, double leftWallPosX, double rightWallPosX, int n_analyzer, const std::string &dirname="statistics", const std::string &basename="MD_csv")
Creates and initializes a FlowSimulationAnalyzer.
int getBinNumber() const
Gets the bin number of the analyzer.
void initialize(int binNumber, double leftWallPosX, double rightWallPosX, int n_analyzer, const std::string &dirname="statistics", const std::string &basename="MD_csv")
Initializes the current object with the given parameters.
double rightWallPosX
The X coordinate of the right wall of the simulation.
Definition FlowSimulationAnalyzer.h:28
std::vector< double > velocities
The vector corresponding to the average velocity on the y axis of the particles resided in this bin.
Definition FlowSimulationAnalyzer.h:37
int getFrequency() const
Gets the output frequency.
int binNumber
The number of bins analyzed.
Definition FlowSimulationAnalyzer.h:22
int writeToCSV(int fileNumber)
Writes the gathered information from the density and velocity vectors into the corresponding ....
void calculateDensitiesAndVelocities()
Computes the densities and average velocities of the particles resided in each bin.
const std::vector< double > & getDensities() const
Gets the vector containing the number of particles in each bin (const).
int n_analyzer
The number of simulation iterations after which to apply the Analyzer functionality (default: 1000).
Definition FlowSimulationAnalyzer.h:40
double binSize
The size of each bin analyzed.
Definition FlowSimulationAnalyzer.h:31
double getRightWallPosX() const
Gets the X coordinate of the right wall of the simulation.
const std::string & getDirname() const
Gets the name of the output directory.
void analyzeFlow(int currentStep)
The main function that analyzes the simulation.
Class for encapsulating multiple Particle objects..
Definition ParticleContainer.h:17