Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Remove $_initialGuess(.)
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel authored and OpenModelica-Hudson committed Mar 31, 2017
1 parent 495a973 commit 78b18d8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
1 change: 0 additions & 1 deletion Compiler/BackEnd/CommonSubExpression.mo
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,6 @@ algorithm
local
Absyn.Path path;
case DAE.ASUB() then true;
case DAE.CALL(path=Absyn.IDENT("$_initialGuess")) then true;
case DAE.CALL(path=Absyn.IDENT("$_old")) then true;
case DAE.CALL(path=Absyn.IDENT("$_round")) then true;
case DAE.CALL(path=Absyn.IDENT("$getPart")) then true;
Expand Down
14 changes: 5 additions & 9 deletions Compiler/BackEnd/ExpressionSolve.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1942,10 +1942,10 @@ protected function makeIntialGuess
protected
DAE.Exp con, e;
algorithm
con := Expression.makePureBuiltinCall("initial",{},tp);
(e,_) := Expression.traverseExpBottomUp(iExp2,makeIntialGuess2,(iExp3, DAE.startNamePrefix, tp, true));
(oExp,_) := Expression.traverseExpBottomUp(iExp2,makeIntialGuess2,(iExp3, "$_initialGuess",tp,false));
oExp := DAE.IFEXP(con,e,oExp);
con := Expression.makePureBuiltinCall("initial", {}, tp);
e := Expression.traverseExpBottomUp(iExp2, makeIntialGuess2, (iExp3, "pre", tp, true));
oExp := Expression.traverseExpBottomUp(iExp2, makeIntialGuess2, (iExp3, "pre", tp, false));
oExp := DAE.IFEXP(con, e, oExp);
end makeIntialGuess;

protected function makeIntialGuess2
Expand All @@ -1963,11 +1963,7 @@ algorithm

case (DAE.CREF(componentRef=cr1), (DAE.CREF(componentRef=cr2), fun, tp, _))
guard(ComponentReference.crefEqual(cr1, cr2)) algorithm
if fun == DAE.startNamePrefix then
e := Expression.crefExp(ComponentReference.crefPrefixStart(cr1));
else
e := Expression.makePureBuiltinCall(fun, {iExp}, tp);
end if;
e := Expression.makePureBuiltinCall(fun, {iExp}, tp);
then e;

case (_, (_, _, tp, true)) algorithm
Expand Down
2 changes: 0 additions & 2 deletions Compiler/FrontEnd/Expression.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6636,8 +6636,6 @@ algorithm
then (inExp,false,inTpl);
case (DAE.CALL(path = Absyn.IDENT(name = "edge")), _)
then (inExp,false,inTpl);
case (DAE.CALL(path = Absyn.IDENT(name = "$_initialGuess")), _)
then (inExp,false,inTpl);
case (DAE.CALL(path = Absyn.IDENT(name = "$_round")), _)
then (inExp,false,inTpl);
case (DAE.CALL(path = Absyn.IDENT(name = "$_old")), _)
Expand Down
4 changes: 0 additions & 4 deletions Compiler/Template/CodegenCFunctions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5544,10 +5544,6 @@ template daeExpCall(Exp call, Context context, Text &preExp, Text &varDecls, Tex
'(data->simulationInfo->clocksData[clockIndex].cnt == 0)'
case CALL(path=IDENT(name="$_clkfire"), expLst={arg as ICONST(__)}) then
'fireClock(data, threadData, <%intSub(arg.integer,1)%>, data->localData[0]->timeValue)'
// a $_initialGuess is used to get initial guess for nonlinear solver
case CALL(path=IDENT(name="$_initialGuess"), expLst={arg as CREF(__)}) then
let namestr = cref(arg.componentRef)
'( <%namestr%>)' //
case CALL(path=IDENT(name="$_old"), expLst={arg as CREF(__)}) then
crefOld(arg.componentRef,1)
// if arg >= 0 then 1 else -1
Expand Down

0 comments on commit 78b18d8

Please sign in to comment.