Skip to content

Commit

Permalink
- Do not generate duplicate statements for functionAliasEquation when…
Browse files Browse the repository at this point in the history
… partitioning independent equation systems

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10087 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 11, 2011
1 parent 692c5cc commit 9cd410a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Compiler/BackEnd/SimCode.mo
Expand Up @@ -2123,6 +2123,8 @@ algorithm
BackendDAE.EqSystem syst;
BackendDAE.EqSystems systs;
BackendDAE.Shared shared;
BackendDAE.EquationArray removedEqs;
array<DAE.Algorithm> algs;

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

(helpVarInfo,dlow2,sampleEqns) = generateHelpVarInfo(dlow);
(dlow2 as BackendDAE.DAE(systs,shared)) = BackendDAEUtil.checkInitialSystem(dlow2,functionTree);
(dlow2 as BackendDAE.DAE(systs,shared as BackendDAE.SHARED(removedEqs=removedEqs,algorithms=algs))) = BackendDAEUtil.checkInitialSystem(dlow2,functionTree);

residualEquations = createResidualEquations(dlow2);
nres = listLength(residualEquations);
Expand All @@ -2154,6 +2156,8 @@ algorithm
initialEquations = BackendDAEUtil.foldEqSystem(dlow2,createInitialEquations,{});
parameterEquations = BackendDAEUtil.foldEqSystem(dlow2,createParameterEquations,{});
removedEquations = BackendDAEUtil.foldEqSystem(dlow2,createRemovedEquations,{});
((removedEquations,_)) = BackendEquation.traverseBackendDAEEqns(removedEqs,traversedlowEqToSimEqSystem,(removedEquations,algs));

algorithmAndEquationAsserts = BackendDAEUtil.foldEqSystem(dlow2,createAlgorithmAndEquationAsserts,{});
discreteModelVars = BackendDAEUtil.foldEqSystem(dlow2,extractDiscreteModelVars,{});
makefileParams = createMakefileParams(externalFunctionIncludes,libs);
Expand Down Expand Up @@ -3324,14 +3328,12 @@ algorithm

case (BackendDAE.EQSYSTEM(orderedVars = vars), BackendDAE.SHARED(removedEqs=r,algorithms=algs), acc)
equation
((removedEquations,_)) = BackendEquation.traverseBackendDAEEqns(r,traversedlowEqToSimEqSystem,({},algs));

// get minmax and nominal asserts
varasserts = BackendVariable.traverseBackendDAEVars(vars,createVarMinMaxAssert,{});
simvarasserts = List.map(varasserts,dlowAlgToSimEqSystem);
removedEquations = listAppend(removedEquations, simvarasserts);
removedEquations = listAppend(simvarasserts,acc);

then listAppend(removedEquations,acc);
then removedEquations;
else
equation
Error.addMessage(Error.INTERNAL_ERROR,{"createRemovedEquations failed"});
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -438,8 +438,8 @@ OpenModelica specifics:
<p>
When OpenModelica does not have a prefix (e.g. in functions or packages),
it returns is the name of the model that is simulated suffixed by
<pre><Prefix.NOPRE()></pre>, i.e. <pre>Vehicle.<Prefix.NOPRE()></pre>.
it returns the name of the model that is simulated suffixed by
<pre><Prefix.NOPRE()></pre>, e.g. <pre>Vehicle.<Prefix.NOPRE()></pre>.
</p>
<p>
Expand Down

0 comments on commit 9cd410a

Please sign in to comment.