Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Belonging to [master]: - OpenModelica/OpenModelica-testsuite#1122
- Loading branch information
1 parent
a6d7282
commit 70e6d3a
Showing
2 changed files
with
40 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// name: Ticket5340.mos | ||
// keywords: initialization, if equations, terminate | ||
// status: correct | ||
// cflags: | ||
// teardown_command: rm -rf output.log TestInitialTerminate* | ||
// | ||
|
||
|
||
loadString(" | ||
model TestInitialTerminate | ||
Real x(start = 1, fixed=true); | ||
initial equation | ||
if x > 0 then | ||
terminate(\"Terminate should be called at initialization.\"); | ||
end if; | ||
equation | ||
der(x) = 1*x; | ||
end TestInitialTerminate; | ||
"); getErrorString(); | ||
|
||
simulate(TestInitialTerminate); getErrorString(); | ||
|
||
|
||
// Result: | ||
// true | ||
// "" | ||
// record SimulationResult | ||
// resultFile = "TestInitialTerminate_res.mat", | ||
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'TestInitialTerminate', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", | ||
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method. | ||
// [<interactive>:6:5-6:63:writable] | ||
// stdout | info | Simulation call terminate() at initialization (time 0.000000) | ||
// | | | | Message : Terminate should be called at initialization. | ||
// LOG_SUCCESS | info | The simulation finished successfully. | ||
// " | ||
// end SimulationResult; | ||
// "" | ||
// endResult |