Skip to content

Commit

Permalink
- add comments to flags, add flags
Browse files Browse the repository at this point in the history
- bugfix removesimpleequationspast
- update teststuite msl31/simulate
- add experiment annotation for M.M.Rotational.ElasticBearing

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11607 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Mar 29, 2012
1 parent 466b80d commit e0432ce
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 10 deletions.
41 changes: 37 additions & 4 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -646,6 +646,7 @@ algorithm
BackendDAE.SHARED(knownVars=knvars,externalObjects=eo,aliasVars=av,initialEqs=ieqns,removedEqs=reqns,
arrayEqs=ae,algorithms=al,complEqs=ce,eventInfo=BackendDAE.EVENT_INFO(wclst,zcl),extObjClasses=eoc,backendDAEType=bdaetype),derrepl)
equation
Debug.fcall(Flags.DUMP_DERREPL, BaseHashTable.dumpHashTable, derrepl);
n = BackendDAEUtil.equationSize(eqns);
deeqns = List.sort(deeqns,intGt);
(eqns1,ae1,al1,ce1,wclst1) = replaceDerEquations1(deeqns,0,n,derrepl,eqns,ae,al,ce,wclst);
Expand Down Expand Up @@ -903,6 +904,34 @@ algorithm
(_,i::_) = BackendVariable.getVar(cr, vars);
then (cr,i,es,syst,shared,newvars,newvars1,eqTy);
// a = der(b)
// a is a dummy_der_state
case ({var,var2},pos,eqn,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared,mvars,mavars)
equation
(cr2,cr,e2,es,negate) = BackendEquation.derivativeEquation(eqn);
// select candidate
((var::_),(k::_)) = BackendVariable.getVar(cr,vars);
((var2::_),(j::_)) = BackendVariable.getVar(cr2,vars);
true = BackendVariable.isDummyDerVar(var);
// because this is a self genererated var we need not check for uncertainities
//false = BackendVariable.varHasUncertainValueRefine(var);
(syst,shared,newvars) = selectAlias2(cr,cr2,var,var2,es,e2,syst,shared,mavars,negate,BackendEquation.equationSource(eqn));
then (cr,k,es,syst,shared,mvars,newvars,1);
// a = der(b)
// a is not a state
/* Frenkel TUD: -because we have no way to store the min,max,nominval,start attribute for der(state) variables we cannot replace
this simple equations. */
/*case ({var,var2},pos,eqn,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared,mvars,mavars)
equation
(cr2,cr,e2,es,negate) = BackendEquation.derivativeEquation(eqn);
// select candidate
((var::_),(k::_)) = BackendVariable.getVar(cr,vars);
((var2::_),(j::_)) = BackendVariable.getVar(cr2,vars);
false = BackendVariable.varHasUncertainValueRefine(var);
replaceableAlias(var);
(syst,shared,newvars) = selectAlias2(cr,cr2,var,var2,es,e2,syst,shared,mavars,negate,,BackendEquation.equationSource(eqn));
then (cr,k,es,syst,shared,mvars,newvars,1);
*/
// a = der(b)
case ({var,var2},pos,eqn,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared,mvars,mavars)
equation
(cr,_,es,_,negate) = BackendEquation.derivativeEquation(eqn);
Expand Down Expand Up @@ -999,12 +1028,13 @@ algorithm
equation
// equations of var
vareqns = mT[i];
vareqns1 = List.removeOnTrue(0, intLt, vareqns);
derrepl = BaseHashTable.add((cr,exp),derrepl);
vareqns1 = List.removeOnTrue(0, intGt, vareqns);
pos_1 = pos - 1;
vareqns1 = List.removeOnTrue(pos, intEq, vareqns1);
derrepl = BaseHashTable.add((cr,exp),derrepl);
vareqns2 = List.intersectionOnTrue(vareqns1, comp, intEq);
// replace der(a)=b in vareqns
(syst,shared) = replacementsInEqns2(vareqns2,exp,cr,syst,shared);
(syst,shared) = replacementsInEqns2(vareqns1,exp,cr,syst,shared);
// update IncidenceMatrix
syst= BackendDAEUtil.updateIncidenceMatrix(syst,shared,vareqns2);
then (vareqns1,syst,shared,repl,derrepl,pos_1::deeqns,meqns);
Expand Down Expand Up @@ -3231,9 +3261,12 @@ algorithm
end matchcontinue;
end replaceFinalVarTraverser;

/*
* remove paramters stuff
*/

public function removeParameters
"function: removeFinalParameters
"function: removeParameters
autor wbraun"
input BackendDAE.BackendDAE inDAE;
input DAE.FunctionTree inFunctionTree;
Expand Down
19 changes: 13 additions & 6 deletions Compiler/Util/Flags.mo
Expand Up @@ -268,15 +268,15 @@ constant DebugFlag INTERACTIVE_DUMP = DEBUG_FLAG(52, "interactivedump",
constant DebugFlag RELIDX = DEBUG_FLAG(53, "relidx",
"");
constant DebugFlag DUMP_REPL = DEBUG_FLAG(54, "dumprepl",
"");
"dump the found replacments for remove simple equation");
constant DebugFlag DUMP_FP_REPL = DEBUG_FLAG(55, "dumpFPrepl",
"");
"dump the found replacements for final parameters");
constant DebugFlag DUMP_PARAM_REPL = DEBUG_FLAG(56, "dumpParamrepl",
"");
"dump the found replacements for remove parameters");
constant DebugFlag DUMP_PP_REPL = DEBUG_FLAG(57, "dumpPPrepl",
"");
"dump the found replacements for protected parameters");
constant DebugFlag DEBUG_ALIAS = DEBUG_FLAG(58, "debugAlias",
"");
"dump the found alias variables");
constant DebugFlag TEARING_DUMP = DEBUG_FLAG(59, "tearingdump",
"Dumps tearing information.");
constant DebugFlag JAC_DUMP = DEBUG_FLAG(60, "jacdump",
Expand Down Expand Up @@ -347,6 +347,11 @@ constant DebugFlag GEN_DEBUG_SYMBOLS = DEBUG_FLAG(92, "gendebugsymbols",
"Generate code with debugging symbols.");
constant DebugFlag DUMP_STATESELECTION_INFO = DEBUG_FLAG(93, "stateselection",
"Enables dumping of selected states. Works only in combination with backenddaeinfo.");
constant DebugFlag DUMP_DERREPL = DEBUG_FLAG(94, "dumpderrepl",
"Enables dumping of selected states. Works only in combination with backenddaeinfo.");
constant DebugFlag DUMP_EQNINORDER = DEBUG_FLAG(95, "dumpeqninorder",
"Enables dumping of the equations in the order they are calculated");


// This is a list of all debug flags, to keep track of which flags are used. A
// flag can not be used unless it's in this list, and the list is checked at
Expand Down Expand Up @@ -445,7 +450,9 @@ constant list<DebugFlag> allDebugFlags = {
WRITE_TO_BUFFER,
DUMP_BACKENDDAE_INFO,
GEN_DEBUG_SYMBOLS,
DUMP_STATESELECTION_INFO
DUMP_STATESELECTION_INFO,
DUMP_DERREPL,
DUMP_EQNINORDER
};

// CONFIGURATION FLAGS
Expand Down

0 comments on commit e0432ce

Please sign in to comment.