#5946 closed defect (fixed)
[NF] Cross product inside array models is broken in the Frontend
Reported by: | anonymous | Owned by: | Per Östlund |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | New Instantiation | Version: | |
Keywords: | Cc: |
Description
//Broken model with array, containing cross operator model CrossBug model Foo input Real x[3]; input Real y[3]; output Real z[3]; equation z = cross(x, y); end Foo; Foo foo[1]; equation foo[1].x = time * {1, 2, 3}; foo[1].y = {time, time^3, time^2}; end CrossBug; //Flattened model class CrossBug Real foo[1].x[1]; Real foo[1].x[2]; Real foo[1].x[3]; Real foo[1].y[1]; Real foo[1].y[2]; Real foo[1].y[3]; Real foo[1].z[1]; Real foo[1].z[2]; Real foo[1].z[3]; equation foo[1].z[1] = foo[1].x * foo[1].y - foo[1].x * foo[1].y; foo[1].z[2] = foo[1].x * foo[1].y - foo[1].x * foo[1].y; foo[1].z[3] = foo[1].x * foo[1].y - foo[1].x * foo[1].y; foo[1].x[1] = time; foo[1].x[2] = time * 2.0; foo[1].x[3] = time * 3.0; foo[1].y[1] = time; foo[1].y[2] = time ^ 3.0; foo[1].y[3] = time ^ 2.0; end CrossBug;
Change History (9)
follow-up: 4 comment:1 by , 5 years ago
follow-up: 6 comment:2 by , 5 years ago
I just tested it with v1.16.0-dev.353+gb31452a72
. The flag -d=newInst
makes it break.
comment:3 by , 5 years ago
Component: | Frontend → New Instantiation |
---|---|
Owner: | changed from | to
Status: | new → accepted |
follow-up: 5 comment:4 by , 5 years ago
Also, as the title suggests, if foo
is scalar the model works. Defining x,y,z
as input/output makes no difference.
Replying to Karim.Abdelhak:
I tested it with the current version, seems to work.
OpenModelica 1.16.0~dev-311-gd37a91d
I'm curious, did you test it in OMEdit? The old frontend seems to fail here, too, though it works from the command line.
comment:5 by , 5 years ago
Replying to phannebohm:
Also, as the title suggests, if
foo
is scalar the model works. Definingx,y,z
as input/output makes no difference.
Replying to Karim.Abdelhak:
I tested it with the current version, seems to work.
OpenModelica 1.16.0~dev-311-gd37a91d
I'm curious, did you test it in OMEdit? The old frontend seems to fail here, too, though it works from the command line.
I did both, command line and OMEdit. Also it works with old and new frontend, no difference there. The only thing that breaks it is -nfScalarize
, maybe you left that flag activated by accident?
comment:6 by , 5 years ago
Replying to phannebohm:
I just tested it with
v1.16.0-dev.353+gb31452a72
. The flag-d=newInst
makes it break.
Just to be sure i upgraded to your version, still no difference. Command line/OMEdit, old frontend and new frontend. Everything works.
-d=-nfScalarize
breaks it though. But this is expected since that flag is not fully supported right now.
comment:7 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | accepted → assigned |
I think I've fixed this locally, I just need to do a bit of testing.
comment:9 by , 5 years ago
Milestone: | Future → 1.16.0 |
---|
I tested it with the current version, seems to work.
OpenModelica 1.16.0~dev-311-gd37a91d
For which version did you test this?