Opened 14 years ago

Closed 3 years ago

Last modified 3 years ago

#1298 closed defect (fixed)

Records (and functions) with complex default bindings fail

Reported by: sjoelund.se Owned by: sjoelund.se
Priority: critical Milestone: 1.16.0
Component: Backend Version:
Keywords: Cc: sjoelund.se, adrpo

Description (last modified by sjoelund.se)

Default bindings that refer to other input variables are not handled correctly. The only testcases that use these features work, but only because the binding is somehow ignored (using default modifications anyway).

package HardMagnetic
public 
constant Real mu_0 = 3;
record BaseData
  parameter Real H_cBRef = 1;
  parameter Real B_rRef = 1;
  parameter Real T_ref = 293.15;
  parameter Real alpha_Br = 0;
  parameter Real T_op = 293.15;
  final parameter Real B_r = B_rRef * (1 + alpha_Br * (T_op - T_ref));
  final parameter Real H_cB = H_cBRef * (1 + alpha_Br * (T_op - T_ref));
  final parameter Real mu_r = B_r / (mu_0 * H_cB);
end BaseData;
record NdFeB
  extends HardMagnetic.BaseData(H_cBRef = 900000, B_rRef = 1.2, T_ref = 20 + 273.15, alpha_Br =  -0.001);
end NdFeB;
end HardMagnetic;

Can be handled while elaborating the call (for any parameter that needs a default binding, replace any cref to another input with the expression used for that input). Note that for functions, order matters so these bindings should be sorted already...

Change History (12)

comment:1 Changed 13 years ago by petar

Affects the following testcase (which is arelay checked in?!?): libraries/msl31/Modelica.Magnetic.Fluxtubes.mos

comment:2 Changed 13 years ago by adrpo

partially fixed in revsion 6935. it might not work if the final parameters in the
record are not final anymore.

comment:3 Changed 9 years ago by hkiel

  • Component set to Backend
  • Milestone changed from Red October to 1.9.3

comment:4 Changed 9 years ago by sjoelund.se

  • Milestone changed from 1.9.3 to 1.9.4

Moved to new milestone 1.9.4

comment:5 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.4 to 1.9.5

Milestone pushed to 1.9.5

comment:6 Changed 8 years ago by sjoelund.se

  • Milestone changed from 1.9.5 to 1.10.0

Milestone renamed

comment:7 Changed 7 years ago by sjoelund.se

  • Milestone changed from 1.10.0 to 1.11.0

Ticket retargeted after milestone closed

comment:8 Changed 7 years ago by sjoelund.se

  • Milestone changed from 1.11.0 to 1.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:9 Changed 6 years ago by casella

  • Milestone changed from 1.12.0 to Future

The milestone of this ticket has been reassigned to "Future".

If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.

If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".

In both cases, a short informative comment would be welcome.

comment:10 Changed 6 years ago by sjoelund.se

  • Description modified (diff)

comment:11 Changed 3 years ago by perost

  • Resolution set to fixed
  • Status changed from new to closed

The ticket isn't quite clear on how to reproduce the issue, but neither the old nor the new frontend seems to have any issues handling HardMagnetic.NdFeB.

comment:12 Changed 3 years ago by casella

  • Milestone changed from Future to 1.16.0
Note: See TracTickets for help on using tickets.