CalculateManager Class Reference
Class which splits calculation tasks over several threads for processing and handles the gathering of results.
More...
List of all members.
Signals |
void | simulationProgressed (int percent) |
void | simulationError (QString errorMsg) |
void | finished () |
void | terminated () |
Public Member Functions |
| CalculateManager (QWidget *parent, int simulationId, Data *data, FrictionFunctions *frictionFunctions, CalculateFunctions *calculateFunctions, bool useMinimumHoldupCriterion, unsigned int resolution, unsigned int threads=1, scale_t scaleType=SCALE_LIN, double tolerance=0.0000001, QString calculationName="") |
| CalculateManager (QWidget *parent, int simulationId, Data *data, FrictionFunctions *frictionFunctions, RegimeTransitionInterface *regimeTransitionPlugin, CalculateFunctions *calculateFunctions, unsigned int resolution, unsigned int threads=1, scale_t scaleType=SCALE_LIN, double tolerance=0.0000001, QString calculationName="") |
| ~CalculateManager () |
void | run () |
void | quit () |
bool | isRunning () |
bool | isFinished () |
bool | isTerminated () |
int | simulationID () |
const Data * | data () |
std::vector< double > | diameterGasList () |
std::vector< double > | xList () |
std::vector< double > | yList () |
std::vector< double > | holdupList () |
std::vector< double > | alphaList () |
std::vector< double > | dpdxList () |
int | progress () |
QString | calculationName () |
QString | pluginName () |
QString | xVariableName () |
double | xVariableMin () |
double | xVariableMax () |
Private Slots |
void | on_calculateFlowThreadFinished () |
void | on_calculateRegimeTransitionThreadFinished () |
void | on_simulationError (QString errorMsg) |
Private Member Functions |
void | generateXList (std::vector< double > &xList) |
Private Attributes |
QWidget * | _parent |
int | _simulationId |
Data * | _data |
FrictionFunctions * | _frictionFunctions |
CalculateFunctions * | _calculateFunctions |
RegimeTransitionInterface * | _regimeTransitionPlugin |
bool | _isFinished |
bool | _isTerminated |
bool | _isTerminating |
bool | _isRunning |
bool | _useMinimumHoldupCriterion |
int | _progress |
std::vector
< CalculateFlowThread * > | _ctVector |
CalculateFlowThread * | _ct |
int | _nThreadsLeft |
variable_t | _variableWhat |
unsigned int | _resolution |
unsigned int | _threads |
scale_t | _scaleType |
double | _tolerance |
QString | _calculationName |
QString | _pluginName |
QStringList | errorMsgs |
unsigned int | _finishedSimulations |
unsigned int | _simulationsStarted |
std::vector< double > | _diameterGasList |
std::vector< double > | _xList |
std::vector< double > | _yList |
std::vector< double > | _holdupList |
std::vector< double > | _alphaList |
std::vector< double > | _dpdxList |
Detailed Description
Class which splits calculation tasks over several threads for processing and handles the gathering of results.
Constructor & Destructor Documentation
CalculateManager::CalculateManager |
( |
QWidget * |
parent, |
|
|
int |
simulationId, |
|
|
Data * |
data, |
|
|
FrictionFunctions * |
frictionFunctions, |
|
|
CalculateFunctions * |
calculateFunctions, |
|
|
bool |
useMinimumHoldupCriterion, |
|
|
unsigned int |
resolution, |
|
|
unsigned int |
threads = 1 , |
|
|
scale_t |
scaleType = SCALE_LIN , |
|
|
double |
tolerance = 0.0000001 , |
|
|
QString |
calculationName = "" | |
|
) |
| | |
Constructor that creates the all calculation thread and readies for simulation
- Parameters:
-
| parent | Pointer to parent (owner) |
| simulationId | Identification number of simulation |
| data | Flow data |
| frictionFunctions | Pointer to class with pointer to friction functions |
| calculateFunctions | Pointer to class with pointers to calculate functions |
| useMinimumHoldupCriterion | Should the calculation use the minimum holdup criterion or simply calculate for the selected regime |
| resolution | How many points to calculate |
| threads | Number of threads to run simultaneously |
| scaleType | What type of scale_t for x value intervals to use |
| tolerance | Numeric tolerance |
| calculationName | Name of calculation, used for plotting |
CalculateManager::CalculateManager |
( |
QWidget * |
parent, |
|
|
int |
simulationId, |
|
|
Data * |
data, |
|
|
FrictionFunctions * |
frictionFunctions, |
|
|
RegimeTransitionInterface * |
regimeTransitionPlugin, |
|
|
CalculateFunctions * |
calculateFunctions, |
|
|
unsigned int |
resolution, |
|
|
unsigned int |
threads = 1 , |
|
|
scale_t |
scaleType = SCALE_LIN , |
|
|
double |
tolerance = 0.0000001 , |
|
|
QString |
calculationName = "" | |
|
) |
| | |
CalculateManager::~CalculateManager |
( |
|
) |
|
Member Function Documentation
std::vector< double > CalculateManager::alphaList |
( |
|
) |
|
Returns vector of doubles containing alpha values for all variables
QString CalculateManager::calculationName |
( |
|
) |
|
const Data* CalculateManager::data |
( |
|
) |
[inline] |
Returns const pointer to data used in simulation
std::vector< double > CalculateManager::diameterGasList |
( |
|
) |
|
Returns vector of doubles containing hydraulic diameters for all variables
std::vector< double > CalculateManager::dpdxList |
( |
|
) |
|
Returns vector of doubles containing pressure loss values for all variables
void CalculateManager::finished |
( |
|
) |
[signal] |
void CalculateManager::generateXList |
( |
std::vector< double > & |
xList |
) |
[private] |
std::vector< double > CalculateManager::holdupList |
( |
|
) |
|
Returns vector of doubles containing holdup for all variables
bool CalculateManager::isFinished |
( |
|
) |
[inline] |
Returns true if simulation is finished
bool CalculateManager::isRunning |
( |
|
) |
[inline] |
Returns true if simulation is currently running
bool CalculateManager::isTerminated |
( |
|
) |
[inline] |
Returns true if simulation is/was terminated
void CalculateManager::on_calculateFlowThreadFinished |
( |
|
) |
[private, slot] |
A simulation thread has finished, check if it was the last thread, if so, gather results and emit signal finished()
void CalculateManager::on_calculateRegimeTransitionThreadFinished |
( |
|
) |
[private, slot] |
A simulation thread has finished, check if it was the last thread, if so, gather results and emit signal finished()
void CalculateManager::on_simulationError |
( |
QString |
errorMsg |
) |
[private, slot] |
Forward error message to mainWindow
QString CalculateManager::pluginName |
( |
|
) |
|
int CalculateManager::progress |
( |
|
) |
|
void CalculateManager::quit |
( |
|
) |
|
void CalculateManager::run |
( |
|
) |
|
Run calculation threads, gets called by start()
void CalculateManager::simulationError |
( |
QString |
errorMsg |
) |
[signal] |
int CalculateManager::simulationID |
( |
|
) |
[inline] |
void CalculateManager::simulationProgressed |
( |
int |
percent |
) |
[signal] |
void CalculateManager::terminated |
( |
|
) |
[signal] |
std::vector< double > CalculateManager::xList |
( |
|
) |
|
Returns vector of doubles containing superficial velocities
double CalculateManager::xVariableMax |
( |
|
) |
|
Returns the maximum x variable value
double CalculateManager::xVariableMin |
( |
|
) |
|
Returns the minimum x variable value
QString CalculateManager::xVariableName |
( |
|
) |
|
Returns QString with name of the x variable, first letter capitalized
std::vector< double > CalculateManager::yList |
( |
|
) |
|
Returns vector of doubles containing y values
Member Data Documentation