Opened 9 years ago
Last modified 7 years ago
#3464 new defect
Failing variable lookup during array creation — at Version 1
Reported by: | Rüdiger Franke | Owned by: | Marcus Walther |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Cpp Run-time | Version: | |
Keywords: | Cc: | Niklas Worschech, Marcus Walther |
Description (last modified by )
Some models from MSL trunk initialize arrays with expressions like TransformationMatrix
:
function ToSpacePhasor input Real x[:]; ... protected parameter Integer m=size(x, 1); parameter Modelica.SIunits.Angle phi[m]=MultiPhase.Functions.symmetricOrientation(m); parameter Real TransformationMatrix[2, m]=2/m*{+cos(+phi),+sin(+phi)} for k in 1:m}; ... end ToSpacePhasor;
The Cpp runtime generates separate createArray functions that don't see the used variables. See e.g. Modelica.Electrical.Machines.Examples.Transformers.TransformerTestbench
,
https://test.openmodelica.org/libraries/MSL_trunk_cpp/BuildModelRecursive.html
Shouldn't these functions be removed and the array be created in situ?
Note:
See TracTickets
for help on using tickets.
Commit
solves another problem with these examples -- the sizing of the array is wrong and appears not needed there.