A class to hold parameters of a run for simulation purposes. More...
#include "us_simparms.h"
Classes | |
class | SpeedProfile |
Each distinct RPM value in a series of speeds. More... | |
Public Types | |
enum | MeshType { ASTFEM, CLAVERIE, MOVING_HAT, USER, ASTFVM } |
The type of mesh used internally for the simulation. More... | |
enum | GridType { FIXED, MOVING } |
For a simulation, specify the grid type. More... | |
Public Member Functions | |
US_SimulationParameters () | |
void | initFromData (US_DB2 *, US_DataIO::RawData &, bool=true, QString="", QString="") |
A function to update the simulation parameters to match an experiment's raw data. More... | |
void | initFromData (US_DB2 *, US_DataIO::EditedData &, bool=true) |
A function to update the simulation parameters to match an experiment's edited data. More... | |
void | setHardware (US_DB2 *=NULL, QString="0", int=0, int=0) |
Read hardware files to update bottom and rotor coefficients array. More... | |
void | setHardware (QString="0", int=0, int=0) |
Read hardware files to update bottom and rotor coefficients array. More... | |
int | load_simparms (QString) |
Load simulation parameters from an xml file. More... | |
int | save_simparms (QString) |
Save simulation parameters into an xml file. More... | |
void | debug (void) |
Dump class contents to stderr. More... | |
Static Public Member Functions | |
static int | get_simparms (US_SimulationParameters &, QString) |
Static function to load simulation parameters from an xml file. More... | |
static int | put_simparms (US_SimulationParameters &, QString) |
Static function to save simulation parameters into an xml file. More... | |
static int | readSpeedSteps (QString, QString, QVector< SpeedProfile > &) |
A function to read speed steps from runID file. More... | |
static void | computeSpeedSteps (QVector< US_DataIO::Scan > *, QVector< SpeedProfile > &) |
A function to compute speed steps from data scans. More... | |
static void | speedstepFromXml (QXmlStreamReader &, SpeedProfile &) |
Static function to get a speed step profile from an xml portion. More... | |
static void | speedstepToXml (QXmlStreamWriter &, SpeedProfile *) |
Static function to write a speed step profile to an xml portion. More... | |
static int | speedstepsFromDB (US_DB2 *, int, QVector< SpeedProfile > &) |
Static function to get all speed steps for an experiment from DB. More... | |
static int | speedstepToDB (US_DB2 *, int, SpeedProfile *) |
Static function to write a speed step profile to an xml portion. More... | |
Public Attributes | |
QVector< double > | mesh_radius |
The radii from a user-selected mesh file (mesh == USER) More... | |
QVector< SpeedProfile > | speed_step |
Specifics for each rpm value in the simulation. More... | |
int | simpoints |
number of radial grid points used in sim More... | |
MeshType | meshType |
Type of radial grid. More... | |
GridType | gridType |
Designation if grid is fixed or can move. More... | |
double | radial_resolution |
double | meniscus |
double | bottom |
Bottom of cell position with rotor stretch. More... | |
double | temperature |
Temperature in degrees centigrade. More... | |
double | rnoise |
Random noise. More... | |
double | tinoise |
Time invariant noise. More... | |
double | rinoise |
Radially invariant noise. More... | |
bool | band_forming |
True for band-forming centerpieces. More... | |
double | band_volume |
double | bottom_position |
Bottom at rest from centerpiece,channel. More... | |
QString | rotorCalID |
Rotor calibration identifier in DB/XML. More... | |
double | rotorcoeffs [2] |
Rotor coefficients for stretch calculation. More... | |
bool | firstScanIsConcentration |
First sedimentation scan is initializer for concentration. More... | |
int | cp_sector |
Shape of centerpiece (0-4: see US_Hardware) More... | |
double | cp_pathlen |
Pathlength of centerpiece. More... | |
double | cp_angle |
Angle of centerpiece sector. More... | |
double | cp_width |
Width of centerpiece channel if rectangular. More... | |
A class to hold parameters of a run for simulation purposes.
Definition at line 12 of file us_simparms.h.
For a simulation, specify the grid type.
Enumerator | |
---|---|
FIXED | |
MOVING |
Definition at line 20 of file us_simparms.h.
The type of mesh used internally for the simulation.
Enumerator | |
---|---|
ASTFEM | |
CLAVERIE | |
MOVING_HAT | |
USER | |
ASTFVM |
Definition at line 17 of file us_simparms.h.
US_SimulationParameters::US_SimulationParameters | ( | ) |
Definition at line 13 of file us_simparms.cpp.
|
static |
A function to compute speed steps from data scans.
scans | Pointer to vector of data scans |
speedsteps | Returned vector of speed step profiles |
Definition at line 434 of file us_simparms.cpp.
void US_SimulationParameters::debug | ( | void | ) |
Dump class contents to stderr.
Definition at line 1011 of file us_simparms.cpp.
|
static |
Static function to load simulation parameters from an xml file.
sparms | Reference to simulation parameters object to load |
fname | Full path name of file from which to load simulation parameters; name part in "sp_*.xml" form. |
Definition at line 814 of file us_simparms.cpp.
void US_SimulationParameters::initFromData | ( | US_DB2 * | db, |
US_DataIO::RawData & | rawdata, | ||
bool | incl_speed = true , |
||
QString | runID = "" , |
||
QString | dataType = "" |
||
) |
A function to update the simulation parameters to match an experiment's raw data.
db | Pointer to opened database connection or NULL |
rawdata | Data structure of raw data that contains run info. |
incl_speed | Flag to include speed steps in update |
runID | Run ID string |
dataType | Data type string ("RA", "RI", ...) |
Definition at line 65 of file us_simparms.cpp.
void US_SimulationParameters::initFromData | ( | US_DB2 * | db, |
US_DataIO::EditedData & | editdata, | ||
bool | incl_speed = true |
||
) |
A function to update the simulation parameters to match an experiment's edited data.
db | Pointer to opened database connection or NULL |
editdata | Data structure of edited data that contains run info. |
incl_speed | Flag to include speed steps in update |
Definition at line 230 of file us_simparms.cpp.
int US_SimulationParameters::load_simparms | ( | QString | fname | ) |
Load simulation parameters from an xml file.
fname | Full path name of file from which to load simulation parameters; name part in "sp_*.xml" form. |
Definition at line 605 of file us_simparms.cpp.
|
static |
Static function to save simulation parameters into an xml file.
sparms | Reference to simulation parameters object to save |
fname | Full path name of file to which to save simulation parameters; name part usually in "sp_*.xml" form. |
Definition at line 821 of file us_simparms.cpp.
|
static |
A function to read speed steps from runID file.
runID | Run ID string |
dataType | Data type string (e.g., "RI") |
speedsteps | Returned vector of speed step profiles |
Definition at line 396 of file us_simparms.cpp.
int US_SimulationParameters::save_simparms | ( | QString | fname | ) |
Save simulation parameters into an xml file.
fname | Full path name of file to which to save simulation parameters; name part usually in "sp_*.xml" form. |
Definition at line 730 of file us_simparms.cpp.
void US_SimulationParameters::setHardware | ( | US_DB2 * | db = NULL , |
QString | rCalID = "0" , |
||
int | cp = 0 , |
||
int | ch = 0 |
||
) |
Read hardware files to update bottom and rotor coefficients array.
db | Pointer to opened database connection or NULL |
rCalID | New rotor calibration identifier to set and use for coefficients (default = "0") |
cp | Centerpiece index (default = 0) |
ch | Index to channel in centerpiece (default = 0) |
Definition at line 543 of file us_simparms.cpp.
void US_SimulationParameters::setHardware | ( | QString | rCalID = "0" , |
int | cp = 0 , |
||
int | ch = 0 |
||
) |
Read hardware files to update bottom and rotor coefficients array.
rCalID | New rotor calibration identifier to set and use for coefficients (default = "0") |
cp | Centerpiece index (default = 0) |
ch | Index to channel in centerpiece (default = 0) |
Definition at line 599 of file us_simparms.cpp.
|
static |
Static function to get a speed step profile from an xml portion.
xmli | Reference to xml stream from which to read |
spo | Reference to speed profile to populate |
Definition at line 828 of file us_simparms.cpp.
|
static |
Static function to get all speed steps for an experiment from DB.
dbP | Pointer to opened database connection |
expID | ID of experiment for which to fetch speed steps |
sps | Reference to vector of speed profiles to populate |
Definition at line 929 of file us_simparms.cpp.
|
static |
Static function to write a speed step profile to an xml portion.
dbP | Pointer to opened database connection |
expID | ID of experiment for which to upload a speed step |
spi | Pointer to speed profile to upload to the database |
Definition at line 973 of file us_simparms.cpp.
|
static |
Static function to write a speed step profile to an xml portion.
xmlo | Reference to xml stream to which to write |
spi | Pointer to speed profile to represent in xml |
Definition at line 885 of file us_simparms.cpp.
bool US_SimulationParameters::band_forming |
True for band-forming centerpieces.
Definition at line 151 of file us_simparms.h.
double US_SimulationParameters::band_volume |
Loading volume (of lamella) in a
Band-forming centerpiece
Definition at line 152 of file us_simparms.h.
double US_SimulationParameters::bottom |
Bottom of cell position with rotor stretch.
Definition at line 146 of file us_simparms.h.
double US_SimulationParameters::bottom_position |
Bottom at rest from centerpiece,channel.
Definition at line 154 of file us_simparms.h.
double US_SimulationParameters::cp_angle |
Angle of centerpiece sector.
Definition at line 163 of file us_simparms.h.
double US_SimulationParameters::cp_pathlen |
Pathlength of centerpiece.
Definition at line 162 of file us_simparms.h.
int US_SimulationParameters::cp_sector |
Shape of centerpiece (0-4: see US_Hardware)
Definition at line 161 of file us_simparms.h.
double US_SimulationParameters::cp_width |
Width of centerpiece channel if rectangular.
Definition at line 164 of file us_simparms.h.
bool US_SimulationParameters::firstScanIsConcentration |
First sedimentation scan is initializer for concentration.
Definition at line 159 of file us_simparms.h.
GridType US_SimulationParameters::gridType |
Designation if grid is fixed or can move.
Definition at line 139 of file us_simparms.h.
double US_SimulationParameters::meniscus |
Meniscus position at first constant speed
For multiple speeds, the user must measure the meniscus at the first constant speed and use that to initialize the routine
Definition at line 142 of file us_simparms.h.
QVector< double > US_SimulationParameters::mesh_radius |
The radii from a user-selected mesh file (mesh == USER)
Note: the radius points of c0 do not have to match the radii in the mesh file. The radius values of the c0 vector will be interpolated onto whatever mesh the user has selected. however, the first and last point of either the c0 or mesh_radius should match the meniscus, otherwise they will be ignored or interpolated to the actual meniscus and bottom position set by the user, which will take precedence.
Definition at line 127 of file us_simparms.h.
MeshType US_SimulationParameters::meshType |
Type of radial grid.
Definition at line 138 of file us_simparms.h.
double US_SimulationParameters::radial_resolution |
The radial datapoint increment/resolution
of the final data
Definition at line 140 of file us_simparms.h.
double US_SimulationParameters::rinoise |
Radially invariant noise.
Definition at line 150 of file us_simparms.h.
double US_SimulationParameters::rnoise |
Random noise.
Definition at line 148 of file us_simparms.h.
QString US_SimulationParameters::rotorCalID |
Rotor calibration identifier in DB/XML.
Definition at line 155 of file us_simparms.h.
double US_SimulationParameters::rotorcoeffs[2] |
Rotor coefficients for stretch calculation.
Definition at line 156 of file us_simparms.h.
int US_SimulationParameters::simpoints |
number of radial grid points used in sim
Definition at line 137 of file us_simparms.h.
QVector< SpeedProfile > US_SimulationParameters::speed_step |
Specifics for each rpm value in the simulation.
Definition at line 135 of file us_simparms.h.
double US_SimulationParameters::temperature |
Temperature in degrees centigrade.
Definition at line 147 of file us_simparms.h.
double US_SimulationParameters::tinoise |
Time invariant noise.
Definition at line 149 of file us_simparms.h.