![]() |
.Simulation
|
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) |
PressureGauge.h - pressure gauge class declaration Written by Alexander Bass, modified by Max I.
Fomitchev-Zamilov and Spenser Bauman
MDSimulation::PressureGauge::PressureGauge | ( | ) |
Default Constructor.
Creates a zeroed pressure gauge.
void MDSimulation::PressureGauge::AddSample | ( | const double | time, |
const double | pressure | ||
) |
Add a sample to the pressure gauge.
pressure | A 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.
currentTime | The current simulation time in simulation units. |
pressure | The location at which the computed pressure is stored. |
dpdt | The location at which the computed pressure derivative is stored. |
void MDSimulation::PressureGauge::Serialize | ( | FILE * | file, |
bool | save = true |
||
) |
Serialize the pressure gauge to disk.
file | The file to save the pressure gauge to. |
save | Flag to control saving vs loading. True saves the file to disk while false causes the Serialize function to read from the given file. |