Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Conflicts:
	SimulationRuntime/cpp/Include/Core/SimController/ISimController.h
  • Loading branch information
RuedKamp committed Jul 3, 2015
2 parents 69ba949 + 26c02a2 commit c9ea075
Show file tree
Hide file tree
Showing 151 changed files with 19,509 additions and 21,277 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -141,6 +141,7 @@ Compiler/boot/LoadCompilerInterface.mos
Compiler/boot/Makefile
Compiler/boot/Makefile.depends
Compiler/boot/Makefile.sources
Compiler/boot/patches/*.patch
Compiler/runtime/Makefile
Compiler/runtime/config.unix.h
Compiler/runtime/omc_communication.cc
Expand Down
4 changes: 2 additions & 2 deletions Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -68,7 +68,7 @@ protected import HashTable;
protected import HashTableCrToExpSourceTpl;
protected import Inline;
protected import List;
protected import SimCodeUtil;
protected import SimCodeFunctionUtil;
protected import SCode;
protected import System;
protected import Types;
Expand Down Expand Up @@ -154,7 +154,7 @@ algorithm
neqStr := intString(BackendDAEUtil.equationSize(eqnarr));
nvarStr := intString(BackendVariable.varsSize(vars_1));
Error.assertionOrAddSourceMessage(not Flags.isSet(Flags.DUMP_BACKENDDAE_INFO),Error.BACKENDDAEINFO_LOWER,{neqStr,nvarStr},Absyn.dummyInfo);
SimCodeUtil.execStat("Generate backend data structure");
SimCodeFunctionUtil.execStat("Generate backend data structure");
end lower;

protected function lower2
Expand Down
2 changes: 0 additions & 2 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -70,12 +70,10 @@ protected import ExpressionSolve;
protected import ExpressionSimplify;
protected import Error;
protected import Flags;
protected import Graph;
protected import HashTableExpToIndex;
protected import List;
protected import RewriteRules;
protected import SCode;
protected import System;
protected import SynchronousFeatures;
protected import Types;
protected import Util;
Expand Down
66 changes: 33 additions & 33 deletions Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -42,13 +42,11 @@ encapsulated package BackendDAETransform
RCS: $Id$
"

public import Absyn;
public import BackendDAE;
public import DAE;

protected import BackendDAEUtil;
protected import BackendDump;
protected import BackendDAEOptimize;
protected import BackendEquation;
protected import BackendVariable;
protected import ComponentReference;
Expand All @@ -59,7 +57,6 @@ protected import Expression;
protected import ExpressionDump;
protected import Flags;
protected import List;
protected import Matching;
protected import SCode;
protected import Sorting;
protected import SymbolicJacobian;
Expand All @@ -82,32 +79,36 @@ public function strongComponentsScalar "author: PA
input array<Integer> mapIncRowEqn;
output BackendDAE.EqSystem outSystem;
output BackendDAE.StrongComponents outComps "list of components";
protected
list<list<Integer>> comps;
array<Integer> ass1, ass2;
BackendDAE.IncidenceMatrixT mt;
BackendDAE.EquationArray eqs;
BackendDAE.Variables vars;
array<Integer> markarray;
BackendDAE.StateSets stateSets;
BackendDAE.BaseClockPartitionKind partitionKind;
algorithm
try
BackendDAE.EQSYSTEM(vars, eqs, SOME(_), SOME(mt), BackendDAE.MATCHING(ass1=ass1, ass2=ass2), stateSets=stateSets, partitionKind=partitionKind) := inSystem;

comps := Sorting.TarjanTransposed(mt, ass2);
(outSystem, outComps) := matchcontinue inSystem
local
list<list<Integer>> comps_m;
array<Integer> ass1, ass2;
BackendDAE.IncidenceMatrixT mt;
BackendDAE.EquationArray eqs;
BackendDAE.Variables vars;
array<Integer> markarray;
BackendDAE.StrongComponents comps;
BackendDAE.EqSystem syst;
case syst as BackendDAE.EQSYSTEM(orderedEqs=eqs, m=SOME(_), mT=SOME(mt), matching=BackendDAE.MATCHING(ass1=ass1, ass2=ass2))
algorithm
comps_m := Sorting.TarjanTransposed(mt, ass2);

markarray := arrayCreate(BackendDAEUtil.equationArraySize(eqs), -1);
outComps := analyseStrongComponentsScalar(comps, inSystem, inShared, ass1, ass2, mapEqnIncRow, mapIncRowEqn, 1, markarray);
ass1 := varAssignmentNonScalar(ass1, mapIncRowEqn);
markarray := arrayCreate(BackendDAEUtil.equationArraySize(eqs), -1);
comps := analyseStrongComponentsScalar(comps_m, inSystem, inShared, ass1, ass2, mapEqnIncRow, mapIncRowEqn, 1, markarray);
ass1 := varAssignmentNonScalar(ass1, mapIncRowEqn);

// noscalass2 = eqnAssignmentNonScalar(1, arrayLength(mapEqnIncRow), mapEqnIncRow, ass2, {});
// Frenkel TUD: Do not hand over the scalar incidence Matrix because following modules does not check if scalar or not
outSystem := BackendDAE.EQSYSTEM(vars, eqs, NONE(), NONE(), BackendDAE.MATCHING(ass1, ass2, outComps), stateSets, partitionKind);
else
Error.addInternalError("function strongComponentsScalar failed (sorting strong components)", sourceInfo());
fail();
end try;
// noscalass2 = eqnAssignmentNonScalar(1, arrayLength(mapEqnIncRow), mapEqnIncRow, ass2, {});
// Frenkel TUD: Do not hand over the scalar incidence Matrix because following modules does not check if scalar or not
syst.m := NONE(); syst.mT := NONE(); syst.matching := BackendDAE.MATCHING(ass1, ass2, comps);
then
(syst, comps);
else
algorithm
Error.addInternalError("function strongComponentsScalar failed (sorting strong components)", sourceInfo());
then
fail();
end matchcontinue;
end strongComponentsScalar;

public function eqnAssignmentNonScalar
Expand Down Expand Up @@ -159,7 +160,6 @@ protected
BackendDAE.StrongComponent acomp;
Integer mark = imark;
algorithm

for comp in inComps loop
(acomp, mark) := analyseStrongComponentScalar(comp, syst, shared, inAss1, inAss2, mapEqnIncRow, mapIncRowEqn, mark, markarray);
outComps := acomp :: outComps;
Expand All @@ -181,12 +181,12 @@ protected function analyseStrongComponentScalar "author: Frenkel TUD 2011-05"
output BackendDAE.StrongComponent outComp;
output Integer omark = imark + 1;
protected
list<Integer> comp, vlst;
list<BackendDAE.Var> varlst;
list<tuple<BackendDAE.Var, Integer>> var_varindx_lst;
BackendDAE.Variables vars;
list<BackendDAE.Equation> eqn_lst;
BackendDAE.EquationArray eqns;
list<Integer> comp, vlst;
list<BackendDAE.Var> varlst;
list<tuple<BackendDAE.Var, Integer>> var_varindx_lst;
BackendDAE.Variables vars;
list<BackendDAE.Equation> eqn_lst;
BackendDAE.EquationArray eqns;
algorithm
try
BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns) := syst;
Expand Down

0 comments on commit c9ea075

Please sign in to comment.