Skip to content

Commit

Permalink
- Removed unused (duplicate) code
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7598 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 31, 2010
1 parent c8e185b commit 764b530
Showing 1 changed file with 0 additions and 89 deletions.
89 changes: 0 additions & 89 deletions Compiler/FrontEnd/InstSection.mo
Expand Up @@ -3721,95 +3721,6 @@ algorithm
end matchcontinue;
end flipDirection;

function handleStreamConnectors
"@author: adrpo
this function evaluates the inStream and actualStream builtin operators"
input Prefix.Prefix pre "prefix required for checking deleted components";
input Connect.Sets sets;
input DAE.DAElist inDAE;
output DAE.DAElist outDAE;
algorithm
outDAE := matchcontinue(pre, sets, inDAE)
local
DAE.DAElist dae;
list<DAE.Element> elems;
DAE.FunctionTree functions "set of functions";

case (pre, sets, dae)
equation
(dae,_,_) = DAEUtil.traverseDAE(dae, DAEUtil.emptyFuncTree, evalActualStream, sets);
(dae,_,_) = DAEUtil.traverseDAE(dae, DAEUtil.emptyFuncTree, evalInStream, sets);
then
dae;
end matchcontinue;
end handleStreamConnectors;

protected function evalActualStream
"@author: adrpo
this function evaluates the builtin operator actualStream.
See Modelica Specification 3.2, page 177"
input tuple<DAE.Exp,Connect.Sets> itpl;
output tuple<DAE.Exp,Connect.Sets> otpl;
algorithm
otpl := matchcontinue itpl
local
DAE.Exp exp,inExp;
Connect.Sets sets;
DAE.ComponentRef cref;
Boolean result;

// deal with actualStream
case ((inExp as DAE.CALL(path=Absyn.IDENT("actualStream"),
expLst={DAE.CREF(componentRef = cref)}), sets))
equation
// Modelica Specification 3.2, page 177, Section: 15.3 Stream Operator actualStream
// actualStream(port.h_outflow) = if port.m_flow > 0 then inStream(port.h_outflow)
// else port.h_outflow;
// we need to retrieve the flow variable associated with the stream variable here
// so that we can build the expression
exp = inExp;
then ((exp, sets));
// no replacement needed
case ((exp, sets))
then ((exp, sets));
end matchcontinue;
end evalActualStream;

protected function evalInStream
"@author: adrpo
this function evaluates the builtin operator inStream.
See Modelica Specification 3.2, page 176"
input tuple<DAE.Exp,Connect.Sets> itpl;
output tuple<DAE.Exp,Connect.Sets> otpl;
algorithm
otpl := matchcontinue itpl
local
DAE.Exp exp,inExp;
Connect.Sets sets;
DAE.ComponentRef cref;
Boolean result;

// deal with inStream
case ((inExp as DAE.CALL(path=Absyn.IDENT("inStream"),
expLst={DAE.CREF(componentRef = cref)}), sets))
equation
// Modelica Specification 3.2, page 176, Section: 15.2 Stream Operator inStream and Connection Equations
// N = 1, M = 0: unconnected stream
// inStream(m1.c.h_outflow) = m1.c.h_outflow;
// N = 2, M = 0: two connected inside streams
// inStream(m1.c.h_outflow) = m2.c.h_outflow;
// inStream(m2.c.h_outflow) = m1.c.h_outflow;
// N = 1, M = 1: one inside stream connected to one outside stream
// inStream(m1.c.h_outflow) = inStream(c1.h_outflow);
// // Additional equation to be generated
// c1.h_outflow = m1.c.h_outflow;
exp = inExp;
then ((exp, sets));
// no replacement needed
case ((exp, sets)) then ((exp, sets));
end matchcontinue;
end evalInStream;

protected function validConnector
"function: validConnector
This function tests whether a type is a eligible to be used in connections."
Expand Down

0 comments on commit 764b530

Please sign in to comment.