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 Datadata ()
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 (  ) 

Destructor, delete CalculateFlowThread content


Member Function Documentation

std::vector< double > CalculateManager::alphaList (  ) 

Returns vector of doubles containing alpha values for all variables

Here is the caller graph for this function:

QString CalculateManager::calculationName (  ) 
const Data* CalculateManager::data (  )  [inline]

Returns const pointer to data used in simulation

Here is the caller graph for this function:

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

Here is the caller graph for this function:

void CalculateManager::finished (  )  [signal]

Here is the caller graph for this function:

void CalculateManager::generateXList ( std::vector< double > &  xList  )  [private]

Here is the caller graph for this function:

std::vector< double > CalculateManager::holdupList (  ) 

Returns vector of doubles containing holdup for all variables

Here is the caller graph for this function:

bool CalculateManager::isFinished (  )  [inline]

Returns true if simulation is finished

Here is the caller graph for this function:

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()

Here is the caller graph for this function:

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()

Here is the caller graph for this function:

void CalculateManager::on_simulationError ( QString  errorMsg  )  [private, slot]

Forward error message to mainWindow

Here is the caller graph for this function:

QString CalculateManager::pluginName (  ) 
int CalculateManager::progress (  ) 
void CalculateManager::quit (  ) 

Quit

Here is the caller graph for this function:

void CalculateManager::run (  ) 

Run calculation threads, gets called by start()

Here is the caller graph for this function:

void CalculateManager::simulationError ( QString  errorMsg  )  [signal]

Here is the caller graph for this function:

int CalculateManager::simulationID (  )  [inline]

Returns simulation ID

Here is the caller graph for this function:

void CalculateManager::simulationProgressed ( int  percent  )  [signal]

Here is the caller graph for this function:

void CalculateManager::terminated (  )  [signal]

Here is the caller graph for this function:

std::vector< double > CalculateManager::xList (  ) 

Returns vector of doubles containing superficial velocities

Here is the caller graph for this function:

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

Here is the caller graph for this function:

std::vector< double > CalculateManager::yList (  ) 

Returns vector of doubles containing y values


Member Data Documentation

std::vector<double> CalculateManager::_alphaList [private]
std::vector<double> CalculateManager::_diameterGasList [private]
std::vector<double> CalculateManager::_dpdxList [private]
std::vector<double> CalculateManager::_holdupList [private]
QWidget* CalculateManager::_parent [private]
QString CalculateManager::_pluginName [private]
unsigned int CalculateManager::_resolution [private]
scale_t CalculateManager::_scaleType [private]
unsigned int CalculateManager::_simulationsStarted [private]
unsigned int CalculateManager::_threads [private]
double CalculateManager::_tolerance [private]
variable_t CalculateManager::_variableWhat [private]
std::vector<double> CalculateManager::_xList [private]
std::vector<double> CalculateManager::_yList [private]
QStringList CalculateManager::errorMsgs [private]
 All Classes Functions Variables

Generated by  doxygen 1.6.2