- Index
- » Programming
- » Modelica Language
- » Code Generation of Subclass
Code Generation of Subclass
Code Generation of Subclass
Hi, i have downloaded the Scalable Modelica Test Suite ("https://github.com/casella/ScalableTestSuite")
Now I want to generate SImulation Code for one of the problems (Stringwith N = 64) via omc compiler.
How can I do this?
When i use the compiler directly on the provided model-file no equations are generated.
Re: Code Generation of Subclass
Hi,
Note that the scalable test suite needs special flags for DAE mode for some models.
You can find them here:
https://test.openmodelica.org/libraries … rsive.html
What OM do you have and which OS do you run it on?
If you have Windows then ScalableTestSuite should be part of the OM installation.
Just make a file script.mos containing:
Code:
// --- start --- script.mos
// load the Modelica library
loadModel(Modelica); getErrorString();
// load the ScalableTestSuite library
loadModel(ScalableTestSuite); getErrorString();
// or if you don't have ScalableTestSuite in the OM installation you need to load it via loadFile:
// uncomment this and comment the loadModel above
// loadFile("path/to/ScalableTestSuite/package.mo"); getErrorString();
// set special flags
setCommandLineOptions("--daeMode=dynamic"); getErrorString();
// build the model into an executable
buildModel(ScalableTestSuite.Mechanical.Strings.ScaledExperiments.StringModelica_N_64); getErrorString();
// run the executable with special flags
system("ScalableTestSuite.Mechanical.Strings.ScaledExperiments.StringModelica_N_64 -mei=4000 -daeMode -s=ida -idaLS=klu"); getErrorString();
// --- end --- script.mos
Then you run it via omc (i suggest you put script.mos in a separate directory as a lot of files will be generated when running the script):
Code:
path/to/omc script.mos
- adrpo
- 885 Posts
- Index
- » Programming
- » Modelica Language
- » Code Generation of Subclass