Skip to content

Commit

Permalink
Flat Modelica fixes (#8215)
Browse files Browse the repository at this point in the history
- Use Flat Modelica for the dumpFlatModel output if the -f is used.
- Also check the for-range in FlatModel.collectEquationFlatTypes.
  • Loading branch information
perost committed Nov 24, 2021
1 parent 4ff85b3 commit 7c3ddb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions OMCompiler/Compiler/NFFrontEnd/NFFlatModel.mo
Expand Up @@ -356,6 +356,8 @@ public

case Equation.FOR()
algorithm
types := Util.applyOptionOrDefault(eq.range,
function collectExpFlatTypes(types = types), types);
types := List.fold(eq.body, collectEquationFlatTypes, types);
then
();
Expand Down
7 changes: 6 additions & 1 deletion OMCompiler/Compiler/NFFrontEnd/NFInstUtil.mo
Expand Up @@ -58,7 +58,12 @@ public
print(stage);
print("\n########################################\n\n");

FlatModel.printString(flat_model);
if Flags.getConfigBool(Flags.FLAT_MODELICA) then
FlatModel.printFlatString(flat_model, FunctionTree.listValues(functions));
else
FlatModel.printString(flat_model);
end if;

print("\n");
end if;
end dumpFlatModelDebug;
Expand Down

0 comments on commit 7c3ddb9

Please sign in to comment.