Download presentation
Presentation is loading. Please wait.
Published byEvelyn Newton Modified over 9 years ago
1
BEFOREHANDS
2
OMOptim C++ code Stored on subversion solver Using Qt libraries (GUI, Model/View, Containers, Threads, XML…)
3
Subversion repository 16/01/2012Plateforme CERES
4
MAIN CLASSES
5
Class ProjectProject The Core of the program One project at a time Contains main items – Modelica tree of models, package… (ModClassTree) – List of problems and results – List of ModModelPlus – Misc. Informations : save files, files loaded Main functions – Problems should be launched from Project – Threads management
6
Class ProjectProject
7
GUI Widgets Dialogs Treeviews Tableviews Modelica ModClassTree ModPlusCtrl ModModelPlus ModClass Problems ProblemInterface Problem Result OMOptim
8
MODELICA - MODELS
9
ModClass Basic class, corresponding to an item in modelica – Each instance stores name and children Inheritance diagram
10
ModClassTree Contains modelica models, packages, classes names
11
ModModelPlus ModModel* pointer to a modelica model void compile() void readVariables() ModModelPlus allows to store information about a modelica model (ModModel*). Especially : -Input variables -Connections between components It also provides compiling and reading functions. Still, those functions require ModPlusCtrl.
12
ModPlusCtrl Simulation software controler : – Specific for each simulation software – Provide interface functions : Set simulation parameters Writing / Reading variables Compiling model Simulating model – Set Parameters : Simulation time Solver Tolerances …
13
ModReader ModReader & MOOmcMOOmc Offering modelica reading functions MOOmc : link between OpenModelica & OMOptim (use Corba protocol) – QString getFlattenedModel (const QString &modelName)getFlattenedModel – bool addConnection (QString org, QString dest)addConnection – void getInheritedComponents (QString parentClass, QStringList &names, QStringList &classes)getInheritedComponents – …
14
Model A Model B Model management MOOMC MyFile.mo OMOptim ModPlusCtrl OpenModelica controler Dymola controler MathModelica controler Reading model Corba communication with OpenModelica Reading model Corba communication with OpenModelica -Compiling -Simulating - Reading/Writing variables -Compiling -Simulating - Reading/Writing variables ModClassTree
15
PROBLEMS
16
Launching a problem Project void launchProblem(Problem*); SLOT :void onProblemFinished(Problem*,Result*); Problems* _problems; Results* _results; Post-computation procedure : Result storageGUI creation SLOT project->onProblemFinished(myProblem,myResult) SIGNAL emit finished(myProblem,myResult) Create Problem Thread myProblem->launch() … separate thread … project->launchProblem(myProblem) User ProblemThread void run(); SIGNAL : void finished (Problem*,Result*); Separate thread
17
Problem An abstract class defining basic functions. Inherits OMCase which contains more basic virtual functions.OMCase
18
Project One Simulation ModClassTree Package 1 Package 2 [ModPackage] Model a Model b [ModModel] ModModelPlus Problem1 [OneSimulation] OverwritedVariables ModPlusControler ModModelPlus*
19
One Simulation Linked to ModModel (node in ModClassTree) Model initial variables ModModelPlus* Simulator choice and parameters ModPlusCtrl* Variables with new values set by the user Overwritedvariables* OneSimResult Simulation variables at final time FinalVariables A copy of the problem OneSimulation
20
Problems’ plugin Shared OMOptim : -OneSimulation -Optimization Energy Integration -PluginEI.dll My Sensitivity analysis Plugin loading : dynamic or static Method: implement new inheritances of following abstract classes - ProblemInterfaceProblemInterface - ProblemProblem - ResultResult
21
ENERGY INTEGRATION
22
Energy integration EI is a plugin offering new problems – EIMER : Minimum energy requirement – EITarget : Utilities targetting – EIHEN1 : Heat Exchanger Network
23
Energy integration Modelica model MILP optimization problem EIProblem -MER -Target -HEN ModPlus Ctrl MOOmc MILP Solver GLPKCbcCplex
24
GUI
25
GUI – Core links Often use Qt model- view programming – Data / GUI more independent
26
Conventions used in code Class name always start with an uppercase : MyClass Members always start with _ + lowercase _myInstance Local variables start with lowercase myLocalVariable Documentation generated through Doxygen
27
OMOptimBasis Variables, Problems, Settings, GUI OMOptim PluginEI OMOptim Modelica
28
Source code storage
29
Documentation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.