kspaceFirstOrder3D-OMP  1.2
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
OutputStreamContainer Class Reference

A container for output streams. More...

#include <OutputStreamContainer.h>

Collaboration diagram for OutputStreamContainer:

Public Types

enum  OutputStreamIdx {
  OutputStreamIdx::kPressureRaw, OutputStreamIdx::kPressureRms, OutputStreamIdx::kPressureMax, OutputStreamIdx::kPressureMin,
  OutputStreamIdx::kPressureMaxAll, OutputStreamIdx::kPressureMinAll, OutputStreamIdx::kVelocityXRaw, OutputStreamIdx::kVelocityYRaw,
  OutputStreamIdx::kVelocityZRaw, OutputStreamIdx::kVelocityXNonStaggeredRaw, OutputStreamIdx::kVelocityYNonStaggeredRaw, OutputStreamIdx::kVelocityZNonStaggeredRaw,
  OutputStreamIdx::kVelocityXRms, OutputStreamIdx::kVelocityYRms, OutputStreamIdx::kVelocityZRms, OutputStreamIdx::kVelocityXMax,
  OutputStreamIdx::kVelocityYMax, OutputStreamIdx::kVelocityZMax, OutputStreamIdx::kVelocityXMin, OutputStreamIdx::kVelocityYMin,
  OutputStreamIdx::kVelocityZMin, OutputStreamIdx::kVelocityXMaxAll, OutputStreamIdx::kVelocityYMaxAll, OutputStreamIdx::kVelocityZMaxAll,
  OutputStreamIdx::kVelocityXMinAll, OutputStreamIdx::kVelocityYMinAll, OutputStreamIdx::kVelocityZMinAll
}
 Output streams identifiers in k-Wave. More...
 

Public Member Functions

 OutputStreamContainer ()
 Constructor. More...
 
 OutputStreamContainer (const OutputStreamContainer &)=delete
 Copy constructor not allowed.
 
 ~OutputStreamContainer ()
 Destructor. More...
 
OutputStreamContaineroperator= (OutputStreamContainer &)=delete
 Operator = not allowed.
 
size_t size () const
 Get size of the container. More...
 
bool empty () const
 Is the container empty? More...
 
BaseOutputStreamoperator[] (const OutputStreamIdx outputStreamIdx)
 operator [] More...
 
void addStreams (MatrixContainer &matrixContainer)
 Add all streams in simulation in the container, set all streams records here! More...
 
void createStreams ()
 Create all streams - opens the datasets. More...
 
void reopenStreams ()
 Reopen streams after checkpoint file (datasets). More...
 
void sampleStreams ()
 Sample all streams. More...
 
void postProcessStreams ()
 Post-process all streams and flush them to the file. More...
 
void checkpointStreams ()
 Checkpoint streams. More...
 
void closeStreams ()
 Close all streams. More...
 
void freeStreams ()
 Free all streams - destroy them. More...
 

Protected Member Functions

BaseOutputStreamcreateOutputStream (MatrixContainer &matrixContainer, const MatrixContainer::MatrixIdx sampledMatrixIdx, const MatrixName &fileObjectName, const BaseOutputStream::ReduceOperator reduceOp, float *bufferToReuse=nullptr)
 Create a new output stream. More...
 

Private Attributes

std::map< OutputStreamIdx, BaseOutputStream * > mContainer
 Map with output streams.
 

Detailed Description

The output stream container maintains matrices used to sample data. These may or may not require some scratch place or reuse temp matrices.

Definition at line 50 of file OutputStreamContainer.h.

Member Enumeration Documentation

◆ OutputStreamIdx

Output streams identifiers in k-Wave.

Enumerator
kPressureRaw 

Pressure time series.

kPressureRms 

RMS of pressure over sensor mask.

kPressureMax 

Max of pressure over sensor mask.

kPressureMin 

Min of pressure over sensor mask.

kPressureMaxAll 

Max of pressure over all domain.

kPressureMinAll 

Min of pressure over all domain.

kVelocityXRaw 

Velocity x time series.

kVelocityYRaw 

Velocity y time series.

kVelocityZRaw 

Velocity z time series.

kVelocityXNonStaggeredRaw 

Non staggered velocity x time series.

kVelocityYNonStaggeredRaw 

Non staggered velocity y time series.

kVelocityZNonStaggeredRaw 

Non staggered velocity z time series.

kVelocityXRms 

