Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve handling of potentialRoot (#9217)
- Mark the priority argument as structural and evaluate it. - Check that the priority argument is actually a parameter expression. Fixes #9216
- Loading branch information
Showing
4 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
testsuite/flattening/modelica/scodeinst/FuncBuiltinPotentialRoot1.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// name: FuncBuiltinPotentialRoot1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
type OC | ||
extends Real; | ||
|
||
function equalityConstraint | ||
input OC oc1; | ||
input OC oc2; | ||
output Real residue[0]; | ||
end equalityConstraint; | ||
end OC; | ||
|
||
connector C | ||
Real e; | ||
flow Real f; | ||
OC oc; | ||
end C; | ||
|
||
model FuncBuiltinPotentialRoot1 | ||
C c1, c2; | ||
parameter Integer p = 0; | ||
equation | ||
Connections.potentialRoot(c1.oc, p); | ||
Connections.potentialRoot(c2.oc); | ||
c1.f = 0; | ||
c2.f = 0; | ||
end FuncBuiltinPotentialRoot1; | ||
|
||
// Result: | ||
// class FuncBuiltinPotentialRoot1 | ||
// Real c1.e; | ||
// Real c1.f; | ||
// Real c1.oc; | ||
// Real c2.e; | ||
// Real c2.f; | ||
// Real c2.oc; | ||
// final parameter Integer p = 0; | ||
// equation | ||
// c1.f = 0.0; | ||
// c2.f = 0.0; | ||
// c1.f = 0.0; | ||
// c2.f = 0.0; | ||
// end FuncBuiltinPotentialRoot1; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters