Skip to content

Commit

Permalink
Remove FindZeroCrossings getters functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gossen authored and OpenModelica-Hudson committed Jul 10, 2015
1 parent e728806 commit 9116d28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 deletions.
27 changes: 0 additions & 27 deletions Compiler/BackEnd/FindZeroCrossings.mo
Expand Up @@ -58,33 +58,6 @@ protected import HashTableExpToIndex;
protected import List;
protected import Util;

// =============================================================================
// section for some public util functions
//
// =============================================================================

public function getZeroCrossings
input BackendDAE.BackendDAE inBackendDAE;
output list<BackendDAE.ZeroCrossing> outZeroCrossingList;
algorithm
BackendDAE.DAE(shared=BackendDAE.SHARED(eventInfo=BackendDAE.EVENT_INFO(zeroCrossingLst=outZeroCrossingList))) := inBackendDAE;
end getZeroCrossings;

public function getRelations
input BackendDAE.BackendDAE inBackendDAE;
output list<BackendDAE.ZeroCrossing> outZeroCrossingList;
algorithm
BackendDAE.DAE(shared=BackendDAE.SHARED(eventInfo=BackendDAE.EVENT_INFO(relationsLst=outZeroCrossingList))) := inBackendDAE;
end getRelations;

public function getSamples "deprecated - use EVENT_INFO.timeEvents instead"
input BackendDAE.BackendDAE inBackendDAE;
output list<BackendDAE.ZeroCrossing> outZeroCrossingList;
algorithm
BackendDAE.DAE(shared=BackendDAE.SHARED(eventInfo=BackendDAE.EVENT_INFO(sampleLst=outZeroCrossingList))) := inBackendDAE;
end getSamples;


// =============================================================================
// section for preOptModule >>encapsulateWhenConditions<<
//
Expand Down
21 changes: 11 additions & 10 deletions Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -163,7 +163,6 @@ public function createSimCode "entry point to create SimCode from BackendDAE."
protected
BackendDAE.BackendDAE dlow;
BackendDAE.BackendDAE initDAE;
BackendDAE.EqSystems systs;
BackendDAE.EquationArray removedEqs;
BackendDAE.Shared shared;
BackendDAE.SymbolicJacobians symJacs;
Expand Down Expand Up @@ -215,6 +214,7 @@ protected
list<list<SimCode.SimEqSystem>> odeEquations; // --> functionODE
list<tuple<Integer, tuple<DAE.Exp, DAE.Exp, DAE.Exp>>> delayedExps;
list<tuple<Integer,Integer>> equationSccMapping, eqBackendSimCodeMapping;
BackendDAE.EventInfo eventInfo;
algorithm
try
dlow := inBackendDAE;
Expand Down Expand Up @@ -258,19 +258,20 @@ algorithm
dlow := BackendDAEOptimize.addInitialStmtsToAlgorithms(dlow);

BackendDAE.DAE(shared=shared as BackendDAE.SHARED(knownVars=knownVars,
removedEqs=removedEqs,
constraints=constraints,
classAttrs=classAttributes,
removedEqs=removedEqs,
symjacs=symJacs,
partitionsInfo=BackendDAE.PARTITIONS_INFO(baseClocks),
eventInfo=BackendDAE.EVENT_INFO(timeEvents=timeEvents))) := dlow;

// created event suff e.g. zeroCrossings, samples, ...
whenClauses := createSimWhenClauses(dlow);
zeroCrossings := if ifcpp then FindZeroCrossings.getRelations(dlow) else FindZeroCrossings.getZeroCrossings(dlow);
relations := FindZeroCrossings.getRelations(dlow);
sampleZC := FindZeroCrossings.getSamples(dlow);
zeroCrossings := if ifcpp then listAppend(zeroCrossings, sampleZC) else zeroCrossings;
eventInfo=eventInfo)) := dlow;

// created event suff e.g. zeroCrossings, samples, ...
timeEvents := eventInfo.timeEvents;
whenClauses := createSimWhenClauses(dlow);
zeroCrossings := if ifcpp then eventInfo.relationsLst else eventInfo.zeroCrossingLst;
relations := eventInfo.relationsLst;
sampleZC := eventInfo.sampleLst;
zeroCrossings := if ifcpp then listAppend(zeroCrossings, sampleZC) else zeroCrossings;

// equation generation for euler, dassl2, rungekutta
( uniqueEqIndex, odeEquations, algebraicEquations, allEquations, equationsForZeroCrossings, tempvars,
Expand Down

0 comments on commit 9116d28

Please sign in to comment.