RMS of velocity x over sensor mask.

kVelocityYRms 

RMS of velocity y over sensor mask.

kVelocityZRms 

RMS of velocity z over sensor mask.

kVelocityXMax 

Max of velocity x over sensor mask.

kVelocityYMax 

Max of velocity y over sensor mask.

kVelocityZMax 

Max of velocity z over sensor mask.

kVelocityXMin 

Min of velocity x over sensor mask.

kVelocityYMin 

Min of velocity y over sensor mask.

kVelocityZMin 

Min of velocity z over sensor mask.

kVelocityXMaxAll 

Max of velocity x over all domain.

kVelocityYMaxAll 

Max of velocity y over all domain.

kVelocityZMaxAll 

Max of velocity z over all domain.

kVelocityXMinAll 

Min of velocity x over all domain.

kVelocityYMinAll 

Min of velocity y over all domain.

kVelocityZMinAll 

Min of velocity z over all domain.

Definition at line 58 of file OutputStreamContainer.h.

Constructor & Destructor Documentation

◆ OutputStreamContainer()

OutputStreamContainer::OutputStreamContainer ( )

Default constructor.

Definition at line 53 of file OutputStreamContainer.cpp.

◆ ~OutputStreamContainer()

OutputStreamContainer::~OutputStreamContainer ( )

Destructor

Definition at line 64 of file OutputStreamContainer.cpp.

Member Function Documentation

◆ addStreams()

void OutputStreamContainer::addStreams ( MatrixContainer matrixContainer)

Please note, the matrix container has to be populated before calling this routine.

Parameters
[in]matrixContainer- matrix container to link the steams with sampled matrices and sensor masks.

Add all streams in simulation in the container, set all streams records here!

Definition at line 73 of file OutputStreamContainer.cpp.

◆ checkpointStreams()

void OutputStreamContainer::checkpointStreams ( )

Checkpoint streams without post-processing (flush to the file).

Definition at line 261 of file OutputStreamContainer.cpp.

◆ closeStreams()

void OutputStreamContainer::closeStreams ( )

Close all streams (apply post-processing if necessary, flush data and close).

Definition at line 291 of file OutputStreamContainer.cpp.

◆ createOutputStream()

BaseOutputStream * OutputStreamContainer::createOutputStream ( MatrixContainer matrixContainer,
const MatrixContainer::MatrixIdx  sampledMatrixIdx,
const MatrixName fileObjectName,
const BaseOutputStream::ReduceOperator  reduceOp,
float *  bufferToReuse = nullptr 
)
protected
Parameters
[in]matrixContainer- name of the HDF5 dataset or group
[in]sampledMatrixIdx- code id of the matrix
[in]fileObjectName- name of the HDF5 dataset or group
[in]reduceOp- reduction operator
[in]bufferToReuse- buffer to reuse
Returns
New output stream with defined links.

Create a new output stream.

Definition at line 327 of file OutputStreamContainer.cpp.

◆ createStreams()

void OutputStreamContainer::createStreams ( )

Create all streams.

Definition at line 216 of file OutputStreamContainer.cpp.

◆ empty()

bool OutputStreamContainer::empty ( ) const
inline
Returns
true - If the container is empty.

Definition at line 143 of file OutputStreamContainer.h.

◆ freeStreams()

void OutputStreamContainer::freeStreams ( )

Free all streams - destroy them.

Definition at line 306 of file OutputStreamContainer.cpp.

◆ operator[]()

BaseOutputStream& OutputStreamContainer::operator[] ( const OutputStreamIdx  outputStreamIdx)
inline
Parameters
[in]outputStreamIdx- Id of the output stream.
Returns
An element of the container.

Definition at line 153 of file OutputStreamContainer.h.

◆ postProcessStreams()

void OutputStreamContainer::postProcessStreams ( )

Post-process all streams and flush them to the file.

Definition at line 276 of file OutputStreamContainer.cpp.

◆ reopenStreams()

void OutputStreamContainer::reopenStreams ( )

Reopen all streams after restarting from checkpoint.

Definition at line 231 of file OutputStreamContainer.cpp.

◆ sampleStreams()

void OutputStreamContainer::sampleStreams ( )

Sample all streams.

Definition at line 246 of file OutputStreamContainer.cpp.

◆ size()

size_t OutputStreamContainer::size ( ) const
inline
Returns
the size of the container

Definition at line 134 of file OutputStreamContainer.h.


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