Opened 12 years ago

Closed 7 years ago

#1805 closed defect (fixed)

Multi-level redeclare

Reported by: hubert.thieriot@… Owned by: Per Östlund
Priority: high Milestone: 1.13.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Hi,

The behavior of OM is not the one user could expect on the following case.

MyModel1 and MyModel2 results seem correct.

But MyModel3 still gives 1.0 as result while, to me, it should give 2.0.

Best regards,

Hubert

Attachments (6)

Test.mos (84 bytes ) - added by anonymous 12 years ago.
Test.mo (1.3 KB ) - added by anonymous 12 years ago.
log.txt (45.5 KB ) - added by anonymous 12 years ago.
Test2.mo (1.3 KB ) - added by anonymous 12 years ago.
Test2.mos (66 bytes ) - added by anonymous 12 years ago.
log2.txt (23.8 KB ) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (13)

by anonymous, 12 years ago

Attachment: Test.mos added

by anonymous, 12 years ago

Attachment: Test.mo added

by anonymous, 12 years ago

Attachment: log.txt added

comment:1 by anonymous, 12 years ago

partial package MyPartialMedium

replaceable partial function MyFunction

output Modelica.SIunits.SpecificHeatCapacityAtConstantPressure CP "Cp";

end MyFunction;

end MyPartialMedium;

package MyMedium1

extends MyPartialMedium;
redeclare function extends MyFunction
algorithm

CP:=1;

end MyFunction;

end MyMedium1;

package MyMedium2

extends MyPartialMedium;
redeclare function extends MyFunction
algorithm

CP:=2;

end MyFunction;

end MyMedium2;

model MyComponent

replaceable package componentMedium = MyMedium1 constrainedby MyPartialMedium;
Real result;

equation

result = componentMedium.MyFunction();

end MyComponent;

model MyModel1

replaceable package model1Medium = MyMedium1 constrainedby MyPartialMedium;
MyComponent comp(redeclare package componentMedium = model1Medium);
Real result;

equation

result = comp.result;

end MyModel1;

model MyModel2

replaceable package model2Medium = MyMedium2 constrainedby MyPartialMedium;
MyComponent comp(redeclare package componentMedium = model2Medium);
Real result;

equation

result = comp.result;

end MyModel2;

model MyModel3

MyModel1 model1(redeclare package model1Medium = MyMedium2);
Real result;

equation

result = model1.result;

end MyModel3;

by anonymous, 12 years ago

Attachment: Test2.mo added

by anonymous, 12 years ago

Attachment: Test2.mos added

by anonymous, 12 years ago

Attachment: log2.txt added

comment:2 by anonymous, 12 years ago

Test2 is probably a better illustration since in that case, Model3 building fails (I removed default package version in component).

See log2.txt.

comment:3 by Martin Sjölund, 12 years ago

Component: BackendFrontend
Milestone: 1.9.0Future

Redeclare is the target of the new instantiation. I will not be fixed in 1.9.0.

comment:4 by Martin Sjölund, 12 years ago

Owner: changed from somebody to Per Östlund
Status: newassigned

comment:5 by Per Östlund, 12 years ago

Component: FrontendNew Instantiation

comment:6 by Francesco Casella, 7 years ago

Milestone: Future2.0.0

comment:7 by Francesco Casella, 7 years ago

Milestone: 2.0.01.13.0
Resolution: fixed
Status: assignedclosed

With today's nightly build, the result is correct with both old and new front end.

Note: See TracTickets for help on using tickets.