Opened 11 years ago
Closed 11 years ago
#2374 closed defect (fixed)
Backend cannot handle asub of casted records
Reported by: | Adrian Pop | Owned by: | Willi Braun |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Backend | Version: | trunk |
Keywords: | Cc: | Lennart Ochel, Willi Braun |
Description
Run instantiateModel on
Modelica.Electrical.QuasiStationary.Machines.Examples.TransformerTestbench.
You get for example:
/*Complex[3]*/(transformer.core.v1)[1] = Modelica.SIunits.ComplexVoltage.'*'.multiply(/*Complex*/(transformer.core.v2[1]), Modelica.SIunits.ComplexVoltage.'constructor'.fromReal(transformer.core.n12, 0));
Hm, if I think more about it, it seems to be an issue with simplification of ASUB(CAST(T_ARRAY, record_array), 1)
which should be
translated to: CAST(T_COMPLEX(), ASUB(record_array, 1))
.
Change History (7)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
If you want it in the other order, just change it :)
Of course we need to typecast it before it is scalarised, and then you get this issue (it's still sort of correct, but you can further simplify it).
comment:3 by , 11 years ago
Cc: | added |
---|---|
Component: | Frontend → Backend |
Owner: | changed from | to
Status: | new → assigned |
Summary: | Wrong casting when operator overloading is involved with arrays → Backend cannot handle asub of casted records |
Well, it does seem correct but it seems that our back-end cannot handle it.
[lib/omlibrary/Modelica 3.2.1/Electrical/QuasiStationary/Machines.mo:2206:9-2206:33:writable] Error: Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function createNonlinearResidualEquations failed for equation: /*Complex[3]*/(transformer.core.im)[3] = Complex.'constructor'.fromReal(0.0, 0)
I'll make it a back-end ticket.
comment:6 by , 11 years ago
The fix works for the model, running testsuite now to see where we stand.
This might be a back-end issue actually. Martin can you have a quick look?