24#ifndef _GEMA_SIMULATION_DATA_H_
25#define _GEMA_SIMULATION_DATA_H_
50struct QtGlobalMemUsage;
58 const QVariantMap& configConstants,
const QVariantMap& configOptions);
75 const QVariantMap& constants,
const QVariantMap& options)
78 _description = description;
79 _constants = constants;
81 setupDisabledWarningsList();
123 bool cancelRequested()
const { assert(_threadManager);
return _threadManager->cancelRequested(); }
132 GmMpiContext* mpiContext()
const {
return _mpiContext; }
135 QtHardwareInfo*
hwInfo()
const {
return _hwInfo; }
143 double currentTime (
const Unit& desiredUnit)
const;
144 double previousTime(
const Unit& desiredUnit)
const;
159 _prevTime = (time == 0.0 ? 0.0 : _currentTime);
162 _results->setCurrentTime(_currentTime);
227 void createStdProgressItems();
230 void printMapValues (
const GmLogCategory& logger,
const QVariantMap& map,
const QVariantMap& configMap);
233 const QVariant& mapValue(
const QString& name,
const QVariantMap& map,
const QVariantMap& configMap)
const;
234 QVariant mapValue(
const QString& name,
const QVariantMap& map,
const QVariantMap& configMap,
const QVariant& defValue)
const;
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Auxiliar class used to store the complete set of model data for a simulation.
Definition gmModelData.h:53
Class used to store releveant system and project paths, providing functions for path macro translatio...
Definition gmPath.h:38
Class responsible for managing discovery and loading of plugins.
Definition gmPluginLoader.h:43
Base interface class for all object plugins.
Definition gmPluginObject.h:37
GmSimulationData * simulationData() const
Returns a reference to the simulation data object keeping global simulation information.
Definition gmPluginObject.h:88
Auxiliar class used to store the complete set of results data for a simulation.
Definition gmResultsData.h:58
A class used to store time, memory and additional values statistics related to the simulation loading...
Definition gmRunProgressStats.h:42
Auxiliar class used to store the complete set of simulation data.
Definition gmSimulationData.h:55
QString _description
Simulation description.
Definition gmSimulationData.h:240
void setLoadedFiles(const QStringList &loadedFiles)
Updates the list of loaded files for this simulation.
Definition gmSimulationData.h:85
void popDisabledWarning()
Removes the last temporarily disabled warning by a call to pushDisabledWarning()
Definition gmSimulationData.h:178
GmPluginLoader * _loader
The application plugin manager.
Definition gmSimulationData.h:263
GmResultsData * _results
Results configuration data.
Definition gmSimulationData.h:250
QtHardwareInfo * _hwInfo
Some useful information about the execution hardware.
Definition gmSimulationData.h:255
const GmPath * _paths
Object storing the set of important paths for path macro substitution.
Definition gmSimulationData.h:264
QVariantMap _constants
The map with constants defined in the simulation section.
Definition gmSimulationData.h:242
QString _name
Simulation name.
Definition gmSimulationData.h:239
double currentTime() const
Returns the current simulation time in the current time unit.
Definition gmSimulationData.h:138
double _prevTime
The previous simulation time.
Definition gmSimulationData.h:267
GmRunProgressStats * _progress
The object used to track simulation progress statistics.
Definition gmSimulationData.h:251
GmResultsData * resultsData() const
Returns the results configuration associated to this simulation.
Definition gmSimulationData.h:97
GmPluginLoader * loader() const
Returns the plugin loader to allow for plugins to load other plugins.
Definition gmSimulationData.h:109
QString sharedCode() const
Returns the shared code associated to this simulation.
Definition gmSimulationData.h:106
const Unit & timeUnit() const
Returns the unit in which the current time is stored.
Definition gmSimulationData.h:147
GmSolutionData * solutionData() const
Returns the solution definition associated to this simulation.
Definition gmSimulationData.h:94
const QVariantMap & configOptions() const
Returns the map with options read from the config file. Not for general use (used by the loader onl...
Definition gmSimulationData.h:219
QString name() const
Returns the simulation name.
Definition gmSimulationData.h:65
QVariant constantValue(const QString &name, const QVariant &defValue) const
Returns the given constant value. Looks for the given name first in the data set read from the Simula...
Definition gmSimulationData.h:204
const QVariant & optionValue(const QString &name) const
Returns a reference to the given option value. Looks for the given name first in the data set read fr...
Definition gmSimulationData.h:185
double _currentTime
The current simulation time.
Definition gmSimulationData.h:266
const QVariantMap & _configConstants
The map with constants defined in the configuration file.
Definition gmSimulationData.h:244
GmSolutionData * _solution
Solution method data.
Definition gmSimulationData.h:249
void setCurrentTime(double time, bool updatePrev=true)
Updates the current time.
Definition gmSimulationData.h:155
QString _sharedCode
The shared code for setting the Lua environment for worker threads.
Definition gmSimulationData.h:253
QStringList _loadedFiles
The set of Lua files that where loaded for this simulation.
Definition gmSimulationData.h:241
void setPreviousTime(double time)
Updates the previous time.
Definition gmSimulationData.h:166
QtHardwareInfo * hwInfo() const
Returns some useful information about the execution hardware.
Definition gmSimulationData.h:135
bool cancelRequested() const
Do we have a pending request to cancel the simulation? Returns the information stored on the thread...
Definition gmSimulationData.h:123
double previousTime() const
Returns the previous simulation time in the current time unit.
Definition gmSimulationData.h:141
GmModelData * _model
Model data.
Definition gmSimulationData.h:248
const QVariantMap & simulationOptions() const
Returns the map with options read from the simulation. Not for general use (used by the loader only...
Definition gmSimulationData.h:209
QString description() const
Returns the simulation description.
Definition gmSimulationData.h:68
GmThreadManager * _threadManager
The configured thread manager.
Definition gmSimulationData.h:258
QVariantMap _options
The map with options defined in the simulation section.
Definition gmSimulationData.h:243
const QStringList & loadedFiles() const
Returns the list of loaded files for this simulation.
Definition gmSimulationData.h:71
GmModelData * modelData() const
Returns the model data associated to this simulation.
Definition gmSimulationData.h:91
QStringList _disabledWarnings
Disabled warnings list (initialized from _options & _configOptions but editable)
Definition gmSimulationData.h:246
QtGlobalMemUsage * _initMemoryInfo
The global memory usage pattern before loading the simulation data.
Definition gmSimulationData.h:256
GmTaskManager * _taskManager
The configured task manager.
Definition gmSimulationData.h:259
GmMpiContext * _mpiContext
The Mpi context for distributed simulations. NULL otherwise.
Definition gmSimulationData.h:261
const QVariantMap & simulationConstants() const
Returns the map with constants read from the simulation. Not for general use (used by the loader on...
Definition gmSimulationData.h:214
const GmPath * paths() const
Returns the object storing information for path macro substitution.
Definition gmSimulationData.h:112
QVariant optionValue(const QString &name, const QVariant &defValue) const
Returns the given option value. Looks for the given name first in the data set read from the Simulati...
Definition gmSimulationData.h:192
Unit _timeUnit
The current simulation time unit.
Definition gmSimulationData.h:268
GmTaskManager * taskManager() const
Returns a pointer to the configured task manager.
Definition gmSimulationData.h:129
void setSimulationGlobalInfo(QString name, QString description, const QVariantMap &constants, const QVariantMap &options)
Updates the simulation global attributes: name & description.
Definition gmSimulationData.h:74
const QVariantMap & _configOptions
The map with options defined in the configuration file.
Definition gmSimulationData.h:245
static GmRunProgressStats * progressStats(const GmPluginObject *obj)
Returns the run progress monitoring object from the simulation data stored on any plugin object.
Definition gmSimulationData.h:103
GmRunProgressStats * progressStats() const
Returns the run progress monitoring object.
Definition gmSimulationData.h:100
const QVariantMap & configConstants() const
Returns the map with constants read from the config file. Not for general use (used by the loader o...
Definition gmSimulationData.h:224
void setupDisabledWarningsList()
Initializes the disabled warnings list from the options and config options tables.
Definition gmSimulationData.h:237
const QVariant & constantValue(const QString &name) const
Returns a reference to the given constant value. Looks for the given name first in the data set read ...
Definition gmSimulationData.h:198
GmThreadManager * threadManager() const
Returns a pointer to the configured thread manager.
Definition gmSimulationData.h:126
bool disabledWarning(QString warnName) const
Returns true if the given warning is disabled.
Definition gmSimulationData.h:172
void pushDisabledWarning(QString warnName)
Temporarily disables a warning until a call to popDisabledWarning()
Definition gmSimulationData.h:175
void setSharedCode(QString sharedCode)
Updates the shared code.
Definition gmSimulationData.h:88
void setCurrentTimeUnit(const Unit &unit)
Updates the current time unit.
Definition gmSimulationData.h:169
Auxiliar class used to store the complete set of solution methods data for a simulation.
Definition gmSolutionData.h:42
Task manager used for handling parallel executions.
Definition gmTaskManager.h:84
Thread manager used for handling parallel executions.
Definition gmThreadManager.h:100
static bool inMainThread()
Is the current thread the main thread? Equivalent to comparing the currentId() with 0.
Definition gmThreadManager.h:174
Declaration of useful configuration definitions for the Core library.
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of the GmPluginObject base class.
Declaration of the GmResultsData class.
Declaration of the GmThreadManager class.