Skip to content

Commit 9cd410a

Browse files
committed
- Do not generate duplicate statements for functionAliasEquation when partitioning independent equation systems
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10087 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 692c5cc commit 9cd410a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Compiler/BackEnd/SimCode.mo

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,6 +2123,8 @@ algorithm
21232123
BackendDAE.EqSystem syst;
21242124
BackendDAE.EqSystems systs;
21252125
BackendDAE.Shared shared;
2126+
BackendDAE.EquationArray removedEqs;
2127+
array<DAE.Algorithm> algs;
21262128

21272129
case (functionTree,dlow,class_,filenamePrefix,fileDir,functions,externalFunctionIncludes,includeDirs,libs,simSettingsOpt,recordDecls,literals)
21282130
equation
@@ -2131,7 +2133,7 @@ algorithm
21312133
cname = Absyn.pathStringNoQual(class_);
21322134

21332135
(helpVarInfo,dlow2,sampleEqns) = generateHelpVarInfo(dlow);
2134-
(dlow2 as BackendDAE.DAE(systs,shared)) = BackendDAEUtil.checkInitialSystem(dlow2,functionTree);
2136+
(dlow2 as BackendDAE.DAE(systs,shared as BackendDAE.SHARED(removedEqs=removedEqs,algorithms=algs))) = BackendDAEUtil.checkInitialSystem(dlow2,functionTree);
21352137

21362138
residualEquations = createResidualEquations(dlow2);
21372139
nres = listLength(residualEquations);
@@ -2154,6 +2156,8 @@ algorithm
21542156
initialEquations = BackendDAEUtil.foldEqSystem(dlow2,createInitialEquations,{});
21552157
parameterEquations = BackendDAEUtil.foldEqSystem(dlow2,createParameterEquations,{});
21562158
removedEquations = BackendDAEUtil.foldEqSystem(dlow2,createRemovedEquations,{});
2159+
((removedEquations,_)) = BackendEquation.traverseBackendDAEEqns(removedEqs,traversedlowEqToSimEqSystem,(removedEquations,algs));
2160+
21572161
algorithmAndEquationAsserts = BackendDAEUtil.foldEqSystem(dlow2,createAlgorithmAndEquationAsserts,{});
21582162
discreteModelVars = BackendDAEUtil.foldEqSystem(dlow2,extractDiscreteModelVars,{});
21592163
makefileParams = createMakefileParams(externalFunctionIncludes,libs);
@@ -3324,14 +3328,12 @@ algorithm
33243328

33253329
case (BackendDAE.EQSYSTEM(orderedVars = vars), BackendDAE.SHARED(removedEqs=r,algorithms=algs), acc)
33263330
equation
3327-
((removedEquations,_)) = BackendEquation.traverseBackendDAEEqns(r,traversedlowEqToSimEqSystem,({},algs));
3328-
33293331
// get minmax and nominal asserts
33303332
varasserts = BackendVariable.traverseBackendDAEVars(vars,createVarMinMaxAssert,{});
33313333
simvarasserts = List.map(varasserts,dlowAlgToSimEqSystem);
3332-
removedEquations = listAppend(removedEquations, simvarasserts);
3334+
removedEquations = listAppend(simvarasserts,acc);
33333335

3334-
then listAppend(removedEquations,acc);
3336+
then removedEquations;
33353337
else
33363338
equation
33373339
Error.addMessage(Error.INTERNAL_ERROR,{"createRemovedEquations failed"});

Compiler/FrontEnd/ModelicaBuiltin.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ OpenModelica specifics:
438438
439439
<p>
440440
When OpenModelica does not have a prefix (e.g. in functions or packages),
441-
it returns is the name of the model that is simulated suffixed by
442-
<pre><Prefix.NOPRE()></pre>, i.e. <pre>Vehicle.<Prefix.NOPRE()></pre>.
441+
it returns the name of the model that is simulated suffixed by
442+
<pre><Prefix.NOPRE()></pre>, e.g. <pre>Vehicle.<Prefix.NOPRE()></pre>.
443443
</p>
444444
445445
<p>

0 commit comments

Comments
 (0)