Opened 5 years ago

Last modified 5 years ago

#5576 new defect

Solve array equation in backend for array of records

Reported by: Andreas Heuermann Owned by: Karim Adbdelhak
Priority: high Milestone: Future
Component: Backend Version:
Keywords: record, array Cc: Andreas Heuermann, Lennart Ochel

Description (last modified by Andreas Heuermann)

We get an error for arrays of records in the SimCode-phase.

When simulating

record simplRec
  Real a;
end simplRec;

function func
  input Real a;
  output simplRec out[3];
algorithm
  out[1].a := a;
  out[2].a := a*a;
  out[3].a := a*a*a;
end func;

model testArraysOfRecors
  simplRec A[3];
equation
  A = func(1);
end testArraysOfRecors;

See the error log:

Error processing file: bugArrayRecord.mo
[D:/workspace/OpenModelica/OMCompiler/Compiler/SimCode/SimCodeUtil.mo:6462:7-6462:48:writable] Error: Internal error solving array equation: 1 : A = func(1.0)
for variable: A[1].a.
[D:/workspace/OpenModelica/OMCompiler/Compiler/SimCode/SimCodeUtil.mo:1478:5-1478:77:writable] Error: Internal error createEquationsForSystems failed
[D:/workspace/OpenModelica/OMCompiler/Compiler/SimCode/SimCodeUtil.mo:746:5-746:146:writable] Error: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]

# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!

Change History (1)

comment:1 by Andreas Heuermann, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.