Skip to content

Commit

Permalink
Add test nlssMinSize.mos
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel authored and OpenModelica-Hudson committed Jan 20, 2017
1 parent 4c5e1a7 commit bc85cc1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
15 changes: 8 additions & 7 deletions openmodelica/cruntime/simoptions/Makefile
Expand Up @@ -8,8 +8,9 @@ testOutputIntervalDASSLstepsnoEquidistant.mos \
testOutputIntervalEuler.mos \
testOutputIntervalIDAstepsnoEquidistant.mos \
testOutputIntervalRK.mos \
nlssMinSize.mos \

# test that currently fail. Move up when fixed.
# test that currently fail. Move up when fixed.
# Run make testfailing
FAILINGTESTFILES = \
testDASSLnoEquidistant.mos \
Expand All @@ -33,8 +34,8 @@ test:
@echo
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) "
@$(TEST) $(TESTFILES)
# Cleans all files that are not listed as dependencies

# Cleans all files that are not listed as dependencies
clean :
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
@rm -f $(CLEAN)
Expand All @@ -43,11 +44,11 @@ clean :
# do it after cleaning and updating the folder
# then you can get a list of file names (which must be dependencies
# since you got them from repository + your own new files)
# then add them to the DEPENDENCIES. You can find the
# list in deps.txt
getdeps:
# then add them to the DEPENDENCIES. You can find the
# list in deps.txt
getdeps:
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
@echo Dependency list saved in deps.txt.
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES

Expand Down
26 changes: 26 additions & 0 deletions openmodelica/cruntime/simoptions/nlssMinSize.mos
@@ -0,0 +1,26 @@
// name: nlssMinSize
// status: correct

loadString("
model M
Real x,y;
equation
x*y = 10;
sqrt(x+1) + y = 6;
end M;
"); getErrorString();

simulate(M, simflags="-nlssMinSize=1"); getErrorString();

// Result:
// true
// ""
// record SimulationResult
// resultFile = "M_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'M', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = '-nlssMinSize=1'",
// messages = "stdout | info | Maximum system size for using non-linear sparse solver changed to 1
// "
// end SimulationResult;
// "Warning: There are iteration variables with default zero start attribute. For more information set -d=initialization. In OMEdit Tools->Options->Simulation->OMCFlags, in OMNotebook call setCommandLineOptions("-d=initialization").
// "
// endResult

0 comments on commit bc85cc1

Please sign in to comment.