Opened 10 years ago

Closed 4 years ago

#3302 closed defect (fixed)

"replaceable parameter record" and inner/outer - flattening fails when array size in record changes

Reported by: c.schulze@… Owned by: Per Östlund
Priority: blocker Milestone: 1.16.0
Component: New Instantiation Version: trunk
Keywords: Cc:

Description

In the attached file is a package with two testers.

In Tester_workingButWithError the model can be translated and the results are correct (see ticket #3300 ). In the second Tester_FlatteningFails the flattening fails, since the vector sizes of the records change.

Unfortunately this is an important language feature, that blocks the usage of the TIL Library ( http://www.tlk-thermo.com ) and e.g. the ClaRa Library ( http://www.claralib.com ) in OpenModelica.

Attachments (1)

TestRecordInConnector.mo (1.4 KB ) - added by c.schulze@… 10 years ago.
test package

Download all attachments as: .zip

Change History (7)

by c.schulze@…, 10 years ago

Attachment: TestRecordInConnector.mo added

test package

comment:1 by Adrian Pop, 10 years ago

Component: BackendFrontend
Owner: changed from somebody to Adrian Pop
Status: newaccepted

comment:2 by Rüdiger Franke, 10 years ago

Good that you bring this up and give it some priority. The PowerSystems library suffers from this as well. See also #3183.

comment:3 by c.schulze@…, 10 years ago

Nice to hear that others share these problems ;)

It seems that a small modification enables OpenModelica to run the testers:

model Submodel

outer SIM sim;
parameter Ra r(n=sim.r1.n) = sim.r1;

end Submodel;

comment:4 by Adrian Pop, 6 years ago

Component: FrontendNew Instantiation

With -d=newInst using script:

loadFile("TestRecordInConnector.mo"); getErrorString();
instantiateModel(TestRecordInConnector.Tester_FlatteningFails); getErrorString();
instantiateModel(TestRecordInConnector.Tester_workingButWithError); getErrorString();

we get:

adrpo33@ida-0030 MINGW64 /c/home/adrpo33/dev/OMTesting/bugs/3302
$ ~/dev/OpenModelica/build/bin/omc -d=newInst t.mos
true
""
""
"[C:/home/adrpo33/dev/OMTesting/bugs/3302/TestRecordInConnector.mo:5:5-5:35:writable] Error: Could not evaluate structural parameter (or constant): submodel.r.n which gives dimensions of array: x. Array dimensions must be known at compile time.
"
""
"[C:/home/adrpo33/dev/OMTesting/bugs/3302/TestRecordInConnector.mo:5:5-5:35:writable] Error: Could not evaluate structural parameter (or constant): submodel.r.n which gives dimensions of array: x. Array dimensions must be known at compile time.

comment:5 by Francesco Casella, 6 years ago

Milestone: Future2.0.0
Owner: changed from Adrian Pop to Per Östlund
Status: acceptedassigned

Probably related to #5243

in reply to:  5 comment:6 by Per Östlund, 4 years ago

Milestone: 2.0.01.16.0
Resolution: fixed
Status: assignedclosed

Replying to casella:

Probably related to #5243

Seems likely since the issue is now fixed.

Note: See TracTickets for help on using tickets.