Opened 6 years ago

Closed 6 years ago

#5084 closed defect (fixed)

The NF does not evaluate protected parameters depending on Evaluate = true parameters through function

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Consider the following test model

model TestEvaluateParameter
  parameter Real n[3] = {0, 1, 0} annotation(Evaluate = true);
protected
  parameter Real q[3] = Modelica.Math.Vectors.normalizeWithAssert(n);
end TestEvaluateParameter;

The old FE flattens this to

class TestEvaluateParameter
  parameter Real n[1] = 0.0;
  parameter Real n[2] = 1.0;
  parameter Real n[3] = 0.0;
  protected parameter Real q[1] = 0.0;
  protected parameter Real q[2] = 1.0;
  protected parameter Real q[3] = 0.0;
end TestEvaluateParameter;

while the new FE outputs

class TestEvaluateParameter
  parameter Real n[1] = 0.0;
  parameter Real n[2] = 1.0;
  parameter Real n[3] = 0.0;
  protected parameter Real q[1] = Modelica.Math.Vectors.normalizeWithAssert({0.0, 1.0, 0.0})[1];
  protected parameter Real q[2] = Modelica.Math.Vectors.normalizeWithAssert({0.0, 1.0, 0.0})[2];
  protected parameter Real q[3] = Modelica.Math.Vectors.normalizeWithAssert({0.0, 1.0, 0.0})[3];
end TestEvaluateParameter;

This has a negative impact on the correct processing of MultiBody models, see #5083

Change History (1)

comment:1 by Per Östlund, 6 years ago

Resolution: fixed
Status: newclosed

This was fixed in 6654660.

Note: See TracTickets for help on using tickets.