OpenMPCD
Public Member Functions | List of all members
OpenMPCD::FlowProfile< T > Class Template Reference

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...
 

Detailed Description

template<typename T>
class OpenMPCD::FlowProfile< T >

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:

Template Parameters
TThe data type.

Definition at line 47 of file FlowProfile.hpp.

Constructor & Destructor Documentation

◆ FlowProfile()

template<typename T >
OpenMPCD::FlowProfile< T >::FlowProfile ( const unsigned int  mpcBoxSizeX,
const unsigned int  mpcBoxSizeY,
const unsigned int  mpcBoxSizeZ,
const Configuration::Setting settings 
)

The constructor.

Parameters
[in]mpcBoxSizeXThe MPC simulation box size along the \( x \) direction.
[in]mpcBoxSizeYThe MPC simulation box size along the \( y \) direction.
[in]mpcBoxSizeZThe MPC simulation box size along the \( z \) direction.
[in]settingsThe settings for this instance.
Exceptions
OpenMPCD::InvalidArgumentExceptionIf OPENMPCD_DEBUG is defined, throws if any of the numerical arguments is 0.
OpenMPCD::InvalidConfigurationExceptionThrows if the configuration is invalid.

Definition at line 13 of file FlowProfile.cpp.

Member Function Documentation

◆ add()

template<typename T >
void OpenMPCD::FlowProfile< T >::add ( const std::size_t  x,
const std::size_t  y,
const std::size_t  z,
const Vector3D< T > &  v 
)
inline

Adds data to the given point.

The coordinates given to this function are the index of the cell and its subdivisions.

Exceptions
OpenMPCD::InvalidCallExceptionIf OPENMPCD_DEBUG is defined, throws if newSweep has not been called before.
OpenMPCD::OutOfBoundsExceptionIf 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.
Parameters
[in]xThe x coordinate of the point.
[in]yThe y coordinate of the point.
[in]zThe z coordinate of the point.
[in]vThe vector to add.

Definition at line 129 of file FlowProfile.hpp.

◆ getCellSubdivisionsX()

template<typename T >
unsigned int OpenMPCD::FlowProfile< T >::getCellSubdivisionsX ( ) const
inline

Returns the number of times collision cells are subdivided along the \( x \) direction.

Definition at line 83 of file FlowProfile.hpp.

◆ getCellSubdivisionsY()

template<typename T >
unsigned int OpenMPCD::FlowProfile< T >::getCellSubdivisionsY ( ) const
inline

Returns the number of times collision cells are subdivided along the \( y \) direction.

Definition at line 92 of file FlowProfile.hpp.

◆ getCellSubdivisionsZ()

template<typename T >
unsigned int OpenMPCD::FlowProfile< T >::getCellSubdivisionsZ ( ) const
inline

Returns the number of times collision cells are subdivided along the \( z \) direction.

Definition at line 101 of file FlowProfile.hpp.

◆ newSweep()

template<typename T >
void OpenMPCD::FlowProfile< T >::newSweep

Signals that a new sweep has begun.

Definition at line 51 of file FlowProfile.cpp.

◆ saveToFile()

template<typename T >
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.

Exceptions
OpenMPCD::IOExceptionThrows on an IO error.
Parameters
[in]pathThe path to save to.

Definition at line 76 of file FlowProfile.cpp.


The documentation for this class was generated from the following files: