Skip to content

Commit

Permalink
- added for evaluation of actualStream-operator smooth(0, exp)
Browse files Browse the repository at this point in the history
   - actualStream-Operator should not generate events


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18515 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Dec 18, 2013
1 parent f4fbe8c commit fd504b6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Compiler/FrontEnd/ConnectUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2998,14 +2998,14 @@ algorithm
expLst = {DAE.CREF(componentRef = cr, ty = ty)}), sets))
equation
e = evaluateInStream(cr, sets);
// print("Evaluated inStream(" +& ExpressionDump.dumpExpStr(DAE.CREF(cr, ty), 0) +& ") ->\n" +& ExpressionDump.dumpExpStr(e, 0) +& "\n");
//print("Evaluated inStream(" +& ExpressionDump.dumpExpStr(DAE.CREF(cr, ty), 0) +& ") ->\n" +& ExpressionDump.dumpExpStr(e, 0) +& "\n");
then
((e, sets));
case ((DAE.CALL(path = Absyn.IDENT("actualStream"),
expLst = {DAE.CREF(componentRef = cr, ty = ty)}), sets))
equation
e = evaluateActualStream(cr, sets);
// print("Evaluated actualStream(" +& ExpressionDump.dumpExpStr(DAE.CREF(cr, ty), 0) +& ") ->\n" +& ExpressionDump.dumpExpStr(e, 0) +& "\n");
//print("Evaluated actualStream(" +& ExpressionDump.dumpExpStr(DAE.CREF(cr, ty), 0) +& ") ->\n" +& ExpressionDump.dumpExpStr(e, 0) +& "\n");
then
((e, sets));

Expand Down Expand Up @@ -3179,10 +3179,11 @@ algorithm
flow_exp = Expression.crefExp(flow_cr);
stream_exp = Expression.crefExp(inStreamCref);
instream_exp = evaluateInStream(inStreamCref, inSets);
// actualStream(stream_var) = if flow_var > 0 then inStream(stream_var)
// else stream_var;
e = DAE.IFEXP(DAE.RELATION(flow_exp, DAE.GREATER(ety), DAE.RCONST(0.0),-1,NONE()),
instream_exp, stream_exp);
// actualStream(stream_var) = smooth(0, if flow_var > 0 then inStream(stream_var)
// else stream_var);
e = DAE.CALL(Absyn.IDENT("smooth"), {DAE.ICONST(0),
DAE.IFEXP(DAE.RELATION(flow_exp, DAE.GREATER(ety), DAE.RCONST(0.0),-1,NONE()),
instream_exp, stream_exp)}, DAE.callAttrBuiltinReal);
then
e;
end match;
Expand Down

0 comments on commit fd504b6

Please sign in to comment.