Skip to content

Commit

Permalink
Save the options file for the FMI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Jan 19, 2017
1 parent 03778b0 commit 2a58330
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
13 changes: 8 additions & 5 deletions special/FmuExportCrossCompile/fmu-run.sh
Expand Up @@ -53,7 +53,9 @@ for t in me cs; do
esac
CMD=`echo $CMD -c , -f -n 2000 -d -k $t -e "$DIR/$1_cc.log" -o "$DIR/$1_cc.csv" "$DIR/$1.fmu"`
cp "$1.fmu" "$DIR/" || exit 1
cp "$1_ref.opt" "$DIR/" || exit 1
echo CMD > "$DIR/$1_cc.bat" || exit 1
cp "$DIR/$1_cc.bat" "$DIR/$1_cc.sh" || exit 1
bash -c "$CMD" || exit 1

cp "$DIR/$1_cc.csv" "$1-$a-$t.csv" || exit 1
Expand All @@ -71,11 +73,12 @@ for t in me cs; do
DIR="./Test_FMUs/FMI_2.0/$d/$a/OpenModelica/$VERSION/$1"
mkdir -p "$DIR"
CMD=`echo fmuCheck.$a -c , -f -n 2000 -d -k $t -e "$DIR/$1_cc.log" -o "$DIR/$1_cc.csv" "$DIR/$1.fmu"`
cp "$1.fmu" "$DIR/"
cp "$DIR/$DIR/$1_cc.csv" "$1-$a-$t.csv"
cp "$1_res.mat" "$DIR/$1_ref.mat"
cp "ReadMe.txt" "$DIR/"
echo CMD > "$DIR/$1_cc.bat"
cp "$1.fmu" "$DIR/" || exit 1
cp "$1_ref.opt" "$DIR/" || exit 1
cp "$DIR/$1_cc.csv" "$1-$a-$t.csv" || exit 1
cp "$1_res.csv" "$DIR/$1_ref.csv" || exit 1
cp "ReadMe.txt" "$DIR/" || exit 1
echo "$CMD" > "$DIR/$1_cc.bat" || exit 1
done
done

Expand Down
9 changes: 8 additions & 1 deletion special/FmuExportCrossCompile/fmuExportCrossCompile.mos
Expand Up @@ -58,7 +58,8 @@ for c in {"FmuExportCrossCompile","RoomHeating_OM.RH","WaterTank.Control","Water
print(c2+"
");
writeFile("test.mos", "
res := buildModel("+c+", method=\"euler\", outputFormat=\"csv\", fileNamePrefix=c2); getErrorString();
(start,stop,tolerance,numberOfIntervals,interval) := getSimulationOptions("+c+");
res := buildModel("+c+", method=\"euler\", numberOfIntervals=2000, outputFormat=\"csv\", fileNamePrefix=c2); getErrorString();
print(getErrorString()+\"
\");
b := buildModelFMU("+c+", fileNamePrefix=c2, version=\"2.0\", fmuType=\"me_cs\", platforms=platforms);
Expand All @@ -74,5 +75,11 @@ for c in {"FmuExportCrossCompile","RoomHeating_OM.RH","WaterTank.Control","Water
if r=="Failed" then
exit(1);
end if;
writeFile(c+"_ref.opt", "StartTime, "+String(start)+"
StopTime, "+String(stop)+"
StepSize, "+String((stop-start)/2000)+"
RelTol, "+String(tolerance)+"
SolverType, euler
");
print(r);
end for;

0 comments on commit 2a58330

Please sign in to comment.