.Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | List of all members
MDSimulation::PressureGauge Class Reference

PressureGauge.h - pressure gauge class declaration Written by Alexander Bass, modified by Max I. More...

#include <PressureGauge.h>

Public Types

typedef boost::circular_buffer
< TimeSeries > 
BufferType
 

Public Member Functions

 PressureGauge ()
 Default Constructor. More...
 
void AddSample (const double time, const double pressure)
 Add a sample to the pressure gauge. More...
 
double PressureTime () const
 Computes the time of the pressure sample that will be produced by a call to the SampleGauge function. More...
 
double SampleGauge (const double radius)
 Get the pressure at the given time. More...
 
double ComputePressure (const double currentTime, const double radius, const double drdt) const
 Compute the pressure at the given time. More...
 
double ComputeDpdt (const double currentTime, const double radius, const double dpdt) const
 Computes the rate of change of the pressure using the coefficients of the polynomial calculated from the regression.
 
void Serialize (FILE *file, bool save=true)
 Serialize the pressure gauge to disk. More...
 
template<typename Writer >
void Serialize (Writer &pt) const
 
bool IsReady () const
 
bool CanSample () const
 
void SetPressureStats (const double t, const double p, const double dpdt)
 

Detailed Description

PressureGauge.h - pressure gauge class declaration Written by Alexander Bass, modified by Max I.

Fomitchev-Zamilov and Spenser Bauman

Constructor & Destructor Documentation

MDSimulation::PressureGauge::PressureGauge ( )

Default Constructor.

Creates a zeroed pressure gauge.

Member Function Documentation

void MDSimulation::PressureGauge::AddSample ( const double  time,
const double  pressure 
)

Add a sample to the pressure gauge.

Parameters
pressureA sample of the pressure to add to the gauge.
double MDSimulation::PressureGauge::ComputePressure ( const double  currentTime,
const double  radius,
const double  drdt 
) const

Compute the pressure at the given time.

This makes use of the coefficients of the polynomial calculated by the regression.

double MDSimulation::PressureGauge::PressureTime ( ) const

Computes the time of the pressure sample that will be produced by a call to the SampleGauge function.

This is needed before the call, as the time is used to determine the appropriate radius to call SampleGauge with.

double MDSimulation::PressureGauge::SampleGauge ( const double  radius)

Get the pressure at the given time.

This given time value is assumed to be greater than the previous call.

Parameters
currentTimeThe current simulation time in simulation units.
pressureThe location at which the computed pressure is stored.
dpdtThe location at which the computed pressure derivative is stored.
Returns
The time at which the sample is said to occur.
void MDSimulation::PressureGauge::Serialize ( FILE *  file,
bool  save = true 
)

Serialize the pressure gauge to disk.

Parameters
fileThe file to save the pressure gauge to.
saveFlag to control saving vs loading. True saves the file to disk while false causes the Serialize function to read from the given file.

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