Skip to content

Commit

Permalink
[NF] Keep vectors in connect equations
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2712
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Oct 10, 2018
1 parent 0dbda2b commit d7274ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Compiler/NFFrontEnd/NFConnections.mo
Expand Up @@ -144,6 +144,12 @@ public
Boolean expanded;
algorithm
cr := ComponentRef.evaluateSubscripts(cref);

if not Flags.isSet(Flags.NF_SCALARIZE) then
connectors := {Connector.fromCref(cr, ComponentRef.getSubscriptedType(cr), source)};
return;
end if;

cref_exp := Expression.CREF(ComponentRef.getSubscriptedType(cr), cr);
(cref_exp, expanded) := ExpandExp.expand(cref_exp);

Expand Down
12 changes: 8 additions & 4 deletions Compiler/NFFrontEnd/NFConnector.mo
Expand Up @@ -230,10 +230,14 @@ protected

case Type.ARRAY()
algorithm
t := Type.arrayElementType(ty);
for c in ComponentRef.scalarize(name) loop
conns := splitImpl(c, t, face, source, cty, conns);
end for;
if Flags.isSet(Flags.NF_SCALARIZE) then
t := Type.arrayElementType(ty);
for c in ComponentRef.scalarize(name) loop
conns := splitImpl(c, t, face, source, cty, conns);
end for;
else
conns := CONNECTOR(name, ty, face, cty, source) :: conns;
end if;
then
conns;

Expand Down

0 comments on commit d7274ca

Please sign in to comment.