From 7e9cf326d4871c6807d5a229f6910c0e93daa4d8 Mon Sep 17 00:00:00 2001 From: AnHeuermann Date: Mon, 1 Feb 2021 14:52:35 +0100 Subject: [PATCH] Fixing minimalTearing - Reversing lists that should be reversed so that equations and jacobians are in the same order - Fixing wrong print for minimalTearing --- OMCompiler/Compiler/BackEnd/Tearing.mo | 6 +++--- testsuite/simulation/modelica/tearing/Tearing18-minimal.mos | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OMCompiler/Compiler/BackEnd/Tearing.mo b/OMCompiler/Compiler/BackEnd/Tearing.mo index 22bbe0e18fe..90600897399 100644 --- a/OMCompiler/Compiler/BackEnd/Tearing.mo +++ b/OMCompiler/Compiler/BackEnd/Tearing.mo @@ -159,7 +159,7 @@ protected function callTearingMethod input BackendDAE.Shared ishared; input list eindex; input list vindx; - input Option>> ojac; + input BackendDAE.FullJacobian ojac; input BackendDAE.JacobianType jacType; input Boolean mixedSystem; input Integer strongComponentIndex; @@ -221,7 +221,7 @@ algorithm case MINIMAL_TEARING() algorithm if Flags.isSet(Flags.TEARING_DUMP) or Flags.isSet(Flags.TEARING_DUMPVERBOSE) then - print("\nTearing type: total\n"); + print("\nTearing type: minimal\n"); end if; ocomp := minimalTearing(isyst, ishared, eindex, vindx, jacType, mixedSystem); if debug then execStat("Tearing.minimalTearing"); end if; @@ -1853,7 +1853,7 @@ try // dumpTearingSetGlobalIndexes(BackendDAE.TEARINGSET(iterationVars, residualequations, listReverse(innerEquations), BackendDAE.EMPTY_JACOBIAN()),size," - STRICT SET"); // Return torn system - ocomp := BackendDAE.TORNSYSTEM(BackendDAE.TEARINGSET(iterationVars, residualequations, listReverse(innerEquations), BackendDAE.EMPTY_JACOBIAN()), NONE(), linear, mixedSystem); + ocomp := BackendDAE.TORNSYSTEM(BackendDAE.TEARINGSET(listReverse(iterationVars), listReverse(residualequations), listReverse(innerEquations), BackendDAE.EMPTY_JACOBIAN()), NONE(), linear, mixedSystem); else Error.addInternalError("function minimalTearing failed", sourceInfo()); fail(); diff --git a/testsuite/simulation/modelica/tearing/Tearing18-minimal.mos b/testsuite/simulation/modelica/tearing/Tearing18-minimal.mos index 8e81b85cb66..4556910f0b7 100644 --- a/testsuite/simulation/modelica/tearing/Tearing18-minimal.mos +++ b/testsuite/simulation/modelica/tearing/Tearing18-minimal.mos @@ -29,7 +29,7 @@ val(x8,1.0); getErrorString(); // resultFile = "Tearing18_res.mat", // simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Tearing18', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", // messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method. -// assert | debug | Solving non-linear system 34 failed at time=0.246. +// assert | debug | Solving non-linear system 34 failed at time=0.086. // | | | | For more information please use -lv LOG_NLS. // stdout | warning | Integrator attempt to handle a problem with a called assert. // LOG_SUCCESS | info | The simulation finished successfully.