OpenMPCD
|
Represents a flow profile. More...
#include <FlowProfile.hpp>
Public Member Functions | |
FlowProfile (const unsigned int mpcBoxSizeX, const unsigned int mpcBoxSizeY, const unsigned int mpcBoxSizeZ, const Configuration::Setting &settings) | |
The constructor. More... | |
unsigned int | getCellSubdivisionsX () const |
Returns the number of times collision cells are subdivided along the \( x \) direction. More... | |
unsigned int | getCellSubdivisionsY () const |
Returns the number of times collision cells are subdivided along the \( y \) direction. More... | |
unsigned int | getCellSubdivisionsZ () const |
Returns the number of times collision cells are subdivided along the \( z \) direction. More... | |
void | add (const std::size_t x, const std::size_t y, const std::size_t z, const Vector3D< T > &v) |
Adds data to the given point. More... | |
void | newSweep () |
Signals that a new sweep has begun. More... | |
void | saveToFile (const std::string &path) const |
Saves the data into a file with the given path. More... | |
Represents a flow profile.
This class can be configured via the instrumentation.flowProfile
configuration group. If it is not present, this class will not be active. Otherwise, the following sub-settings are allowed:
cellSubdivision
may be a group that has three positive integer entries, x
, y
, and z
, which define the resolution of the profile. If, for example, x
has a value of 3
, this means that each collision cell is divided into three regions of equal length along the \( x \) direction, and each region is sampled individually. If cellSubdivision
is not present, the values for cellSubdivision.x
, cellSubdivision.y
, and cellSubdivision.z
default to 1
.sweepCountPerOutput
may be set to a non-negative integer. If the value is greater than 0
, this instance measures the flow field for sweepCountPerOutput
successive sweeps, then computes statistical data (averages, standard deviations) of the flow field as measured during these sweeps, and finally starts a new measurement, disregarding old data. If sweepCountPerOutput
is 0
(the default), all sweeps are measured, and the data taken contributes to the only set of output data.T | The data type. |
Definition at line 47 of file FlowProfile.hpp.
OpenMPCD::FlowProfile< T >::FlowProfile | ( | const unsigned int | mpcBoxSizeX, |
const unsigned int | mpcBoxSizeY, | ||
const unsigned int | mpcBoxSizeZ, | ||
const Configuration::Setting & | settings | ||
) |
The constructor.
[in] | mpcBoxSizeX | The MPC simulation box size along the \( x \) direction. |
[in] | mpcBoxSizeY | The MPC simulation box size along the \( y \) direction. |
[in] | mpcBoxSizeZ | The MPC simulation box size along the \( z \) direction. |
[in] | settings | The settings for this instance. |
OpenMPCD::InvalidArgumentException | If OPENMPCD_DEBUG is defined, throws if any of the numerical arguments is 0 . |
OpenMPCD::InvalidConfigurationException | Throws if the configuration is invalid. |
Definition at line 13 of file FlowProfile.cpp.
|
inline |
Adds data to the given point.
The coordinates given to this function are the index of the cell and its subdivisions.
OpenMPCD::InvalidCallException | If OPENMPCD_DEBUG is defined, throws if newSweep has not been called before. |
OpenMPCD::OutOfBoundsException | If OPENMPCD_DEBUG is defined, throws if x , y , or z are too large, that is, if x >= mpcBoxSizeX * getCellSubdivisionsX() , where mpcBoxSizeX is the size of the simulation box along the \( x \) direction, and analogously for the other coordinates. |
[in] | x | The x coordinate of the point. |
[in] | y | The y coordinate of the point. |
[in] | z | The z coordinate of the point. |
[in] | v | The vector to add. |
Definition at line 129 of file FlowProfile.hpp.
|
inline |
Returns the number of times collision cells are subdivided along the \( x \) direction.
Definition at line 83 of file FlowProfile.hpp.
|
inline |
Returns the number of times collision cells are subdivided along the \( y \) direction.
Definition at line 92 of file FlowProfile.hpp.
|
inline |
Returns the number of times collision cells are subdivided along the \( z \) direction.
Definition at line 101 of file FlowProfile.hpp.
void OpenMPCD::FlowProfile< T >::newSweep |
Signals that a new sweep has begun.
Definition at line 51 of file FlowProfile.cpp.
void OpenMPCD::FlowProfile< T >::saveToFile | ( | const std::string & | path | ) | const |
Saves the data into a file with the given path.
The first line is a comment header that starts with a #
character and contains labels for each of the columns, which are described below.
What follows after this first line is a number of output blocks, where the blocks are separated from one another by blank lines (but there is neither a blank line between the header and the first block, nor between the last block and the end of the file.)
Each block represents a number of sweeps that have been measured in succession. What the block contains are statistical data about this series of sweeps, as described below. The number of sweeps per block is configured in the sweepCountPerOutput
configuration option. The last block of an output file may contain fewer sweeps, if the simulation terminates before an integer multiple of sweepCountPerOutput
could be reached.
Each line in a block represents one point in the flow field. The first three columns are the x, y, and z coordinates of the point, respectively. The next three columns are the means of the x, y, and z coordinates of the velocity. The next three columns are the standard deviations of the x, y, and z coordinates of the velocity. The last column contains the sample sizes.
OpenMPCD::IOException | Throws on an IO error. |
[in] | path | The path to save to. |
Definition at line 76 of file FlowProfile.cpp.