Opened 8 years ago
Closed 8 years ago
#4124 closed defect (fixed)
Does fill() create equations?
Reported by: | Volker Waurich | Owned by: | Volker Waurich |
---|---|---|---|
Priority: | high | Milestone: | 1.11.0 |
Component: | Backend | Version: | |
Keywords: | external objects, alias | Cc: | Per Östlund, Bernhard Thiele |
Description (last modified by )
Hi,
In Modelica_DeviceDrivers, there is a Serialpackager class which gets a Modelica_DeviceDrivers.Packaging.SerialPackager
model as an input and then, passes this object via a connector to the attached Serialpackager. These packages are meant to be the same object/variable/memory among all connected SerialPackagers. There is no alias equation in the model, only:
if nu == 1 then pkgOut.pkg = fill(pkgIn.pkg, nu);
The frontend does not create any alias equation which matters since these are external objects.
What is needed here, is the equation: pkgOut[1].pkg = pkgIn.pkg
This is not the case. Can you reveal this information somehow?
I will care of the backend stuff.
Attachments (1)
Change History (17)
by , 8 years ago
Attachment: | test_Ext.mo added |
---|
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:4 by , 8 years ago
Status: | new → accepted |
---|
comment:6 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | accepted → assigned |
Fixed the frontend part in 20336d/OMCompiler. Added test in 8898d5/OpenModelica-testsuite.
@vwaurich: take it away.
comment:7 by , 8 years ago
Component: | Frontend → Backend |
---|---|
Milestone: | Future → 1.11.0 |
comment:9 by , 8 years ago
Except you are not allowed to create aliases or assignments to external objects and this should simply not work in a Modelica compiler...
comment:10 by , 8 years ago
Well, if it can work, I think it should work. It is really useful even if it is not perfect. Maybe we figure out a better way to achieve the same in the future, but for moment I really appreciate that there is a drive to support that feature also in OMC.
comment:11 by , 8 years ago
@sjoelund Is there a reference about it? I would like to add a notification if external objects are assigned an alias.
comment:12 by , 8 years ago
Spec says:
Only the constructor may return external objects and external object can only be bound in component declarations and neither modified later nor assigned to.
I guess inner/outer could possibly be a shared external object, but not connections :(
I would have made it an error that tells the user to enable debug-flags for this behavior to be supported (and only allow it for connections or alias equations, not bindings or assignments).
comment:13 by , 8 years ago
Thanks for the info.
Shall we name the flag "+d=allowExternalAlias"
or "+pedantic=false"
;)
Anyway, I am glad that OMC supports this for now.
comment:14 by , 8 years ago
If we can do more than the specification says, I don't see a reason why we should not do it.
We can give warnings for these things but I think we should support this by default.
comment:16 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I added a warning and will close the ticket.
fill()
does create alias equations for non-external objects. Only for external objects, its missing.