From 67e5538616f34bb9e69032cc0d7a04fff4d81b43 Mon Sep 17 00:00:00 2001 From: Willi Braun Date: Thu, 28 Oct 2010 14:03:35 +0000 Subject: [PATCH] - renamed uniontype DAELow to BackendDAE - renamed record DAELOW to DAE git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/sjoelund-functiontree@6687 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/Algorithm.mo | 2 +- Compiler/BackendDAE.mo | 14 +- Compiler/BackendDAECreate.mo | 26 +- Compiler/BackendDAEOptimize.mo | 74 +++--- Compiler/BackendDAETransform.mo | 208 ++++++++-------- Compiler/BackendDAEUtil.mo | 268 ++++++++++---------- Compiler/BackendDump.mo | 68 ++--- Compiler/BackendEquation.mo | 12 +- Compiler/BackendVarTransform.mo | 24 +- Compiler/BackendVariable.mo | 12 +- Compiler/CevalScript.mo | 46 ++-- Compiler/ComponentReference.mo | 2 +- Compiler/DAEEXT.mo | 2 +- Compiler/DAELow_stub.mo | 50 ---- Compiler/DAEQuery.mo | 20 +- Compiler/Derive.mo | 2 +- Compiler/Derive_stub.mo | 2 +- Compiler/Inline.mo | 10 +- Compiler/Inst.mo | 4 +- Compiler/Linearization.mo | 42 ++-- Compiler/Main.mo | 18 +- Compiler/PartFn.mo | 30 +-- Compiler/SimCode.mo | 428 ++++++++++++++++---------------- Compiler/TaskGraph.mo | 62 ++--- Compiler/XMLDump.mo | 32 +-- 25 files changed, 704 insertions(+), 754 deletions(-) delete mode 100644 Compiler/DAELow_stub.mo diff --git a/Compiler/Algorithm.mo b/Compiler/Algorithm.mo index 5cf77066614..02a04835f8c 100644 --- a/Compiler/Algorithm.mo +++ b/Compiler/Algorithm.mo @@ -254,7 +254,7 @@ algorithm t = getPropExpType(lhprop); then DAE.STMT_ASSIGN(t,DAE.CREF(c,crt),rhs_1,source); - /* TODO: Use this when we have fixed states in DAELow .lower(...) + /* TODO: Use this when we have fixed states in BackendDAE .lower(...) case (e1 as DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(_,_)},_,_,_),lhprop,rhs,rhprop) equation (rhs_1,_) = Types.matchProp(rhs, rhprop, lhprop); diff --git a/Compiler/BackendDAE.mo b/Compiler/BackendDAE.mo index c858fce091e..ee03b6986ef 100644 --- a/Compiler/BackendDAE.mo +++ b/Compiler/BackendDAE.mo @@ -34,7 +34,7 @@ package BackendDAE package: BackendDAE description: BackendDAE contains the datatypes used by the backend. - RCS: $Id: DAELow.mo 6540 2010-10-22 21:07:52Z sjoelund.se $ + RCS: $Id: BackendDAE.mo 6540 2010-10-22 21:07:52Z sjoelund.se $ " public import Absyn; @@ -47,7 +47,7 @@ public constant String derivativeNamePrefix="$DER"; public constant String partialDerivativeNamePrefix="$pDER"; public uniontype Type " -Once we are in DAELow, the Type can be only basic types or enumeration. +Once we are in BackendDAE, the Type can be only basic types or enumeration. We cannot do this in DAE because functions may contain many more types." record REAL end REAL; record INT end INT; @@ -211,14 +211,14 @@ uniontype EventInfo "- EventInfo" end EventInfo; public -uniontype DAELow "THE LOWERED DAE consist of variables and equations. The variables are split into +uniontype BackendDAE "THE LOWERED DAE consist of variables and equations. The variables are split into two lists, one for unknown variables states and algebraic and one for known variables constants and parameters. The equations are also split into two lists, one with simple equations, a=b, a-b=0, etc., that are removed from the set of equations to speed up calculations. - - DAELow" - record DAELOW + - BackendDAE" + record DAE Variables orderedVars "orderedVars ; ordered Variables, only states and alg. vars" ; Variables knownVars "knownVars ; Known variables, i.e. constants and parameters" ; Variables externalObjects "External object variables"; @@ -230,9 +230,9 @@ uniontype DAELow "THE LOWERED DAE consist of variables and equations. The variab array algorithms "algorithms ; Algorithms" ; EventInfo eventInfo "eventInfo" ; ExternalObjectClasses extObjClasses "classes of external objects, contains constructor & destructor"; - end DAELOW; + end DAE; -end DAELow; +end BackendDAE; type ExternalObjectClasses = list "classes of external objects stored in list"; diff --git a/Compiler/BackendDAECreate.mo b/Compiler/BackendDAECreate.mo index 36ac8d22457..ea225c7ecf5 100644 --- a/Compiler/BackendDAECreate.mo +++ b/Compiler/BackendDAECreate.mo @@ -67,8 +67,8 @@ protected import Values; public function lower "function: lower This function translates a DAE, which is the result from instantiating a - class, into a more precise form, called BackendDAE.DAELow defined in this module. - The BackendDAE.DAELow representation splits the DAE into equations and variables + class, into a more precise form, called BackendDAE.BackendDAE defined in this module. + The BackendDAE.BackendDAE representation splits the DAE into equations and variables and further divides variables into known and unknown variables and the equations into simple and nonsimple equations. The variables are inserted into a hash table. This gives a lookup cost of @@ -76,15 +76,15 @@ public function lower array. Where adding a new equation can be done in O(1) time if space is available. inputs: daeList: DAE.DAElist, simplify: bool) - outputs: BackendDAE.DAELow" + outputs: BackendDAE.BackendDAE" input DAE.DAElist lst; input DAE.FunctionTree functionTree; input Boolean addDummyDerivativeIfNeeded; input Boolean simplify; // input Boolean removeTrivEqs "temporal input, for legacy purposes; doesn't add trivial equations to removed equations"; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; algorithm - outDAELow := matchcontinue(lst, functionTree, addDummyDerivativeIfNeeded, simplify) + outBackendDAE := matchcontinue(lst, functionTree, addDummyDerivativeIfNeeded, simplify) local BackendDAE.BinTree s; BackendDAE.Variables vars,knvars,vars_1,extVars; @@ -136,8 +136,8 @@ algorithm arr_md_eqns = listArray(aeqns1); algarr = listArray(algs); einfo = Inline.inlineEventInfo(BackendDAE.EVENT_INFO(whenclauses_1,zero_crossings),(SOME(functionTree),{DAE.NORM_INLINE()})); - BackendDAEUtil.checkBackendDAEWithErrorMsg(BackendDAE.DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls)); - then BackendDAE.DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls); + BackendDAEUtil.checkBackendDAEWithErrorMsg(BackendDAE.DAE(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls)); + then BackendDAE.DAE(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls); case(lst, functionTree, addDummyDerivativeIfNeeded, false) // do not simplify equation @@ -172,8 +172,8 @@ algorithm arr_md_eqns = listArray(aeqns); algarr = listArray(algs); einfo = Inline.inlineEventInfo(BackendDAE.EVENT_INFO(whenclauses_1,zero_crossings),(SOME(functionTree),{DAE.NORM_INLINE()})); - BackendDAEUtil.checkBackendDAEWithErrorMsg(BackendDAE.DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls)); - then BackendDAE.DAELOW(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls); + BackendDAEUtil.checkBackendDAEWithErrorMsg(BackendDAE.DAE(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls)); + then BackendDAE.DAE(vars_1,knvars,extVars,aliasVars,eqnarr,reqnarr,ieqnarr,arr_md_eqns,algarr,einfo,extObjCls); end matchcontinue; end lower; @@ -634,7 +634,7 @@ end lower2; protected function lowerVar "function: lowerVar - Transforms a DAE variable to DAELOW variable. + Transforms a DAE variable to DAE variable. Includes changing the ComponentRef name to a simpler form \'a\'.\'b\'{2}\'c\'{5} becomes \'a.b{2}.c\' (as CREF_IDENT(\"a.b.c\",{2}) ) @@ -2230,7 +2230,7 @@ protected function expandDerOperator "function expandDerOperator expands der(expr) using Derive.differentiteExpTime. This can not be done in Static, since we need all time- - dependent variables, which is only available in DAELow." + dependent variables, which is only available in BackendDAE." input BackendDAE.Variables vars; input list eqns; input list ieqns; @@ -2839,11 +2839,11 @@ end findZeroCrossings3; public function zeroCrossingsEquations "Returns a list of all equations (by their index) that contain a zero crossing Used e.g. to find out which discrete equations are not part of a zero crossing" - input BackendDAE.DAELow dae; + input BackendDAE.BackendDAE dae; output list eqns; algorithm eqns := matchcontinue(dae) - case (BackendDAE.DAELOW(eventInfo=BackendDAE.EVENT_INFO(zeroCrossingLst = zcLst),orderedEqs=eqnArr)) local + case (BackendDAE.DAE(eventInfo=BackendDAE.EVENT_INFO(zeroCrossingLst = zcLst),orderedEqs=eqnArr)) local list zcLst; list> zcEqns; list wcEqns; diff --git a/Compiler/BackendDAEOptimize.mo b/Compiler/BackendDAEOptimize.mo index b64ab5b831c..e20fa6ced06 100644 --- a/Compiler/BackendDAEOptimize.mo +++ b/Compiler/BackendDAEOptimize.mo @@ -74,7 +74,7 @@ protected import VarTransform; public function removeSimpleEquations "function: removeSimpleEquations This function moves simple equations on the form a=b from equations 2nd - in BackendDAE.DAELow to simple equations 3rd in BackendDAE.DAELow to speed up assignment alg. + in BackendDAE.BackendDAE to simple equations 3rd in BackendDAE.BackendDAE to speed up assignment alg. inputs: (vars: Variables, knownVars: Variables, eqns: BackendDAE.Equation list, @@ -613,13 +613,13 @@ public function tearingSystem Pervormes tearing method on a system. This is just a funktion to check the flack tearing. All other will be done at tearingSystem1." - input BackendDAE.DAELow inDlow; + input BackendDAE.BackendDAE inDlow; input BackendDAE.IncidenceMatrix inM; input BackendDAE.IncidenceMatrixT inMT; input array inV1; input array inV2; input list> inComps; - output BackendDAE.DAELow outDlow; + output BackendDAE.BackendDAE outDlow; output BackendDAE.IncidenceMatrix outM; output BackendDAE.IncidenceMatrixT outMT; output array outV1; @@ -631,7 +631,7 @@ algorithm (outDlow,outM,outMT,outV1,outV2,outComps,outResEqn,outTearVar):= matchcontinue (inDlow,inM,inMT,inV1,inV2,inComps) local - BackendDAE.DAELow dlow,dlow_1,dlow1; + BackendDAE.BackendDAE dlow,dlow_1,dlow1; BackendDAE.IncidenceMatrix m,m_1; BackendDAE.IncidenceMatrixT mT,mT_1; array v1,v2,v1_1,v2_1; @@ -667,8 +667,8 @@ protected function copyDaeLowforTearing autor: Frenkel TUD Copy the dae to avoid changes in vectors." - input BackendDAE.DAELow inDlow; - output BackendDAE.DAELow outDlow; + input BackendDAE.BackendDAE inDlow; + output BackendDAE.BackendDAE outDlow; algorithm outDlow:= matchcontinue (inDlow) @@ -688,7 +688,7 @@ algorithm Integer bucketSize; Integer numberOfVars; array> varOptArr,varOptArr1; - case (BackendDAE.DAELOW(ordvars,knvars,exobj,av,eqns,remeqns,inieqns,arreqns,algorithms,einfo,eoc)) + case (BackendDAE.DAE(ordvars,knvars,exobj,av,eqns,remeqns,inieqns,arreqns,algorithms,einfo,eoc)) equation BackendDAE.VARIABLES(crefIdxLstArr,strIdxLstArr,varArr,bucketSize,numberOfVars) = ordvars; BackendDAE.VARIABLE_ARRAY(n1,size1,varOptArr) = varArr; @@ -704,7 +704,7 @@ algorithm arr_1 = Util.arrayCopy(arr, arr_1); eqns1 = BackendDAE.EQUATION_ARRAY(n,size,arr_1); then - BackendDAE.DAELOW(ordvars1,knvars,exobj,av,eqns1,remeqns,inieqns,arreqns,algorithms,einfo,eoc); + BackendDAE.DAE(ordvars1,knvars,exobj,av,eqns1,remeqns,inieqns,arreqns,algorithms,einfo,eoc); end matchcontinue; end copyDaeLowforTearing; @@ -713,8 +713,8 @@ protected function tearingSystem1 autor: Frenkel TUD Main loop. Check all Comps and start tearing if strong connected components there" - input BackendDAE.DAELow inDlow; - input BackendDAE.DAELow inDlow1; + input BackendDAE.BackendDAE inDlow; + input BackendDAE.BackendDAE inDlow1; input BackendDAE.IncidenceMatrix inM; input BackendDAE.IncidenceMatrixT inMT; input array inV1; @@ -722,8 +722,8 @@ protected function tearingSystem1 input list> inComps; output list> outResEqn; output list> outTearVar; - output BackendDAE.DAELow outDlow; - output BackendDAE.DAELow outDlow1; + output BackendDAE.BackendDAE outDlow; + output BackendDAE.BackendDAE outDlow1; output BackendDAE.IncidenceMatrix outM; output BackendDAE.IncidenceMatrixT outMT; output array outV1; @@ -733,7 +733,7 @@ algorithm (outResEqn,outTearVar,outDlow,outDlow1,outM,outMT,outV1,outV2,outComps):= matchcontinue (inDlow,inDlow1,inM,inMT,inV1,inV2,inComps) local - BackendDAE.DAELow dlow,dlow_1,dlow_2,dlow1,dlow1_1,dlow1_2; + BackendDAE.BackendDAE dlow,dlow_1,dlow_2,dlow1,dlow1_1,dlow1_2; BackendDAE.IncidenceMatrix m,m_1,m_2,m_3,m_4; BackendDAE.IncidenceMatrixT mT,mT_1,mT_2,mT_3,mT_4; array v1,v2,v1_1,v2_1,v1_2,v2_2,v1_3,v2_3; @@ -813,7 +813,7 @@ protected function getTearingVars input array inV1; input array inV2; input list inComp; - input BackendDAE.DAELow inDlow; + input BackendDAE.BackendDAE inDlow; output list outVarLst; output list outCrLst; algorithm @@ -824,13 +824,13 @@ algorithm array v1,v2; BackendDAE.Value c,v; list comp,varlst; - BackendDAE.DAELow dlow; + BackendDAE.BackendDAE dlow; DAE.ComponentRef cr; list crlst; BackendDAE.Variables ordvars; BackendDAE.VariableArray varr; case (m,v1,v2,{},dlow) then ({},{}); - case (m,v1,v2,c::comp,dlow as BackendDAE.DAELOW(orderedVars = ordvars as BackendDAE.VARIABLES(varArr=varr))) + case (m,v1,v2,c::comp,dlow as BackendDAE.DAE(orderedVars = ordvars as BackendDAE.VARIABLES(varArr=varr))) equation v = v2[c]; BackendDAE.VAR(varName = cr) = BackendVariable.vararrayNth(varr, v-1); @@ -846,8 +846,8 @@ protected function tearingSystem2 select a residual equation. The equation with most connections to variables will be selected." - input BackendDAE.DAELow inDlow; - input BackendDAE.DAELow inDlow1; + input BackendDAE.BackendDAE inDlow; + input BackendDAE.BackendDAE inDlow1; input BackendDAE.IncidenceMatrix inM; input BackendDAE.IncidenceMatrixT inMT; input array inV1; @@ -862,8 +862,8 @@ protected function tearingSystem2 output list outResEqns; output list outTearVars; output list outTearEqns; - output BackendDAE.DAELow outDlow; - output BackendDAE.DAELow outDlow1; + output BackendDAE.BackendDAE outDlow; + output BackendDAE.BackendDAE outDlow1; output BackendDAE.IncidenceMatrix outM; output BackendDAE.IncidenceMatrixT outMT; output array outV1; @@ -873,7 +873,7 @@ algorithm (outResEqns,outTearVars,outTearEqns,outDlow,outDlow1,outM,outMT,outV1,outV2,outComp):= matchcontinue (inDlow,inDlow1,inM,inMT,inV1,inV2,inComp,inTVars,inExclude,inResEqns,inTearVars,inTearEqns,inCrlst) local - BackendDAE.DAELow dlow,dlow_1,dlow1,dlow1_1; + BackendDAE.BackendDAE dlow,dlow_1,dlow1,dlow1_1; BackendDAE.IncidenceMatrix m,m_1; BackendDAE.IncidenceMatrixT mT,mT_1; array v1,v2,v1_1,v2_1; @@ -924,8 +924,8 @@ protected function tearingSystem3 a tearing variable. The variable with most connections to equations will be selected." - input BackendDAE.DAELow inDlow; - input BackendDAE.DAELow inDlow1; + input BackendDAE.BackendDAE inDlow; + input BackendDAE.BackendDAE inDlow1; input BackendDAE.IncidenceMatrix inM; input BackendDAE.IncidenceMatrixT inMT; input array inV1; @@ -941,8 +941,8 @@ protected function tearingSystem3 output list outResEqns; output list outTearVars; output list outTearEqns; - output BackendDAE.DAELow outDlow; - output BackendDAE.DAELow outDlow1; + output BackendDAE.BackendDAE outDlow; + output BackendDAE.BackendDAE outDlow1; output BackendDAE.IncidenceMatrix outM; output BackendDAE.IncidenceMatrixT outMT; output array outV1; @@ -952,7 +952,7 @@ algorithm (outResEqns,outTearVars,outTearEqns,outDlow,outDlow1,outM,outMT,outV1,outV2,outComp):= matchcontinue (inDlow,inDlow1,inM,inMT,inV1,inV2,inComp,inTVars,inExclude,inResEqn,inResEqns,inTearVars,inTearEqns,inCrlst) local - BackendDAE.DAELow dlow,dlow_1,dlow_2,dlow_3,dlow1,dlow1_1,dlow1,dlow1_1,dlow1_2,dlowc,dlowc1; + BackendDAE.BackendDAE dlow,dlow_1,dlow_2,dlow_3,dlow1,dlow1_1,dlow1,dlow1_1,dlow1_2,dlowc,dlowc1; BackendDAE.IncidenceMatrix m,m_1,m_2,m_3; BackendDAE.IncidenceMatrixT mT,mT_1,mT_2,mT_3; array v1,v2,v1_1,v2_1,v1_2,v2_2; @@ -990,9 +990,9 @@ algorithm Debug.fcall("tearingdump", print, str2); // copy dlow dlowc = copyDaeLowforTearing(dlow); - BackendDAE.DAELOW(ordvars as BackendDAE.VARIABLES(varArr=varr),knvars,exobj,av,eqns,remeqns,inieqns,arreqns,algorithms,einfo,eoc) = dlowc; + BackendDAE.DAE(ordvars as BackendDAE.VARIABLES(varArr=varr),knvars,exobj,av,eqns,remeqns,inieqns,arreqns,algorithms,einfo,eoc) = dlowc; dlowc1 = copyDaeLowforTearing(dlow1); - BackendDAE.DAELOW(orderedVars = ordvars1,orderedEqs = eqns1) = dlowc1; + BackendDAE.DAE(orderedVars = ordvars1,orderedEqs = eqns1) = dlowc1; // add Tearing Var BackendDAE.VAR(varName = cr as DAE.CREF_IDENT(ident = ident, identType = identType, subscriptLst = subscriptLst )) = BackendVariable.vararrayNth(varr, tearingvar-1); ident_t = stringAppend("tearingresidual_",ident); @@ -1013,8 +1013,8 @@ algorithm {},false,true,DAE.ET_REAL(),DAE.NO_INLINE()), DAE.CREF(cr,DAE.ET_REAL()), DAE.emptyElementSource)); tearingeqnid = BackendDAEUtil.equationSize(eqns_2); - dlow_1 = BackendDAE.DAELOW(vars_1,knvars,exobj,av,eqns_2,remeqns,inieqns,arreqns,algorithms,einfo,eoc); - dlow1_1 = BackendDAE.DAELOW(ordvars1,knvars,exobj,av,eqns1_1,remeqns,inieqns,arreqns,algorithms,einfo,eoc); + dlow_1 = BackendDAE.DAE(vars_1,knvars,exobj,av,eqns_2,remeqns,inieqns,arreqns,algorithms,einfo,eoc); + dlow1_1 = BackendDAE.DAE(ordvars1,knvars,exobj,av,eqns1_1,remeqns,inieqns,arreqns,algorithms,einfo,eoc); // try causalisation m_1 = BackendDAEUtil.incidenceMatrix(dlow_1); mT_1 = BackendDAEUtil.transposeMatrix(m_1); @@ -1052,7 +1052,7 @@ algorithm comp_2 = Util.listSelect1(cmops_flat,comp,Util.listContains); then (residualeqns_1,tearingvars_1,tearingeqns_1,dlow_3,dlow1_2,m_3,mT_3,v1_2,v2_2,comp_2); - case (dlow as BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(varArr=varr)),dlow1,m,mT,v1,v2,comp,vars,exclude,residualeqn,residualeqns,tearingvars,tearingeqns,crlst) + case (dlow as BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(varArr=varr)),dlow1,m,mT,v1,v2,comp,vars,exclude,residualeqn,residualeqns,tearingvars,tearingeqns,crlst) equation (tearingvar,_) = getMaxfromListList(mT,vars,comp,0,0,exclude); // check if tearing var is found @@ -1063,7 +1063,7 @@ algorithm (residualeqns_1,tearingvars_1,tearingeqns_1,dlow_1,dlow1_1,m_1,mT_1,v1_1,v2_1,comp_1) = tearingSystem3(dlow,dlow1,m,mT,v1,v2,comp,vars,tearingvar::exclude,residualeqn,residualeqns,tearingvars,tearingeqns,crlst); then (residualeqns_1,tearingvars_1,tearingeqns_1,dlow_1,dlow1_1,m_1,mT_1,v1_1,v2_1,comp_1); - case (dlow as BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(varArr=varr)),dlow1,m,mT,v1,v2,comp,vars,exclude,residualeqn,residualeqns,tearingvars,tearingeqns,_) + case (dlow as BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(varArr=varr)),dlow1,m,mT,v1,v2,comp,vars,exclude,residualeqn,residualeqns,tearingvars,tearingeqns,_) equation (tearingvar,_) = getMaxfromListList(mT,vars,comp,0,0,exclude); // check if tearing var is found @@ -1081,8 +1081,8 @@ protected function tearingSystem4 autor: Frenkel TUD Internal Main loop for additional tearing vars and residual eqns." - input BackendDAE.DAELow inDlow; - input BackendDAE.DAELow inDlow1; + input BackendDAE.BackendDAE inDlow; + input BackendDAE.BackendDAE inDlow1; input BackendDAE.IncidenceMatrix inM; input BackendDAE.IncidenceMatrixT inMT; input array inV1; @@ -1097,8 +1097,8 @@ protected function tearingSystem4 output list outResEqns; output list outTearVars; output list outTearEqns; - output BackendDAE.DAELow outDlow; - output BackendDAE.DAELow outDlow1; + output BackendDAE.BackendDAE outDlow; + output BackendDAE.BackendDAE outDlow1; output BackendDAE.IncidenceMatrix outM; output BackendDAE.IncidenceMatrixT outMT; output array outV1; @@ -1109,7 +1109,7 @@ algorithm (outResEqns,outTearVars,outTearEqns,outDlow,outDlow1,outM,outMT,outV1,outV2,outComp,outCompCount):= matchcontinue (inDlow,inDlow1,inM,inMT,inV1,inV2,inComps,inResEqns,inTearVars,inTearEqns,inComp,inCompCount,inCrlst) local - BackendDAE.DAELow dlow,dlow_1,dlow_2,dlow1,dlow1_1,dlow1_2; + BackendDAE.BackendDAE dlow,dlow_1,dlow_2,dlow1,dlow1_1,dlow1_2; BackendDAE.IncidenceMatrix m,m_1,m_2; BackendDAE.IncidenceMatrixT mT,mT_1,mT_2; array v1,v2,v1_1,v2_1,v1_2,v2_2; diff --git a/Compiler/BackendDAETransform.mo b/Compiler/BackendDAETransform.mo index c926494d3c3..9f02d32d83b 100644 --- a/Compiler/BackendDAETransform.mo +++ b/Compiler/BackendDAETransform.mo @@ -91,28 +91,28 @@ public function matchingAlgorithm - if the equation system is allowed to be under constrained or not which is used when generating code for initial equations. - inputs: (DAELow,IncidenceMatrix, BackendDAE.IncidenceMatrixT, MatchingOptions) + inputs: (BackendDAE,IncidenceMatrix, BackendDAE.IncidenceMatrixT, MatchingOptions) outputs: (int vector /* vector of equation indices */ , int vector /* vector of variable indices */, - DAELow,IncidenceMatrix, IncidenceMatrixT)" - input BackendDAE.DAELow inDAELow; + BackendDAE,IncidenceMatrix, IncidenceMatrixT)" + input BackendDAE.BackendDAE inBackendDAE; input BackendDAE.IncidenceMatrix inIncidenceMatrix; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT; input BackendDAE.MatchingOptions inMatchingOptions; input DAE.FunctionTree inFunctions; output array outIntegerArray1; output array outIntegerArray2; - output BackendDAE.DAELow outDAELow3; + output BackendDAE.BackendDAE outBackendDAE3; output BackendDAE.IncidenceMatrix outIncidenceMatrix4; output BackendDAE.IncidenceMatrixT outIncidenceMatrixT5; algorithm - (outIntegerArray1,outIntegerArray2,outDAELow3,outIncidenceMatrix4,outIncidenceMatrixT5) := - matchcontinue (inDAELow,inIncidenceMatrix,inIncidenceMatrixT,inMatchingOptions,inFunctions) + (outIntegerArray1,outIntegerArray2,outBackendDAE3,outIncidenceMatrix4,outIncidenceMatrixT5) := + matchcontinue (inBackendDAE,inIncidenceMatrix,inIncidenceMatrixT,inMatchingOptions,inFunctions) local BackendDAE.Value nvars,neqns,memsize; String ns,ne; BackendDAE.Assignments assign1,assign2,ass1,ass2; - BackendDAE.DAELow dae,dae_1,dae_2; + BackendDAE.BackendDAE dae,dae_1,dae_2; BackendDAE.Variables v,kv,v_1,kv_1,vars,exv; BackendDAE.AliasVariables av; BackendDAE.EquationArray e,re,ie,e_1,re_1,ie_1,eqns; @@ -131,7 +131,7 @@ algorithm list zero_crossings; list algs; /* fail case if daelow is empty */ - case ((dae as BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns)),m,mt,match_opts,inFunctions) + case ((dae as BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns)),m,mt,match_opts,inFunctions) equation nvars = arrayLength(m); neqns = arrayLength(mt); @@ -141,7 +141,7 @@ algorithm vec2 = listArray({}); then (vec1,vec2,dae,m,mt); - case ((dae as BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns)),m,mt,(match_opts as (_,_,BackendDAE.REMOVE_SIMPLE_EQN())),inFunctions) + case ((dae as BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns)),m,mt,(match_opts as (_,_,BackendDAE.REMOVE_SIMPLE_EQN())),inFunctions) equation DAEEXT.clearDifferentiated(); checkMatching(dae, match_opts); @@ -154,7 +154,7 @@ algorithm memsize = nvars + nvars "Worst case, all eqns are differentiated once. Create nvars2 assignment elements" ; assign1 = assignmentsCreate(nvars, memsize, 0); assign2 = assignmentsCreate(nvars, memsize, 0); - (ass1,ass2,(dae as BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc)),m,mt,_,_) = matchingAlgorithm2(dae, m, mt, nvars, neqns, 1, assign1, assign2, match_opts,inFunctions,{},{}); + (ass1,ass2,(dae as BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc)),m,mt,_,_) = matchingAlgorithm2(dae, m, mt, nvars, neqns, 1, assign1, assign2, match_opts,inFunctions,{},{}); /* NOTE: Here it could be possible to run removeSimpleEquations again, since algebraic equations could potentially be removed after a index reduction has been done. However, removing equations here also require that e.g. zero crossings, array equations, etc. must be recalculated. */ @@ -172,7 +172,7 @@ algorithm ie = BackendDAEUtil.listEquation(ie_lst); ae = listArray(ae_lst); einfo = BackendDAE.EVENT_INFO(whenclauses,zero_crossings); - dae_1 = BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,einfo,eoc); + dae_1 = BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,einfo,eoc); m_1 = BackendDAEUtil.incidenceMatrix(dae_1) "Rerun matching to get updated assignments and incidence matrices TODO: instead of rerunning: find out which equations are removed and remove those from assignments and incidence matrix." ; @@ -188,7 +188,7 @@ algorithm then (vec1,vec2,dae_2,m,mt); - case ((dae as BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns)),m,mt,(match_opts as (_,_,BackendDAE.KEEP_SIMPLE_EQN())),inFunctions) + case ((dae as BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns)),m,mt,(match_opts as (_,_,BackendDAE.KEEP_SIMPLE_EQN())),inFunctions) equation checkMatching(dae, match_opts); nvars = arrayLength(m); @@ -207,7 +207,7 @@ algorithm (vec1,vec2,dae,m,mt); case (_,_,_,_,_) equation - Debug.fprint("failtrace", "- DAELow.MatchingAlgorithm failed\n"); + Debug.fprint("failtrace", "- BackendDAE.MatchingAlgorithm failed\n"); then fail(); end matchcontinue; @@ -222,22 +222,22 @@ public function checkMatching prints an error message. If matching options indicate that underconstrained systems are ok, no check is performed." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input BackendDAE.MatchingOptions inMatchingOptions; algorithm - _ := matchcontinue (inDAELow,inMatchingOptions) + _ := matchcontinue (inBackendDAE,inMatchingOptions) local BackendDAE.Value esize,vars_size; BackendDAE.EquationArray eqns; String esize_str,vsize_str; case (_,(_,BackendDAE.ALLOW_UNDERCONSTRAINED(),_)) then (); - case (BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(numberOfVars = vars_size),orderedEqs = eqns),_) + case (BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(numberOfVars = vars_size),orderedEqs = eqns),_) equation esize = BackendDAEUtil.equationSize(eqns); (esize == vars_size) = true; then (); - case (BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(numberOfVars = vars_size),orderedEqs = eqns),_) + case (BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(numberOfVars = vars_size),orderedEqs = eqns),_) equation esize = BackendDAEUtil.equationSize(eqns); (esize < vars_size) = true; @@ -248,7 +248,7 @@ algorithm Error.addMessage(Error.UNDERDET_EQN_SYSTEM, {esize_str,vsize_str}); then fail(); - case (BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(numberOfVars = vars_size),orderedEqs = eqns),_) + case (BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(numberOfVars = vars_size),orderedEqs = eqns),_) equation esize = BackendDAEUtil.equationSize(eqns); (esize > vars_size) = true; @@ -261,7 +261,7 @@ algorithm fail(); case (_,_) equation - Debug.fprint("failtrace", "- DAELow.checkMatching failed\n"); + Debug.fprint("failtrace", "- BackendDAE.checkMatching failed\n"); then fail(); end matchcontinue; @@ -288,7 +288,7 @@ algorithm vec; case (_) equation - print("- DAELow.assignmentsVector failed\n"); + print("- BackendDAE.assignmentsVector failed\n"); then fail(); end matchcontinue; @@ -365,7 +365,7 @@ algorithm ass_2; case (ass,_) equation - print("DAELow.assignmentsExpand: n should not be negative!"); + print("BackendDAE.assignmentsExpand: n should not be negative!"); then fail(); end matchcontinue; @@ -423,7 +423,7 @@ public function matchingAlgorithm2 author: PA This is the outer loop of the matching algorithm The find_path algorithm is called for each equation/variable. - inputs: (DAELow,IncidenceMatrix, IncidenceMatrixT + inputs: (BackendDAE,IncidenceMatrix, IncidenceMatrixT ,int /* number of vars */ ,int /* number of eqns */ ,int /* current var */ @@ -432,8 +432,8 @@ public function matchingAlgorithm2 ,MatchingOptions) /* options for matching alg. */ outputs: (Assignments, /* assignments, array of equation indices */ Assignments, /* assignments, list of variable indices */ - DAELow, BackendDAE.IncidenceMatrix, IncidenceMatrixT)" - input BackendDAE.DAELow inDAELow1; + BackendDAE, BackendDAE.IncidenceMatrix, IncidenceMatrixT)" + input BackendDAE.BackendDAE inBackendDAE1; input BackendDAE.IncidenceMatrix inIncidenceMatrix2; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT3; input Integer inInteger4; @@ -447,17 +447,17 @@ public function matchingAlgorithm2 input list> inDerivedMultiEqn; output BackendDAE.Assignments outAssignments1; output BackendDAE.Assignments outAssignments2; - output BackendDAE.DAELow outDAELow3; + output BackendDAE.BackendDAE outBackendDAE3; output BackendDAE.IncidenceMatrix outIncidenceMatrix4; output BackendDAE.IncidenceMatrixT outIncidenceMatrixT5; output list> outDerivedAlgs; output list> outDerivedMultiEqn; algorithm - (outAssignments1,outAssignments2,outDAELow3,outIncidenceMatrix4,outIncidenceMatrixT5,outDerivedAlgs,outDerivedMultiEqn):= - matchcontinue (inDAELow1,inIncidenceMatrix2,inIncidenceMatrixT3,inInteger4,inInteger5,inInteger6,inAssignments7,inAssignments8,inMatchingOptions9,inFunctions,inDerivedAlgs,inDerivedMultiEqn) + (outAssignments1,outAssignments2,outBackendDAE3,outIncidenceMatrix4,outIncidenceMatrixT5,outDerivedAlgs,outDerivedMultiEqn):= + matchcontinue (inBackendDAE1,inIncidenceMatrix2,inIncidenceMatrixT3,inInteger4,inInteger5,inInteger6,inAssignments7,inAssignments8,inMatchingOptions9,inFunctions,inDerivedAlgs,inDerivedMultiEqn) local BackendDAE.Assignments ass1_1,ass2_1,ass1,ass2,ass1_2,ass2_2; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array> m,mt; BackendDAE.Value nv,nf,i,i_1,nv_1,nkv,nf_1,nvd; BackendDAE.MatchingOptions match_opts; @@ -488,7 +488,7 @@ algorithm case (dae,m,mt,nv,nf,i,ass1,ass2,(BackendDAE.INDEX_REDUCTION(),eq_cons,r_simple),inFunctions,derivedAlgs,derivedMultiEqn) equation - ((dae as BackendDAE.DAELOW(BackendDAE.VARIABLES(_,_,_,_,nv_1),BackendDAE.VARIABLES(_,_,_,_,nkv),_,_,eqns,_,_,_,_,_,_)),m,mt,derivedAlgs1,derivedMultiEqn1) = reduceIndexDummyDer(dae, m, mt, nv, nf, i, inFunctions,derivedAlgs,derivedMultiEqn) + ((dae as BackendDAE.DAE(BackendDAE.VARIABLES(_,_,_,_,nv_1),BackendDAE.VARIABLES(_,_,_,_,nkv),_,_,eqns,_,_,_,_,_,_)),m,mt,derivedAlgs1,derivedMultiEqn1) = reduceIndexDummyDer(dae, m, mt, nv, nf, i, inFunctions,derivedAlgs,derivedMultiEqn) "path_found failed, Try index reduction using dummy derivatives. When a constraint exist between states and index reduction is needed the dummy derivative will select one of the states as a dummy state @@ -1169,12 +1169,12 @@ protected function reduceIndexDummyDer reduce the index by differentiating the marked equations and replacing one of the variable with a dummy derivative, i.e. making it algebraic. - The new BackendDAE.DAELow is returned along with an updated incidence matrix. + The new BackendDAE.BackendDAE is returned along with an updated incidence matrix. - inputs: (DAELow, BackendDAE.IncidenceMatrix, BackendDAE.IncidenceMatrixT, + inputs: (BackendDAE, BackendDAE.IncidenceMatrix, BackendDAE.IncidenceMatrixT, int /* number of vars */, int /* number of eqns */, int /* i */) - outputs: (DAELow, BackendDAE.IncidenceMatrix, IncidenceMatrixT)" - input BackendDAE.DAELow inDAELow1; + outputs: (BackendDAE, BackendDAE.IncidenceMatrix, IncidenceMatrixT)" + input BackendDAE.BackendDAE inBackendDAE1; input BackendDAE.IncidenceMatrix inIncidenceMatrix2; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT3; input Integer inInteger4; @@ -1183,18 +1183,18 @@ protected function reduceIndexDummyDer input DAE.FunctionTree inFunctions; input list> inDerivedAlgs; input list> inDerivedMultiEqn; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; output BackendDAE.IncidenceMatrix outIncidenceMatrix; output BackendDAE.IncidenceMatrixT outIncidenceMatrixT; output list> outDerivedAlgs; output list> outDerivedMultiEqn; algorithm - (outDAELow,outIncidenceMatrix,outIncidenceMatrixT,outDerivedAlgs,outDerivedMultiEqn):= - matchcontinue (inDAELow1,inIncidenceMatrix2,inIncidenceMatrixT3,inInteger4,inInteger5,inInteger6,inFunctions,inDerivedAlgs,inDerivedMultiEqn) + (outBackendDAE,outIncidenceMatrix,outIncidenceMatrixT,outDerivedAlgs,outDerivedMultiEqn):= + matchcontinue (inBackendDAE1,inIncidenceMatrix2,inIncidenceMatrixT3,inInteger4,inInteger5,inInteger6,inFunctions,inDerivedAlgs,inDerivedMultiEqn) local list eqns,diff_eqns,eqns_1,stateindx,deqns,reqns,changedeqns; list states; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array> m,mt; BackendDAE.Value nv,nf,stateno,i; DAE.ComponentRef state,dummy_der; @@ -1269,14 +1269,14 @@ protected function makeAlgebraic author: PA Make the variable a dummy derivative, i.e. change varkind from STATE to DUMMY_STATE. - inputs: (DAELow, DAE.ComponentRef /* state */) - outputs: (DAELow) = " - input BackendDAE.DAELow inDAELow; + inputs: (BackendDAE, DAE.ComponentRef /* state */) + outputs: (BackendDAE) = " + input BackendDAE.BackendDAE inBackendDAE; input DAE.ComponentRef inComponentRef; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; algorithm - outDAELow:= - matchcontinue (inDAELow,inComponentRef) + outBackendDAE:= + matchcontinue (inBackendDAE,inComponentRef) local DAE.ComponentRef cr; BackendDAE.VarKind kind; @@ -1299,18 +1299,18 @@ algorithm array al; BackendDAE.EventInfo wc; BackendDAE.ExternalObjectClasses eoc; - BackendDAE.DAELow daelow, daelow_1; + BackendDAE.BackendDAE daelow, daelow_1; - case (BackendDAE.DAELOW(vars,kv,ev,av,e,se,ie,ae,al,wc,eoc),cr) + case (BackendDAE.DAE(vars,kv,ev,av,e,se,ie,ae,al,wc,eoc),cr) equation ((BackendDAE.VAR(cr,kind,d,t,b,value,dim,idx,source,dae_var_attr,comment,flowPrefix,streamPrefix) :: _),indx) = BackendVariable.getVar(cr, vars); vars_1 = BackendVariable.addVar(BackendDAE.VAR(cr,BackendDAE.DUMMY_STATE(),d,t,b,value,dim,idx,source,dae_var_attr,comment,flowPrefix,streamPrefix), vars); then - BackendDAE.DAELOW(vars_1,kv,ev,av,e,se,ie,ae,al,wc,eoc); + BackendDAE.DAE(vars_1,kv,ev,av,e,se,ie,ae,al,wc,eoc); case (_,_) equation - print("DAELow.makeAlgebraic failed\n"); + print("BackendDAE.makeAlgebraic failed\n"); then fail(); @@ -1333,13 +1333,13 @@ protected function propagateDummyFixedAttribute i.e. fixed should be false for the state s2 (which is set by the user), this fixed value has to be propagated to s1 when s2 becomes a dummy state." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input list inIntegerLst; input DAE.ComponentRef inComponentRef; input Integer inInteger; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; algorithm - outDAELow := matchcontinue (inDAELow,inIntegerLst,inComponentRef,inInteger) + outBackendDAE := matchcontinue (inBackendDAE,inIntegerLst,inComponentRef,inInteger) local list eqns_1,eqns; list eqns_lst; @@ -1350,7 +1350,7 @@ algorithm Boolean dummy_fixed; BackendDAE.Variables vars_1,vars,kv,ev; BackendDAE.AliasVariables av; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.EquationArray e,se,ie; array ae; array al; @@ -1358,7 +1358,7 @@ algorithm BackendDAE.ExternalObjectClasses eoc; /* eqns dummy state */ - case ((dae as BackendDAE.DAELOW(vars,kv,ev,av,e,se,ie,ae,al,ei,eoc)),eqns,dummy,dummy_no) + case ((dae as BackendDAE.DAE(vars,kv,ev,av,e,se,ie,ae,al,ei,eoc)),eqns,dummy,dummy_no) equation eqns_1 = Util.listMap1(eqns, int_sub, 1); eqns_lst = Util.listMap1r(eqns_1, BackendDAEUtil.equationNth, e); @@ -1371,10 +1371,10 @@ algorithm v_2 = BackendVariable.setVarFixed(v_1, dummy_fixed); vars_1 = BackendVariable.addVar(v_2, vars); then - BackendDAE.DAELOW(vars_1,kv,ev,av,e,se,ie,ae,al,ei,eoc); + BackendDAE.DAE(vars_1,kv,ev,av,e,se,ie,ae,al,ei,eoc); // Never propagate fixed=true - case ((dae as BackendDAE.DAELOW(vars,kv,ev,av,e,se,ie,ae,al,ei,eoc)),eqns,dummy,dummy_no) + case ((dae as BackendDAE.DAE(vars,kv,ev,av,e,se,ie,ae,al,ei,eoc)),eqns,dummy,dummy_no) equation eqns_1 = Util.listMap1(eqns, int_sub, 1); eqns_lst = Util.listMap1r(eqns_1, BackendDAEUtil.equationNth, e); @@ -1433,28 +1433,28 @@ protected function replaceDummyDer replaces der(state) with the variable dummy der. inputs: (DAE.ComponentRef, /* state */ DAE.ComponentRef, /* dummy der name */ - DAELow, + BackendDAE, IncidenceMatrix, IncidenceMatrixT, int list /* equations */) - outputs: (DAELow, + outputs: (BackendDAE, IncidenceMatrix, IncidenceMatrixT)" input DAE.ComponentRef inComponentRef1; input DAE.ComponentRef inComponentRef2; - input BackendDAE.DAELow inDAELow3; + input BackendDAE.BackendDAE inBackendDAE3; input BackendDAE.IncidenceMatrix inIncidenceMatrix4; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT5; input list inIntegerLst6; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; output BackendDAE.IncidenceMatrix outIncidenceMatrix; output BackendDAE.IncidenceMatrixT outIncidenceMatrixT; algorithm - (outDAELow,outIncidenceMatrix,outIncidenceMatrixT):= - matchcontinue (inComponentRef1,inComponentRef2,inDAELow3,inIncidenceMatrix4,inIncidenceMatrixT5,inIntegerLst6) + (outBackendDAE,outIncidenceMatrix,outIncidenceMatrixT):= + matchcontinue (inComponentRef1,inComponentRef2,inBackendDAE3,inIncidenceMatrix4,inIncidenceMatrixT5,inIntegerLst6) local DAE.ComponentRef state,dummy,dummyder; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array> m,mt; BackendDAE.Value e_1,e; BackendDAE.Equation eqn,eqn_1; @@ -1470,7 +1470,7 @@ algorithm case (state,dummy,dae,m,mt,{}) then (dae,m,mt); - case (state,dummyder,BackendDAE.DAELOW(v,kv,ev,av,eqns,seqns,ie,ae,al,wc,eoc),m,mt,(e :: rest)) + case (state,dummyder,BackendDAE.DAE(v,kv,ev,av,eqns,seqns,ie,ae,al,wc,eoc),m,mt,(e :: rest)) equation e_1 = e - 1; eqn = BackendDAEUtil.equationNth(eqns, e_1); @@ -1483,7 +1483,7 @@ algorithm "incidence_row(v\'\',eqn\') => row\' & Util.list_replaceat(row\',e\',m) => m\' & transpose_matrix(m\') => mt\' &" ; - (dae,m,mt) = replaceDummyDer(state, dummyder, BackendDAE.DAELOW(v_1,kv,ev,av,eqns_1,seqns,ie1,ae3,al3,wc,eoc), m, mt, rest); + (dae,m,mt) = replaceDummyDer(state, dummyder, BackendDAE.DAE(v_1,kv,ev,av,eqns_1,seqns,ie1,ae3,al3,wc,eoc), m, mt, rest); then (dae,m,mt); @@ -1574,7 +1574,7 @@ algorithm (BackendDAE.COMPLEX_EQUATION(i,e1_1,e2_1,source),inAlgs,ae); case (_,_,_,_,_) equation - print("-DAELow.replaceDummyDer2 failed\n"); + print("-BackendDAE.replaceDummyDer2 failed\n"); then fail(); end matchcontinue; @@ -1766,7 +1766,7 @@ algorithm (DAE.STMT_MATCHCASES(matchType,inputExps,elst1,source)::st); case (_,_,_) equation - print("-DAELow.replaceDummyDerAlgs1 failed\n"); + print("-BackendDAE.replaceDummyDerAlgs1 failed\n"); then fail(); end matchcontinue; @@ -1799,7 +1799,7 @@ algorithm DAE.ELSE(stlst1); case (_,_,_) equation - print("-DAELow.replaceDummyDerAlgs2 failed\n"); + print("-BackendDAE.replaceDummyDerAlgs2 failed\n"); then fail(); end matchcontinue; @@ -1921,7 +1921,7 @@ algorithm case (_,_,_,_) equation - print("-DAELow.replaceDummyDerOthers failed\n"); + print("-BackendDAE.replaceDummyDerOthers failed\n"); then fail(); end matchcontinue; @@ -2115,7 +2115,7 @@ algorithm (DAE.STMT_MATCHCASES(matchType,inputExps,elst1,source)::st,vars1); case (_,_) equation - print("-DAELow.replaceDummyDerOthersAlgs1 failed\n"); + print("-BackendDAE.replaceDummyDerOthersAlgs1 failed\n"); then fail(); end matchcontinue; @@ -2149,7 +2149,7 @@ algorithm (DAE.ELSE(stlst1),vars); case (_,_) equation - print("-DAELow.replaceDummyDerOthersAlgs2 failed\n"); + print("-BackendDAE.replaceDummyDerOthersAlgs2 failed\n"); then fail(); end matchcontinue; @@ -2241,12 +2241,12 @@ protected function newDummyVar This function creates a new variable named der+ and adds it to the dae." input DAE.ComponentRef inComponentRef; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output DAE.ComponentRef outComponentRef; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; algorithm - (outComponentRef,outDAELow):= - matchcontinue (inComponentRef,inDAELow) + (outComponentRef,outBackendDAE):= + matchcontinue (inComponentRef,inBackendDAE) local BackendDAE.VarKind kind; DAE.VarDirection dir; @@ -2270,7 +2270,7 @@ algorithm BackendDAE.ExternalObjectClasses eoc; BackendDAE.Var dummyvar; - case (var,BackendDAE.DAELOW(vars, kv, ev, av, eqns, seqns, ie, ae, al, wc,eoc)) + case (var,BackendDAE.DAE(vars, kv, ev, av, eqns, seqns, ie, ae, al, wc,eoc)) equation ((BackendDAE.VAR(name,kind,dir,tp,bind,value,dim,idx,source,dae_var_attr,comment,flowPrefix,streamPrefix) :: _),_) = BackendVariable.getVar(var, vars); dummyvar_cr = ComponentReference.crefPrefixDer(var); @@ -2279,11 +2279,11 @@ algorithm dummyvar = BackendVariable.setVarFixed(dummyvar,false); vars_1 = BackendVariable.addVar(dummyvar, vars); then - (dummyvar_cr,BackendDAE.DAELOW(vars_1,kv,ev,av,eqns,seqns,ie,ae,al,wc,eoc)); + (dummyvar_cr,BackendDAE.DAE(vars_1,kv,ev,av,eqns,seqns,ie,ae,al,wc,eoc)); case (_,_) equation - print("-DAELow.newDummyVar failed!\n"); + print("-BackendDAE.newDummyVar failed!\n"); then fail(); end matchcontinue; @@ -2297,20 +2297,20 @@ protected function selectDummyState (dummy derivative). It should in the future consider initial values, etc. inputs: (DAE.ComponentRef list, /* variable names */ int list, /* variable numbers */ - DAELow, + BackendDAE, IncidenceMatrix, IncidenceMatrixT) outputs: (DAE.ComponentRef, int)" input list varCrefs; input list varIndices; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input BackendDAE.IncidenceMatrix inIncidenceMatrix; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT; output DAE.ComponentRef outComponentRef; output Integer outInteger; algorithm (outComponentRef,outInteger):= - matchcontinue (varCrefs,varIndices,inDAELow,inIncidenceMatrix,inIncidenceMatrixT) + matchcontinue (varCrefs,varIndices,inBackendDAE,inIncidenceMatrix,inIncidenceMatrixT) local DAE.ComponentRef s; BackendDAE.Value sn; @@ -2320,7 +2320,7 @@ algorithm BackendDAE.EquationArray eqns; list> prioTuples; - case (varCrefs,varIndices,BackendDAE.DAELOW(orderedVars=vars,orderedEqs = eqns),m,mt) + case (varCrefs,varIndices,BackendDAE.DAE(orderedVars=vars,orderedEqs = eqns),m,mt) equation prioTuples = calculateVarPriorities(varCrefs,varIndices,vars,eqns,m,mt); //print("priorities:");print(Util.stringDelimitList(Util.listMap(prioTuples,printPrioTuplesStr),","));print("\n"); @@ -2328,7 +2328,7 @@ algorithm then (s,sn); case ({},_,dae,_,_) - local BackendDAE.DAELow dae; + local BackendDAE.BackendDAE dae; equation print("Error, no state to select\nDAE:"); //dump(dae); @@ -2623,20 +2623,20 @@ protected function calculateDummyStatePriorities The heuristic parameters are summed to get the priority number." input list inExpComponentRefLst; input list inIntegerLst; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input BackendDAE.IncidenceMatrix inIncidenceMatrix; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT; output list> outTplExpComponentRefIntegerIntegerLst; algorithm outTplExpComponentRefIntegerIntegerLst:= - matchcontinue (inExpComponentRefLst,inIntegerLst,inDAELow,inIncidenceMatrix,inIncidenceMatrixT) + matchcontinue (inExpComponentRefLst,inIntegerLst,inBackendDAE,inIncidenceMatrix,inIncidenceMatrixT) local DAE.ComponentRef cr; BackendDAE.Value indx,prio; list> res; list crs; list indxs; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array> m,mt; case ({},{},_,_,_) then {}; case ((cr :: crs),(indx :: indxs),dae,m,mt) @@ -2651,7 +2651,7 @@ end calculateDummyStatePriorities; protected function calculateDummyStatePriority input DAE.ComponentRef inComponentRef; input Integer inInteger; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input BackendDAE.IncidenceMatrix inIncidenceMatrix; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT; output DAE.ComponentRef outComponentRef1; @@ -2659,11 +2659,11 @@ protected function calculateDummyStatePriority output Integer outInteger3; algorithm (outComponentRef1,outInteger2,outInteger3):= - matchcontinue (inComponentRef,inInteger,inDAELow,inIncidenceMatrix,inIncidenceMatrixT) + matchcontinue (inComponentRef,inInteger,inBackendDAE,inIncidenceMatrix,inIncidenceMatrixT) local DAE.ComponentRef cr; BackendDAE.Value indx; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array> m,mt; case (cr,indx,dae,m,mt) then (cr,indx,0); end matchcontinue; @@ -2675,20 +2675,20 @@ protected function statesInEqns Helper function to reduce_index_dummy_der. Returns all states in the equations given as equation index list. inputs: (int list /* eqns */, - DAELow, + BackendDAE, IncidenceMatrix, IncidenceMatrixT) outputs: (DAE.ComponentRef list, /* name for each state */ int list) /* number for each state */" input list inIntegerLst; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input BackendDAE.IncidenceMatrix inIncidenceMatrix; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT; output list outExpComponentRefLst; output list outIntegerLst; algorithm (outExpComponentRefLst,outIntegerLst):= - matchcontinue (inIntegerLst,inDAELow,inIncidenceMatrix,inIncidenceMatrixT) + matchcontinue (inIntegerLst,inBackendDAE,inIncidenceMatrix,inIncidenceMatrixT) local list res1,res11,res1_1; list res2,vars2,res22,res2_1,rest; @@ -2698,9 +2698,9 @@ algorithm BackendDAE.Variables vars; BackendDAE.EquationArray eqns; array> m,mt; - BackendDAE.DAELow daelow; + BackendDAE.BackendDAE daelow; case ({},_,_,_) then ({},{}); - case ((e :: rest),daelow as BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns),m,mt) + case ((e :: rest),daelow as BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns),m,mt) equation (res1,res2) = statesInEqns(rest, daelow, m, mt); e_1 = e - 1; @@ -2716,7 +2716,7 @@ algorithm local String se; equation se = intString(e); - print("-DAELow.statesInEqns failed for eqn: "); + print("-BackendDAE.statesInEqns failed for eqn: "); print(se); print("\n"); then @@ -2875,19 +2875,19 @@ protected function differentiateEqns The function updates the dae, the incidence matrix and returns a list of indices of the differentiated equations, they are added last in the dae. - inputs: (DAELow, + inputs: (BackendDAE, IncidenceMatrix, IncidenceMatrixT, int, /* number of vars */ int, /* number of eqns */ int list) /* equations */ - outputs: (DAELow, + outputs: (BackendDAE, IncidenceMatrix, IncidenceMatrixT, int, /* number of vars */ int, /* number of eqns */ int list /* differentiated equations */)" - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input BackendDAE.IncidenceMatrix inIncidenceMatrix2; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT3; input Integer inInteger4; @@ -2896,7 +2896,7 @@ protected function differentiateEqns input DAE.FunctionTree inFunctions; input list> inDerivedAlgs; input list> inDerivedMultiEqn; - output BackendDAE.DAELow outDAELow1; + output BackendDAE.BackendDAE outBackendDAE1; output BackendDAE.IncidenceMatrix outIncidenceMatrix2; output BackendDAE.IncidenceMatrixT outIncidenceMatrixT3; output Integer outInteger4; @@ -2905,10 +2905,10 @@ protected function differentiateEqns output list> outDerivedAlgs; output list> outDerivedMultiEqn; algorithm - (outDAELow1,outIncidenceMatrix2,outIncidenceMatrixT3,outInteger4,outInteger5,outIntegerLst6,outDerivedAlgs,outDerivedMultiEqn):= - matchcontinue (inDAELow1,inIncidenceMatrix2,inIncidenceMatrixT3,inInteger4,inInteger5,inIntegerLst6,inFunctions,inDerivedAlgs,inDerivedMultiEqn) + (outBackendDAE1,outIncidenceMatrix2,outIncidenceMatrixT3,outInteger4,outInteger5,outIntegerLst6,outDerivedAlgs,outDerivedMultiEqn):= + matchcontinue (inBackendDAE1,inIncidenceMatrix2,inIncidenceMatrixT3,inInteger4,inInteger5,inIntegerLst6,inFunctions,inDerivedAlgs,inDerivedMultiEqn) local - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array> m,mt; BackendDAE.Value nv,nf,e_1,leneqns,e; BackendDAE.Equation eqn,eqn_1; @@ -2924,7 +2924,7 @@ algorithm list> derivedAlgs,derivedAlgs1; list> derivedMultiEqn,derivedMultiEqn1; case (dae,m,mt,nv,nf,{},_,inDerivedAlgs,inDerivedMultiEqn) then (dae,m,mt,nv,nf,{},inDerivedAlgs,inDerivedMultiEqn); - case ((dae as BackendDAE.DAELOW(v,kv,ev,av,eqns,seqns,ie,ae,al,wc,eoc)),m,mt,nv,nf,(e :: es),inFunctions,inDerivedAlgs,inDerivedMultiEqn) + case ((dae as BackendDAE.DAE(v,kv,ev,av,eqns,seqns,ie,ae,al,wc,eoc)),m,mt,nv,nf,(e :: es),inFunctions,inDerivedAlgs,inDerivedMultiEqn) equation e_1 = e - 1; eqn = BackendDAEUtil.equationNth(eqns, e_1); @@ -2945,10 +2945,10 @@ algorithm eqns_1 = BackendEquation.equationAdd(eqns, eqn_1); leneqns = BackendDAEUtil.equationSize(eqns_1); DAEEXT.markDifferentiated(e) "length gives index of new equation Mark equation as differentiated so it won\'t be differentiated again" ; - (dae,m,mt,nv,nf,reqns,derivedAlgs1,derivedMultiEqn1) = differentiateEqns(BackendDAE.DAELOW(v,kv,ev,av,eqns_1,seqns,ie,ae1,al1,wc,eoc), m, mt, nv, nf, es, inFunctions,derivedAlgs,derivedMultiEqn); + (dae,m,mt,nv,nf,reqns,derivedAlgs1,derivedMultiEqn1) = differentiateEqns(BackendDAE.DAE(v,kv,ev,av,eqns_1,seqns,ie,ae1,al1,wc,eoc), m, mt, nv, nf, es, inFunctions,derivedAlgs,derivedMultiEqn); then (dae,m,mt,nv,nf,(leneqns :: (e :: reqns)),derivedAlgs1,derivedMultiEqn1); - case ((dae as BackendDAE.DAELOW(v,kv,ev,av,eqns,seqns,ie,ae,al,wc,eoc)),m,mt,nv,nf,(e :: es),inFunctions,inDerivedAlgs,inDerivedMultiEqn) + case ((dae as BackendDAE.DAE(v,kv,ev,av,eqns,seqns,ie,ae,al,wc,eoc)),m,mt,nv,nf,(e :: es),inFunctions,inDerivedAlgs,inDerivedMultiEqn) equation e_1 = e - 1; eqn = BackendDAEUtil.equationNth(eqns, e_1); @@ -2968,7 +2968,7 @@ algorithm Debug.fprint("bltdump", "\n"); leneqns = BackendDAEUtil.equationSize(eqns); DAEEXT.markDifferentiated(e) "length gives index of new equation Mark equation as differentiated so it won\'t be differentiated again" ; - (dae,m,mt,nv,nf,reqns,derivedAlgs1,derivedMultiEqn1) = differentiateEqns(BackendDAE.DAELOW(v,kv,ev,av,eqns,seqns,ie,ae1,al1,wc,eoc), m, mt, nv, nf, es, inFunctions,derivedAlgs,derivedMultiEqn); + (dae,m,mt,nv,nf,reqns,derivedAlgs1,derivedMultiEqn1) = differentiateEqns(BackendDAE.DAE(v,kv,ev,av,eqns,seqns,ie,ae1,al1,wc,eoc), m, mt, nv, nf, es, inFunctions,derivedAlgs,derivedMultiEqn); then (dae,m,mt,nv,nf,(e :: reqns),derivedAlgs1,derivedMultiEqn1); case (_,_,_,_,_,_,_,_,_) diff --git a/Compiler/BackendDAEUtil.mo b/Compiler/BackendDAEUtil.mo index 0b4f7adc921..6f29194b4f6 100644 --- a/Compiler/BackendDAEUtil.mo +++ b/Compiler/BackendDAEUtil.mo @@ -32,7 +32,7 @@ package BackendDAEUtil " file: BackendDAEUtil.mo package: BackendDAEUtil - description: BackendDAEUtil comprised functions for DAELow data types. + description: BackendDAEUtil comprised functions for BackendDAE data types. RCS: $Id: BackendDAEUtil.mo 6426 2010-10-19 08:01:48Z adrpo $ @@ -80,7 +80,7 @@ protected import VarTransform; public function checkBackendDAEWithErrorMsg"function: checkBackendDAEWithErrorMsg author: Frenkel TUD run checkDEALow and prints all errors" - input BackendDAE.DAELow inBackendDAE; + input BackendDAE.BackendDAE inBackendDAE; list>> expCrefs; algorithm expCrefs := checkBackendDAE(inBackendDAE); @@ -130,7 +130,7 @@ public function checkBackendDAE "function: checkBackendDAE Returns all component references which not part of the BackendDAE object. " - input BackendDAE.DAELow inBackendDAE; + input BackendDAE.BackendDAE inBackendDAE; output list>> outExpCrefs; algorithm outExpCrefs := @@ -139,13 +139,13 @@ algorithm BackendDAE.Variables vars1,vars2,allvars; list varlst1,varlst2,allvarslst; list>> expcrefs; - case (BackendDAE.DAELOW(orderedVars = vars1,knownVars = vars2)) + case (BackendDAE.DAE(orderedVars = vars1,knownVars = vars2)) equation varlst1 = varList(vars1); varlst2 = varList(vars2); allvarslst = listAppend(varlst1,varlst2); allvars = listVar(allvarslst); - expcrefs = traverseDAELowExps(inBackendDAE,false,checkBackendDAEExp,allvars); + expcrefs = traverseBackendDAEExps(inBackendDAE,false,checkBackendDAEExp,allvars); then expcrefs; case (_) @@ -253,12 +253,12 @@ public function translateDae "function: translateDae - y for algebraic variables - p for parameters " - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input Option dummy; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; algorithm - outDAELow:= - matchcontinue (inDAELow,dummy) + outBackendDAE:= + matchcontinue (inBackendDAE,dummy) local list varlst,knvarlst,extvarlst; array ae; @@ -268,9 +268,9 @@ algorithm BackendDAE.Variables vars, knvars, extVars; BackendDAE.AliasVariables av; BackendDAE.EquationArray eqns,seqns,ieqns; - BackendDAE.DAELow trans_dae; + BackendDAE.BackendDAE trans_dae; BackendDAE.ExternalObjectClasses extObjCls; - case (BackendDAE.DAELOW(vars,knvars,extVars,av,eqns,seqns,ieqns,ae,al,BackendDAE.EVENT_INFO(whenClauseLst = wc,zeroCrossingLst = zc),extObjCls),_) + case (BackendDAE.DAE(vars,knvars,extVars,av,eqns,seqns,ieqns,ae,al,BackendDAE.EVENT_INFO(whenClauseLst = wc,zeroCrossingLst = zc),extObjCls),_) equation varlst = varList(vars); knvarlst = varList(knvars); @@ -282,7 +282,7 @@ algorithm vars = BackendVariable.addVars(varlst, vars); knvars = BackendVariable.addVars(knvarlst, knvars); extVars = BackendVariable.addVars(extvarlst, extVars); - trans_dae = BackendDAE.DAELOW(vars,knvars,extVars,av,eqns,seqns,ieqns,ae,al, + trans_dae = BackendDAE.DAE(vars,knvars,extVars,av,eqns,seqns,ieqns,ae,al, BackendDAE.EVENT_INFO(wc,zc),extObjCls); Debug.fcall("dumpindxdae", BackendDump.dump, trans_dae); then @@ -295,13 +295,13 @@ public function calculateSizes "function: calculateSizes Calculates the number of state variables, nx, the number of algebraic variables, ny and the number of parameters/constants, np. - inputs: DAELow + inputs: BackendDAE outputs: (int, /* nx */ int, /* ny */ int, /* np */ int /* ng */ int) next" - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output Integer outnx "number of states"; output Integer outny "number of alg. vars"; output Integer outnp "number of parameters"; @@ -319,7 +319,7 @@ public function calculateSizes "function: calculateSizes output Integer outnp_bool "number of parameters which are bools"; algorithm (outnx,outny,outnp,outng,outng_sample,outnext, outny_string, outnp_string, outny_int, outnp_int, outny_bool, outnp_bool):= - matchcontinue (inDAELow) + matchcontinue (inBackendDAE) local list varlst,knvarlst,extvarlst; BackendDAE.Value np,ng,nsam,nx,ny,nx_1,ny_1,next,ny_string,np_string,ny_1_string,np_int,np_bool,ny_int,ny_1_int,ny_bool,ny_1_bool; @@ -328,7 +328,7 @@ algorithm list wc; list zc; - case (BackendDAE.DAELOW(orderedVars = vars,knownVars = knvars, externalObjects = extvars, + case (BackendDAE.DAE(orderedVars = vars,knownVars = knvars, externalObjects = extvars, eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = wc, zeroCrossingLst = zc))) equation @@ -374,7 +374,7 @@ algorithm case (_,_,_) equation - print("- DAELow.calculateNumberZeroCrossings failed\n"); + print("- BackendDAE.calculateNumberZeroCrossings failed\n"); then fail(); @@ -428,7 +428,7 @@ algorithm (s1,s2,s3,s4); case (_) equation - print("- DAELow.calculateParamSizes failed\n"); + print("- BackendDAE.calculateParamSizes failed\n"); then fail(); end matchcontinue; @@ -588,7 +588,7 @@ algorithm case (_,_,_,_,_,_) equation - print("- DAELow.calculateVarSizes failed\n"); + print("- BackendDAE.calculateVarSizes failed\n"); then fail(); end matchcontinue; @@ -597,10 +597,10 @@ end calculateVarSizes; public function calculateValues "function: calculateValues author: PA This function calculates the values from the parameter binding expressions." - input BackendDAE.DAELow inDAELow; - output BackendDAE.DAELow outDAELow; + input BackendDAE.BackendDAE inBackendDAE; + output BackendDAE.BackendDAE outBackendDAE; algorithm - outDAELow := matchcontinue (inDAELow) + outBackendDAE := matchcontinue (inBackendDAE) local list knvarlst; BackendDAE.Variables knvars,vars,extVars; @@ -610,14 +610,14 @@ algorithm array al; BackendDAE.EventInfo wc; BackendDAE.ExternalObjectClasses extObjCls; - case (BackendDAE.DAELOW(orderedVars = vars,knownVars = knvars,externalObjects=extVars,aliasVars = av,orderedEqs = eqns, + case (BackendDAE.DAE(orderedVars = vars,knownVars = knvars,externalObjects=extVars,aliasVars = av,orderedEqs = eqns, removedEqs = seqns,initialEqs = ie,arrayEqs = ae,algorithms = al,eventInfo = wc,extObjClasses=extObjCls)) equation knvarlst = varList(knvars); knvarlst = Util.listMap1(knvarlst, calculateValue, knvars); knvars = listVar(knvarlst); then - BackendDAE.DAELOW(vars,knvars,extVars,av,eqns,seqns,ie,ae,al,wc,extObjCls); + BackendDAE.DAE(vars,knvars,extVars,av,eqns,seqns,ie,ae,al,wc,extObjCls); end matchcontinue; end calculateValues; @@ -691,12 +691,12 @@ algorithm end makeExpType; public function systemSize "returns the size of the dae system" -input BackendDAE.DAELow dae; +input BackendDAE.BackendDAE dae; output Integer n; algorithm n := matchcontinue(dae) local BackendDAE.EquationArray eqns; - case(BackendDAE.DAELOW(orderedEqs = eqns)) + case(BackendDAE.DAE(orderedEqs = eqns)) equation n = equationSize(eqns); then n; @@ -707,12 +707,12 @@ end systemSize; public function statesDaelow "function: statesDaelow author: PA - Returns a BackendDAE.BinTree of all states in the DAELow + Returns a BackendDAE.BinTree of all states in the BackendDAE This function is used in matching algorithm." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output BackendDAE.BinTree outBinTree; algorithm - outBinTree := matchcontinue (inDAELow) + outBinTree := matchcontinue (inBackendDAE) local list v_lst; BackendDAE.BinTree bt; @@ -721,7 +721,7 @@ algorithm array ae; array al; BackendDAE.EventInfo ev; - case (BackendDAE.DAELOW(orderedVars = v,knownVars = kn,orderedEqs = e,removedEqs = re,initialEqs = ia,arrayEqs = ae,algorithms = al,eventInfo = ev)) + case (BackendDAE.DAE(orderedVars = v,knownVars = kn,orderedEqs = e,removedEqs = re,initialEqs = ia,arrayEqs = ae,algorithms = al,eventInfo = ev)) equation v_lst = varList(v); bt = statesDaelow2(v_lst, BackendDAE.emptyBintree); @@ -1531,7 +1531,7 @@ algorithm case (e,vars) equation // adrpo: TODO! FIXME! this function fails for some of the expressions: cr.cr.cr[{1,2,3}] for example. - // Debug.fprintln("daelow", "- DAELow.statesAndVarsExp failed to extract states or vars from expression: " +& ExpressionDump.dumpExpStr(e,0)); + // Debug.fprintln("daelow", "- BackendDAE.statesAndVarsExp failed to extract states or vars from expression: " +& ExpressionDump.dumpExpStr(e,0)); then {}; end matchcontinue; end statesAndVarsExp; @@ -1874,7 +1874,7 @@ end isInput; /******************************************* - Functions that deals with DAELow as input + Functions that deals with BackendDAE as input ********************************************/ public function generateStatePartition "function:generateStatePartition @@ -1888,7 +1888,7 @@ public function generateStatePartition "function:generateStatePartition The traversal is made in the backward direction of this graph. The result is a split of the blocks into two lists. inputs: (blocks: int list list, - daeLow: DAELow, + daeLow: BackendDAE, assignments1: int vector, assignments2: int vector, incidenceMatrix: IncidenceMatrix, @@ -1896,7 +1896,7 @@ public function generateStatePartition "function:generateStatePartition outputs: (dynamicBlocks: int list list, outputBlocks: int list list) " input list> inIntegerLstLst1; - input BackendDAE.DAELow inDAELow2; + input BackendDAE.BackendDAE inBackendDAE2; input array inIntegerArray3; input array inIntegerArray4; input BackendDAE.IncidenceMatrix inIncidenceMatrix5; @@ -1905,19 +1905,19 @@ public function generateStatePartition "function:generateStatePartition output list> outIntegerLstLst2; algorithm (outIntegerLstLst1,outIntegerLstLst2):= - matchcontinue (inIntegerLstLst1,inDAELow2,inIntegerArray3,inIntegerArray4,inIncidenceMatrix5,inIncidenceMatrixT6) + matchcontinue (inIntegerLstLst1,inBackendDAE2,inIntegerArray3,inIntegerArray4,inIncidenceMatrix5,inIncidenceMatrixT6) local BackendDAE.Value size; array arr,arr_1; list> blt_states,blt_no_states,blt; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.Variables v,kv; BackendDAE.EquationArray e,se,ie; array ae; array al; array ass1,ass2; array> m,mt; - case (blt,(dae as BackendDAE.DAELOW(orderedVars = v,knownVars = kv,orderedEqs = e,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = al)),ass1,ass2,m,mt) + case (blt,(dae as BackendDAE.DAE(orderedVars = v,knownVars = kv,orderedEqs = e,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = al)),ass1,ass2,m,mt) equation size = arrayLength(ass1) "equation_size(e) => size &" ; arr = arrayCreate(size, 0); @@ -2007,7 +2007,7 @@ protected function markStateEquations "function: markStateEquations This is done by traversing the directed graph of nodes where a node is an equation/solved variable and following the edges in the backward direction. - inputs: (daeLow: DAELow, + inputs: (daeLow: BackendDAE, marks: int array, incidenceMatrix: IncidenceMatrix, incidenceMatrixT: IncidenceMatrixT, @@ -2015,7 +2015,7 @@ protected function markStateEquations "function: markStateEquations assignments2: int vector) outputs: marks: int array " - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input BackendDAE.IncidenceMatrix inIncidenceMatrix3; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT4; @@ -2024,10 +2024,10 @@ protected function markStateEquations "function: markStateEquations output array outIntegerArray; algorithm outIntegerArray:= - matchcontinue (inDAELow1,inIntegerArray2,inIncidenceMatrix3,inIncidenceMatrixT4,inIntegerArray5,inIntegerArray6) + matchcontinue (inBackendDAE1,inIntegerArray2,inIncidenceMatrix3,inIncidenceMatrixT4,inIntegerArray5,inIntegerArray6) local list v_lst,statevar_lst; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array arr_1,arr; array> m,mt; array a1,a2; @@ -2035,7 +2035,7 @@ algorithm BackendDAE.EquationArray e,se,ie; array ae; array alg; - case ((dae as BackendDAE.DAELOW(orderedVars = v,knownVars = kn,orderedEqs = e,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = alg)),arr,m,mt,a1,a2) + case ((dae as BackendDAE.DAE(orderedVars = v,knownVars = kn,orderedEqs = e,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = alg)),arr,m,mt,a1,a2) equation v_lst = varList(v); statevar_lst = Util.listSelect(v_lst, BackendVariable.isStateVar); @@ -2057,22 +2057,22 @@ protected function markStateEquation following edges in backward direction. inputs and outputs are tuples so we can use Util.list_fold" input BackendDAE.Var inVar; - input tuple, BackendDAE.IncidenceMatrix, BackendDAE.IncidenceMatrixT, array, array> inTplDAELowIntegerArrayIncidenceMatrixIncidenceMatrixTIntegerArrayIntegerArray; - output tuple, BackendDAE.IncidenceMatrix, BackendDAE.IncidenceMatrixT, array, array> outTplDAELowIntegerArrayIncidenceMatrixIncidenceMatrixTIntegerArrayIntegerArray; + input tuple, BackendDAE.IncidenceMatrix, BackendDAE.IncidenceMatrixT, array, array> inTplBackendDAEIntegerArrayIncidenceMatrixIncidenceMatrixTIntegerArrayIntegerArray; + output tuple, BackendDAE.IncidenceMatrix, BackendDAE.IncidenceMatrixT, array, array> outTplBackendDAEIntegerArrayIncidenceMatrixIncidenceMatrixTIntegerArrayIntegerArray; algorithm - outTplDAELowIntegerArrayIncidenceMatrixIncidenceMatrixTIntegerArrayIntegerArray:= - matchcontinue (inVar,inTplDAELowIntegerArrayIncidenceMatrixIncidenceMatrixTIntegerArrayIntegerArray) + outTplBackendDAEIntegerArrayIncidenceMatrixIncidenceMatrixTIntegerArrayIntegerArray:= + matchcontinue (inVar,inTplBackendDAEIntegerArrayIncidenceMatrixIncidenceMatrixTIntegerArrayIntegerArray) local list v_indxs,v_indxs_1,eqns; array arr_1,arr; array> m,mt; array a1,a2; DAE.ComponentRef cr; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.Variables vars; String s,str; BackendDAE.Value v_indx,v_indx_1; - case (BackendDAE.VAR(varName = cr),((dae as BackendDAE.DAELOW(orderedVars = vars)),arr,m,mt,a1,a2)) + case (BackendDAE.VAR(varName = cr),((dae as BackendDAE.DAE(orderedVars = vars)),arr,m,mt,a1,a2)) equation (_,v_indxs) = BackendVariable.getVar(cr, vars); v_indxs_1 = Util.listMap1(v_indxs, int_sub, 1); @@ -2080,7 +2080,7 @@ algorithm ((arr_1,m,mt,a1,a2)) = markStateEquation2(eqns, (arr,m,mt,a1,a2)); then ((dae,arr_1,m,mt,a1,a2)); - case (BackendDAE.VAR(varName = cr),((dae as BackendDAE.DAELOW(orderedVars = vars)),arr,m,mt,a1,a2)) + case (BackendDAE.VAR(varName = cr),((dae as BackendDAE.DAE(orderedVars = vars)),arr,m,mt,a1,a2)) equation failure((_,_) = BackendVariable.getVar(cr, vars)); print("mark_state_equation var "); @@ -2089,7 +2089,7 @@ algorithm print("not found\n"); then fail(); - case (BackendDAE.VAR(varName = cr),((dae as BackendDAE.DAELOW(orderedVars = vars)),arr,m,mt,a1,a2)) + case (BackendDAE.VAR(varName = cr),((dae as BackendDAE.DAE(orderedVars = vars)),arr,m,mt,a1,a2)) equation (_,{v_indx}) = BackendVariable.getVar(cr, vars); v_indx_1 = v_indx - 1; @@ -3070,10 +3070,10 @@ public function incidenceMatrix author: PA Calculates the incidence matrix, i.e. which variables are present in each equation." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output BackendDAE.IncidenceMatrix outIncidenceMatrix; algorithm - outIncidenceMatrix := matchcontinue (inDAELow) + outIncidenceMatrix := matchcontinue (inBackendDAE) local list eqnsl; list> lstlst; @@ -3081,7 +3081,7 @@ algorithm BackendDAE.Variables vars; BackendDAE.EquationArray eqns; list wc; - case (BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns, eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = wc))) + case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns, eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = wc))) equation eqnsl = equationList(eqns); lstlst = incidenceMatrix2(vars, eqnsl, wc); @@ -3218,7 +3218,7 @@ algorithm String eqnstr; equation eqnstr = BackendDump.equationStr(inEquation); - print("-DAELow.incidence_row failed for eqn: "); + print("-BackendDAE.incidence_row failed for eqn: "); print(eqnstr); print("\n"); then @@ -3657,12 +3657,12 @@ public function updateIncidenceMatrix to update, a list of changed variables are retrieved. This is used to update the BackendDAE.IncidenceMatrixT (transpose) mapping from variables to equations. The function returns an updated incidence matrix. - inputs: (DAELow, + inputs: (BackendDAE, IncidenceMatrix, IncidenceMatrixT, int list /* list of equations to update */) outputs: (IncidenceMatrix, IncidenceMatrixT)" - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input BackendDAE.IncidenceMatrix inIncidenceMatrix; input BackendDAE.IncidenceMatrixT inIncidenceMatrixT; input list inIntegerLst; @@ -3670,12 +3670,12 @@ public function updateIncidenceMatrix output BackendDAE.IncidenceMatrixT outIncidenceMatrixT; algorithm (outIncidenceMatrix,outIncidenceMatrixT):= - matchcontinue (inDAELow,inIncidenceMatrix,inIncidenceMatrixT,inIntegerLst) + matchcontinue (inBackendDAE,inIncidenceMatrix,inIncidenceMatrixT,inIntegerLst) local array> m_1,mt_1,m,mt; list> changedvars; list changedvars_1,eqns; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; case (dae,m,mt,eqns) equation @@ -3687,7 +3687,7 @@ algorithm case (dae,m,mt,eqns) equation - print("- DAELow.updateIncidenceMatrix failed\n"); + print("- BackendDAE.updateIncidenceMatrix failed\n"); then fail(); end matchcontinue; @@ -3697,20 +3697,20 @@ protected function updateIncidenceMatrix2 "function: updateIncidenceMatrix2 author: PA Helper function to updateIncidenceMatrix - inputs: (DAELow, + inputs: (BackendDAE, IncidenceMatrix, int list /* list of equations to update */) outputs: (IncidenceMatrix, int list list /* changed vars */)" - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input BackendDAE.IncidenceMatrix inIncidenceMatrix; input list inIntegerLst; output BackendDAE.IncidenceMatrix outIncidenceMatrix; output list> outIntegerLstLst; algorithm (outIncidenceMatrix,outIntegerLstLst):= - matchcontinue (inDAELow,inIncidenceMatrix,inIntegerLst) + matchcontinue (inBackendDAE,inIncidenceMatrix,inIntegerLst) local - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array> m,m_1,m_2; BackendDAE.Value e_1,e; BackendDAE.Equation eqn; @@ -3722,7 +3722,7 @@ algorithm case (dae,m,{}) then (m,{{}}); - case ((dae as BackendDAE.DAELOW(orderedVars = vars,knownVars = knvars,orderedEqs = daeeqns,removedEqs = daeseqns,eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = wc))),m,(e :: eqns)) + case ((dae as BackendDAE.DAE(orderedVars = vars,knownVars = knvars,orderedEqs = daeeqns,removedEqs = daeseqns,eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = wc))),m,(e :: eqns)) equation e_1 = e - 1; eqn = equationNth(daeeqns, e_1); @@ -3775,7 +3775,7 @@ algorithm mt_2; case (_,_,_) equation - print("DAELow.updateTransposedMatrix failed\n"); + print("BackendDAE.updateTransposedMatrix failed\n"); then fail(); end matchcontinue; @@ -3981,7 +3981,7 @@ algorithm (subs1,entry::entrylst); case (_,_,_) equation - Debug.fprintln("failtrace", "- DAELow.getArrayEquationSub failed"); + Debug.fprintln("failtrace", "- BackendDAE.getArrayEquationSub failed"); then fail(); end matchcontinue; @@ -4071,14 +4071,14 @@ public function analyzeJacobian "function: analyzeJacobian can be solved at compiletime or runtime or if it is a nonlinear system of equations. " - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input Option>> inTplIntegerIntegerEquationLstOption; output BackendDAE.JacobianType outJacobianType; algorithm outJacobianType:= - matchcontinue (inDAELow,inTplIntegerIntegerEquationLstOption) + matchcontinue (inBackendDAE,inTplIntegerIntegerEquationLstOption) local - BackendDAE.DAELow daelow; + BackendDAE.BackendDAE daelow; list> jac; case (daelow,SOME(jac)) equation @@ -4100,20 +4100,20 @@ protected function rhsConstant "function: rhsConstant author: PA Determines if the right hand sides of an equation system, - represented as a DAELow, is constant. + represented as a BackendDAE, is constant. " - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output Boolean outBoolean; algorithm outBoolean:= - matchcontinue (inDAELow) + matchcontinue (inBackendDAE) local list eqn_lst; Boolean res; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.Variables vars,knvars; BackendDAE.EquationArray eqns; - case ((dae as BackendDAE.DAELOW(orderedVars = vars,knownVars = knvars,orderedEqs = eqns))) + case ((dae as BackendDAE.DAE(orderedVars = vars,knownVars = knvars,orderedEqs = eqns))) equation eqn_lst = equationList(eqns); res = rhsConstant2(eqn_lst, dae); @@ -4126,16 +4126,16 @@ protected function rhsConstant2 "function: rhsConstant2 author: PA Helper function to rhsConstant, traverses equation list." input list inEquationLst; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output Boolean outBoolean; algorithm - outBoolean := matchcontinue (inEquationLst,inDAELow) + outBoolean := matchcontinue (inEquationLst,inBackendDAE) local DAE.ExpType tp; DAE.Exp new_exp,rhs_exp,e1,e2,e; Boolean res; list rest; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.Variables vars; BackendDAE.Value indx_1,indx; list ds; @@ -4144,7 +4144,7 @@ algorithm case ({},_) then true; // check rhs for for EQUATION nodes. - case ((BackendDAE.EQUATION(exp = e1,scalar = e2) :: rest),(dae as BackendDAE.DAELOW(orderedVars = vars))) + case ((BackendDAE.EQUATION(exp = e1,scalar = e2) :: rest),(dae as BackendDAE.DAE(orderedVars = vars))) equation tp = Expression.typeof(e1); new_exp = DAE.BINARY(e1,DAE.SUB(tp),e2); @@ -4154,7 +4154,7 @@ algorithm then res; // check rhs for for ARRAY_EQUATION nodes. check rhs for for RESIDUAL_EQUATION nodes. - case ((BackendDAE.ARRAY_EQUATION(index = indx,crefOrDerCref = expl) :: rest),(dae as BackendDAE.DAELOW(orderedVars = vars,arrayEqs = arreqn))) + case ((BackendDAE.ARRAY_EQUATION(index = indx,crefOrDerCref = expl) :: rest),(dae as BackendDAE.DAE(orderedVars = vars,arrayEqs = arreqn))) equation indx_1 = indx - 1; BackendDAE.MULTIDIM_EQUATION(ds,e1,e2,_) = arreqn[indx + 1]; @@ -4166,7 +4166,7 @@ algorithm then res; - case ((BackendDAE.RESIDUAL_EQUATION(exp = e) :: rest),(dae as BackendDAE.DAELOW(orderedVars = vars))) /* check rhs for for RESIDUAL_EQUATION nodes. */ + case ((BackendDAE.RESIDUAL_EQUATION(exp = e) :: rest),(dae as BackendDAE.DAE(orderedVars = vars))) /* check rhs for for RESIDUAL_EQUATION nodes. */ equation rhs_exp = getEqnsysRhsExp(e, vars); true = Expression.isConst(rhs_exp); @@ -4263,13 +4263,13 @@ protected function jacobianNonlinear "function: jacobianNonlinear author: PA Check if jacobian indicates a nonlinear system. TODO: Algorithms and Array equations" - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input list> inTplIntegerIntegerEquationLst; output Boolean outBoolean; algorithm - outBoolean := matchcontinue (inDAELow,inTplIntegerIntegerEquationLst) + outBoolean := matchcontinue (inBackendDAE,inTplIntegerIntegerEquationLst) local - BackendDAE.DAELow daelow; + BackendDAE.BackendDAE daelow; DAE.Exp e1,e2,e; list> xs; @@ -4296,17 +4296,17 @@ protected function jacobianNonlinearExp "function: jacobianNonlinearExp Checks wheter the jacobian indicates a nonlinear system. This is true if the jacobian contains any of the variables that is solved for." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input DAE.Exp inExp; output Boolean outBoolean; algorithm - outBoolean := matchcontinue (inDAELow,inExp) + outBoolean := matchcontinue (inBackendDAE,inExp) local list crefs; Boolean res; BackendDAE.Variables vars; DAE.Exp e; - case (BackendDAE.DAELOW(orderedVars = vars),e) + case (BackendDAE.DAE(orderedVars = vars),e) equation crefs = Expression.extractCrefsFromExp(e); res = containAnyVar(crefs, vars); @@ -4475,16 +4475,16 @@ end makeZeroReplacement; /************************************************* * traverseBackendDAE and stuff ************************************************/ -public function traverseDAELowExps "function: traverseDAELowExps +public function traverseBackendDAEExps "function: traverseBackendDAEExps author: Frenkel TUD - This function goes through the BackendDAE.DAELow structure and finds all the + This function goes through the BackendDAE.BackendDAE structure and finds all the expressions and performs the function on them in a list an extra argument passed through the function. " replaceable type Type_a subtypeof Any; replaceable type Type_b subtypeof Any; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input Boolean traverseAlgorithms "true if traverse also algorithms"; input FuncExpType func; input Type_a inTypeA; @@ -4496,7 +4496,7 @@ public function traverseDAELowExps "function: traverseDAELowExps end FuncExpType; algorithm outTypeBLst:= - matchcontinue (inDAELow,traverseAlgorithms,func,inTypeA) + matchcontinue (inBackendDAE,traverseAlgorithms,func,inTypeA) local list exps1,exps2,exps3,exps4,exps5,exps6,exps7,exps; list alglst; @@ -4504,44 +4504,44 @@ algorithm BackendDAE.EquationArray eqns,reqns,ieqns; array ae; array algs; - case (BackendDAE.DAELOW(orderedVars = vars1,knownVars = vars2,orderedEqs = eqns,removedEqs = reqns, + case (BackendDAE.DAE(orderedVars = vars1,knownVars = vars2,orderedEqs = eqns,removedEqs = reqns, initialEqs = ieqns,arrayEqs = ae,algorithms = algs),true,func,inTypeA) equation - exps1 = traverseDAELowExpsVars(vars1,func,inTypeA); - exps2 = traverseDAELowExpsVars(vars2,func,inTypeA); - exps3 = traverseDAELowExpsEqns(eqns,func,inTypeA); - exps4 = traverseDAELowExpsEqns(reqns,func,inTypeA); - exps5 = traverseDAELowExpsEqns(ieqns,func,inTypeA); - exps6 = traverseDAELowExpsArrayEqns(ae,func,inTypeA); + exps1 = traverseBackendDAEExpsVars(vars1,func,inTypeA); + exps2 = traverseBackendDAEExpsVars(vars2,func,inTypeA); + exps3 = traverseBackendDAEExpsEqns(eqns,func,inTypeA); + exps4 = traverseBackendDAEExpsEqns(reqns,func,inTypeA); + exps5 = traverseBackendDAEExpsEqns(ieqns,func,inTypeA); + exps6 = traverseBackendDAEExpsArrayEqns(ae,func,inTypeA); alglst = arrayList(algs); exps7 = Util.listMapFlat2(alglst, traverseAlgorithmExps,func,inTypeA); exps = Util.listFlatten({exps1,exps2,exps3,exps4,exps5,exps6,exps7}); then exps; - case (BackendDAE.DAELOW(orderedVars = vars1,knownVars = vars2,orderedEqs = eqns,removedEqs = reqns, + case (BackendDAE.DAE(orderedVars = vars1,knownVars = vars2,orderedEqs = eqns,removedEqs = reqns, initialEqs = ieqns,arrayEqs = ae,algorithms = algs),false,func,inTypeA) equation - exps1 = traverseDAELowExpsVars(vars1,func,inTypeA); - exps2 = traverseDAELowExpsVars(vars2,func,inTypeA); - exps3 = traverseDAELowExpsEqns(eqns,func,inTypeA); - exps4 = traverseDAELowExpsEqns(reqns,func,inTypeA); - exps5 = traverseDAELowExpsEqns(ieqns,func,inTypeA); - exps6 = traverseDAELowExpsArrayEqns(ae,func,inTypeA); + exps1 = traverseBackendDAEExpsVars(vars1,func,inTypeA); + exps2 = traverseBackendDAEExpsVars(vars2,func,inTypeA); + exps3 = traverseBackendDAEExpsEqns(eqns,func,inTypeA); + exps4 = traverseBackendDAEExpsEqns(reqns,func,inTypeA); + exps5 = traverseBackendDAEExpsEqns(ieqns,func,inTypeA); + exps6 = traverseBackendDAEExpsArrayEqns(ae,func,inTypeA); exps = Util.listFlatten({exps1,exps2,exps3,exps4,exps5,exps6}); then exps; case (_,_,_,_) equation - Debug.fprintln("failtrace", "- DAELow.traverseDAELowExps failed"); + Debug.fprintln("failtrace", "- BackendDAE.traverseBackendDAEExps failed"); then fail(); end matchcontinue; -end traverseDAELowExps; +end traverseBackendDAEExps; -protected function traverseDAELowExpsVars "function: traverseDAELowExpsVars +protected function traverseBackendDAEExpsVars "function: traverseBackendDAEExpsVars author: Frenkel TUD - Helper for traverseDAELowExps + Helper for traverseBackendDAEExps " input BackendDAE.Variables inVariables; input FuncExpType func; @@ -4569,20 +4569,20 @@ algorithm case (BackendDAE.VARIABLES(crefIdxLstArr = crefindex,strIdxLstArr = oldcrefindex,varArr = vararray,bucketSize = bsize,numberOfVars = nvars),func,inTypeA) equation vars = vararrayList(vararray) "We can ignore crefs, they don\'t contain real expressions" ; - talst = Util.listMapFlat2(vars, traverseDAELowExpsVar,func,inTypeA); + talst = Util.listMapFlat2(vars, traverseBackendDAEExpsVar,func,inTypeA); then talst; case (_,_,_) equation - Debug.fprintln("failtrace", "- DAELow.traverseDAELowExpsVars failed"); + Debug.fprintln("failtrace", "- BackendDAE.traverseBackendDAEExpsVars failed"); then fail(); end matchcontinue; -end traverseDAELowExpsVars; +end traverseBackendDAEExpsVars; -protected function traverseDAELowExpsVar "function: traverseDAELowExpsVar +protected function traverseBackendDAEExpsVar "function: traverseBackendDAEExpsVar author: Frenkel TUD - Helper traverseDAELowExpsVar. Get all exps from a Var. + Helper traverseBackendDAEExpsVar. Get all exps from a Var. DAE.ET_OTHER is used as type for componentref. Not important here. We only use the exp list for finding function calls" input BackendDAE.Var inVar; @@ -4615,7 +4615,7 @@ algorithm equation e1 = Util.optionToList(bndexp); talst = Util.listMapFlat1(e1,func,inTypeA); - talst1 = Util.listMapFlat2(instdims, traverseDAELowExpsSubscript,func,inTypeA); + talst1 = Util.listMapFlat2(instdims, traverseBackendDAEExpsSubscript,func,inTypeA); talst2 = listAppend(talst,talst1); talst3 = func(DAE.CREF(cref,DAE.ET_OTHER()),inTypeA); talst4 = listAppend(talst2,talst3); @@ -4623,15 +4623,15 @@ algorithm talst4; case (_,_,_) equation - Debug.fprintln("failtrace", "- DAELow.traverseDAELowExpsVar failed"); + Debug.fprintln("failtrace", "- BackendDAE.traverseBackendDAEExpsVar failed"); then fail(); end matchcontinue; -end traverseDAELowExpsVar; +end traverseBackendDAEExpsVar; -protected function traverseDAELowExpsSubscript "function: traverseDAELowExpsSubscript +protected function traverseBackendDAEExpsSubscript "function: traverseBackendDAEExpsSubscript author: Frenkel TUD - helper for traverseDAELowExpsSubscript" + helper for traverseBackendDAEExpsSubscript" input DAE.Subscript inSubscript; input FuncExpType func; input Type_a inTypeA; @@ -4661,12 +4661,12 @@ algorithm talst = func(e,inTypeA); then talst; end matchcontinue; -end traverseDAELowExpsSubscript; +end traverseBackendDAEExpsSubscript; -protected function traverseDAELowExpsEqns "function: traverseDAELowExpsEqns +protected function traverseBackendDAEExpsEqns "function: traverseBackendDAEExpsEqns author: Frenkel TUD - Helper for traverseDAELowExpsEqns + Helper for traverseBackendDAEExpsEqns " input BackendDAE.EquationArray inEquationArray; input FuncExpType func; @@ -4691,15 +4691,15 @@ algorithm case ((eqnarray as BackendDAE.EQUATION_ARRAY(numberOfElement = _)),func,inTypeA) equation eqns = equationList(eqnarray); - talst = Util.listMapFlat2(eqns, traverseDAELowExpsEqn,func,inTypeA); + talst = Util.listMapFlat2(eqns, traverseBackendDAEExpsEqn,func,inTypeA); then talst; end matchcontinue; -end traverseDAELowExpsEqns; +end traverseBackendDAEExpsEqns; -protected function traverseDAELowExpsEqn "function: traverseDAELowExpsEqn +protected function traverseBackendDAEExpsEqn "function: traverseBackendDAEExpsEqn author: PA - Helper for traverseDAELowExpsEqn." + Helper for traverseBackendDAEExpsEqn." input BackendDAE.Equation inEquation; input FuncExpType func; input Type_a inTypeA; @@ -4758,7 +4758,7 @@ algorithm talst = func(DAE.CREF(cr,tp),inTypeA); talst1 = func(e,inTypeA); talst2 = listAppend(talst,talst1); - talst3 = traverseDAELowExpsEqn(BackendDAE.WHEN_EQUATION(elsePart,source),func,inTypeA); + talst3 = traverseBackendDAEExpsEqn(BackendDAE.WHEN_EQUATION(elsePart,source),func,inTypeA); talst4 = listAppend(talst2,talst3); then talst4; @@ -4777,12 +4777,12 @@ algorithm then talst2; end matchcontinue; -end traverseDAELowExpsEqn; +end traverseBackendDAEExpsEqn; -protected function traverseDAELowExpsArrayEqns "function: traverseDAELowExpsArrayEqns +protected function traverseBackendDAEExpsArrayEqns "function: traverseBackendDAEExpsArrayEqns author: Frenkel TUD - helper for traverseDAELowExps + helper for traverseBackendDAEExps " input array arr; input FuncExpType func; @@ -4800,13 +4800,13 @@ protected function traverseDAELowExpsArrayEqns "function: traverseDAELowExpsArra list lst; algorithm lst := arrayList(arr); - outTypeBLst := Util.listMapFlat2(lst, traverseDAELowExpsArrayEqn,func,inTypeA); -end traverseDAELowExpsArrayEqns; + outTypeBLst := Util.listMapFlat2(lst, traverseBackendDAEExpsArrayEqn,func,inTypeA); +end traverseBackendDAEExpsArrayEqns; -protected function traverseDAELowExpsArrayEqn "function: traverseDAELowExpsArrayEqn +protected function traverseBackendDAEExpsArrayEqn "function: traverseBackendDAEExpsArrayEqn author: Frenkel TUD - Helper function to traverseDAELowExpsArrayEqns + Helper function to traverseBackendDAEExpsArrayEqns " input BackendDAE.MultiDimEquation inMultiDimEquation; input FuncExpType func; @@ -4835,7 +4835,7 @@ algorithm then talst2; end matchcontinue; -end traverseDAELowExpsArrayEqn; +end traverseBackendDAEExpsArrayEqn; public function traverseAlgorithmExps "function: traverseAlgorithmExps diff --git a/Compiler/BackendDump.mo b/Compiler/BackendDump.mo index ab4cd0ebc44..8e851d82af6 100644 --- a/Compiler/BackendDump.mo +++ b/Compiler/BackendDump.mo @@ -34,7 +34,7 @@ package BackendDump package: BackendDump description: Unparsing the BackendDAE structure - RCS: $Id: DAELow.mo 6553 2010-10-24 15:58:01Z sjoelund.se $ + RCS: $Id: BackendDAE.mo 6553 2010-10-24 15:58:01Z sjoelund.se $ " public import BackendDAE; @@ -173,14 +173,14 @@ end printPrioTuplesStr; public function printEquations input list inIntegerLst; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; algorithm _:= - matchcontinue (inIntegerLst,inDAELow) + matchcontinue (inIntegerLst,inBackendDAE) local BackendDAE.Value n; list rest; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; case ({},_) then (); case ((n :: rest),dae) equation @@ -197,15 +197,15 @@ protected function printEquationNo "function: printEquationNo Helper function to print_equations " input Integer inInteger; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; algorithm _:= - matchcontinue (inInteger,inDAELow) + matchcontinue (inInteger,inBackendDAE) local BackendDAE.Value eqno_1,eqno; BackendDAE.Equation eq; BackendDAE.EquationArray eqns; - case (eqno,BackendDAE.DAELOW(orderedEqs = eqns)) + case (eqno,BackendDAE.DAE(orderedEqs = eqns)) equation eqno_1 = eqno - 1; eq = BackendDAEUtil.equationNth(eqns, eqno_1); @@ -349,21 +349,21 @@ algorithm end matchcontinue; end dumpTearing; -public function dumpDAELowEqnList - input list inDAELowEqnList; +public function dumpBackendDAEEqnList + input list inBackendDAEEqnList; input String header; input Boolean printExpTree; algorithm print(header); - dumpDAELowEqnList2(inDAELowEqnList,printExpTree); + dumpBackendDAEEqnList2(inBackendDAEEqnList,printExpTree); print("===================\n"); -end dumpDAELowEqnList; +end dumpBackendDAEEqnList; -protected function dumpDAELowEqnList2 - input list inDAELowEqnList; +protected function dumpBackendDAEEqnList2 + input list inBackendDAEEqnList; input Boolean printExpTree; algorithm - _ := matchcontinue (inDAELowEqnList,printExpTree) + _ := matchcontinue (inBackendDAEEqnList,printExpTree) local DAE.Exp e1_1,e2_1,e1,e2,e_1,e; String str; @@ -376,7 +376,7 @@ algorithm case ({},_) then (); case (BackendDAE.EQUATION(e1,e2,source)::res,printExpTree) /* header */ equation - dumpDAELowEqnList2(res,printExpTree); + dumpBackendDAEEqnList2(res,printExpTree); print("EQUATION: "); str = ExpressionDump.printExpStr(e1); print(str); @@ -389,7 +389,7 @@ algorithm (); case (BackendDAE.COMPLEX_EQUATION(i,e1,e2,source)::res,printExpTree) /* header */ equation - dumpDAELowEqnList2(res,printExpTree); + dumpBackendDAEEqnList2(res,printExpTree); print("COMPLEX_EQUATION: "); str = ExpressionDump.printExpStr(e1); print(str); @@ -402,7 +402,7 @@ algorithm (); case (BackendDAE.SOLVED_EQUATION(_,e,source)::res,printExpTree) equation - dumpDAELowEqnList2(res,printExpTree); + dumpBackendDAEEqnList2(res,printExpTree); print("SOLVED_EQUATION: "); str = ExpressionDump.printExpStr(e); print(str); @@ -415,7 +415,7 @@ algorithm (); case (BackendDAE.RESIDUAL_EQUATION(e,source)::res,printExpTree) equation - dumpDAELowEqnList2(res,printExpTree); + dumpBackendDAEEqnList2(res,printExpTree); print("RESIDUAL_EQUATION: "); str = ExpressionDump.printExpStr(e); print(str); @@ -428,7 +428,7 @@ algorithm (); case (BackendDAE.ARRAY_EQUATION(_,expList,source)::res,printExpTree) equation - dumpDAELowEqnList2(res,printExpTree); + dumpBackendDAEEqnList2(res,printExpTree); print("ARRAY_EQUATION: "); strList = Util.listMap(expList,ExpressionDump.printExpStr); str = Util.stringDelimitList(strList," | "); @@ -438,7 +438,7 @@ algorithm (); case (BackendDAE.ALGORITHM(_,expList,expList2,source)::res,printExpTree) equation - dumpDAELowEqnList2(res,printExpTree); + dumpBackendDAEEqnList2(res,printExpTree); print("ALGORITHM: "); strList = Util.listMap(expList,ExpressionDump.printExpStr); str = Util.stringDelimitList(strList," | "); @@ -452,7 +452,7 @@ algorithm (); case (BackendDAE.WHEN_EQUATION(BackendDAE.WHEN_EQ(_,_,e,_/*TODO handle elsewhe also*/),source)::res,printExpTree) equation - dumpDAELowEqnList2(res,printExpTree); + dumpBackendDAEEqnList2(res,printExpTree); print("WHEN_EQUATION: "); str = ExpressionDump.printExpStr(e); print(str); @@ -467,7 +467,7 @@ algorithm equation then (); end matchcontinue; -end dumpDAELowEqnList2; +end dumpBackendDAEEqnList2; protected function dumpZcStr "function: dumpZcStr @@ -497,11 +497,11 @@ end dumpZcStr; public function dump "function: dump - This function dumps the BackendDAE.DAELow representaton to stdout." - input BackendDAE.DAELow inDAELow; + This function dumps the BackendDAE.BackendDAE representaton to stdout." + input BackendDAE.BackendDAE inBackendDAE; algorithm _:= - matchcontinue (inDAELow) + matchcontinue (inBackendDAE) local list vars,knvars,extvars; BackendDAE.Value varlen,eqnlen; @@ -516,7 +516,7 @@ algorithm array algs; list zc; BackendDAE.ExternalObjectClasses extObjCls; - case (BackendDAE.DAELOW(vars1,vars2,vars3,av,eqns,reqns,ieqns,ae,algs,BackendDAE.EVENT_INFO(zeroCrossingLst = zc),extObjCls)) + case (BackendDAE.DAE(vars1,vars2,vars3,av,eqns,reqns,ieqns,ae,algs,BackendDAE.EVENT_INFO(zeroCrossingLst = zc),extObjCls)) equation print("Variables ("); vars = BackendDAEUtil.varList(vars1); @@ -1177,20 +1177,20 @@ end dumpMatching2; public function dumpMarkedEqns "Dumps only the equations given as list of indexes to a string." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input list inIntegerLst; output String outString; algorithm - outString := matchcontinue (inDAELow,inIntegerLst) + outString := matchcontinue (inBackendDAE,inIntegerLst) local String s1,s2,res; BackendDAE.Value e_1,e; BackendDAE.Equation eqn; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.EquationArray eqns; list es; case (_,{}) then ""; - case ((dae as BackendDAE.DAELOW(orderedEqs = eqns)),(e :: es)) + case ((dae as BackendDAE.DAE(orderedEqs = eqns)),(e :: es)) equation s1 = dumpMarkedEqns(dae, es); e_1 = e - 1; @@ -1204,21 +1204,21 @@ end dumpMarkedEqns; public function dumpMarkedVars "Dumps only the variable names given as list of indexes to a string." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input list inIntegerLst; output String outString; algorithm outString:= - matchcontinue (inDAELow,inIntegerLst) + matchcontinue (inBackendDAE,inIntegerLst) local String s1,s2,res,s3; BackendDAE.Value v_1,v; DAE.ComponentRef cr; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.Variables vars; list vs; case (_,{}) then ""; - case ((dae as BackendDAE.DAELOW(orderedVars = vars)),(v :: vs)) + case ((dae as BackendDAE.DAE(orderedVars = vars)),(v :: vs)) equation s1 = dumpMarkedVars(dae, vs); BackendDAE.VAR(varName = cr) = BackendVariable.getVarAt(vars, v); diff --git a/Compiler/BackendEquation.mo b/Compiler/BackendEquation.mo index 0e85069e33b..5d90cc52986 100644 --- a/Compiler/BackendEquation.mo +++ b/Compiler/BackendEquation.mo @@ -103,17 +103,17 @@ end getWhenCondition; public function getZeroCrossingIndicesFromWhenClause "function: getZeroCrossingIndicesFromWhenClause Returns a list of indices of zerocrossings that a given when clause is dependent on. " - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input Integer inInteger; output list outIntegerLst; algorithm outIntegerLst:= - matchcontinue (inDAELow,inInteger) + matchcontinue (inBackendDAE,inInteger) local list res; list zcLst; BackendDAE.Value when_index; - case (BackendDAE.DAELOW(eventInfo = BackendDAE.EVENT_INFO(zeroCrossingLst = zcLst)),when_index) + case (BackendDAE.DAE(eventInfo = BackendDAE.EVENT_INFO(zeroCrossingLst = zcLst)),when_index) equation res = getZeroCrossingIndicesFromWhenClause2(zcLst, 0, when_index); then @@ -411,20 +411,20 @@ algorithm case (e) local BackendDAE.Equation e; equation - Debug.fprintln("failtrace", "- DAELow.equationToResidualForm failed"); + Debug.fprintln("failtrace", "- BackendDAE.equationToResidualForm failed"); then fail(); end matchcontinue; end equationToResidualForm; -public function equationInfo "Retrieve the line number information from a BackendDAE.DAELow equation" +public function equationInfo "Retrieve the line number information from a BackendDAE.BackendDAE equation" input BackendDAE.Equation eq; output Absyn.Info info; algorithm info := DAEUtil.getElementSourceFileInfo(equationSource(eq)); end equationInfo; -protected function equationSource "Retrieve the source from a BackendDAE.DAELow equation" +protected function equationSource "Retrieve the source from a BackendDAE.BackendDAE equation" input BackendDAE.Equation eq; output DAE.ElementSource source; algorithm diff --git a/Compiler/BackendVarTransform.mo b/Compiler/BackendVarTransform.mo index 8a530740c33..26ab61e3c92 100644 --- a/Compiler/BackendVarTransform.mo +++ b/Compiler/BackendVarTransform.mo @@ -53,12 +53,12 @@ public function replaceEquations This function takes a list of equations ana a set of variable replacements and applies the replacements on all equations. The function returns the updated list of equations" - input list inDAELowEquationLst; + input list inBackendDAEEquationLst; input VarTransform.VariableReplacements inVariableReplacements; - output list outDAELowEquationLst; + output list outBackendDAEEquationLst; algorithm - outDAELowEquationLst:= - matchcontinue (inDAELowEquationLst,inVariableReplacements) + outBackendDAEEquationLst:= + matchcontinue (inBackendDAEEquationLst,inVariableReplacements) local DAE.Exp e1_1,e2_1,e1_2,e2_2,e1,e2,e_1,e_2,e; list es_1,es; @@ -179,12 +179,12 @@ public function replaceEquations "function: replaceEquations and applies the replacements on all equations. The function returns the updated list of equations " - input list inDAELowEquationLst; + input list inBackendDAEEquationLst; input VarTransform.VariableReplacements inVariableReplacements; - output list outDAELowEquationLst; + output list outBackendDAEEquationLst; algorithm - outDAELowEquationLst:= - matchcontinue (inDAELowEquationLst,inVariableReplacements) + outBackendDAEEquationLst:= + matchcontinue (inBackendDAEEquationLst,inVariableReplacements) local DAE.Exp e1_1,e2_1,e1_2,e2_2,e1,e2,e_1,e_2,e; list es_1,es; @@ -348,12 +348,12 @@ public function replaceMultiDimEquations "function: replaceMultiDimEquations and applies the replacements on all array equations. The function returns the updated list of array equations " - input list inDAELowEquationLst; + input list inBackendDAEEquationLst; input VarTransform.VariableReplacements inVariableReplacements; - output list outDAELowEquationLst; + output list outBackendDAEEquationLst; algorithm - outDAELowEquationLst:= - matchcontinue (inDAELowEquationLst,inVariableReplacements) + outBackendDAEEquationLst:= + matchcontinue (inBackendDAEEquationLst,inVariableReplacements) local DAE.Exp e1_1,e2_1,e1,e2,e_1,e,e1_2,e2_2; list es_1,es; diff --git a/Compiler/BackendVariable.mo b/Compiler/BackendVariable.mo index 8596dbc44d9..a3d61ec95ae 100644 --- a/Compiler/BackendVariable.mo +++ b/Compiler/BackendVariable.mo @@ -2051,23 +2051,23 @@ end calculateIndexes2; public function daeVars - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output BackendDAE.Variables vars; algorithm - vars := matchcontinue (inDAELow) + vars := matchcontinue (inBackendDAE) local BackendDAE.Variables vars1,vars2; - case (BackendDAE.DAELOW(orderedVars = vars1, knownVars = vars2)) + case (BackendDAE.DAE(orderedVars = vars1, knownVars = vars2)) then vars1; end matchcontinue; end daeVars; public function daeKnVars - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output BackendDAE.Variables vars; algorithm - vars := matchcontinue (inDAELow) + vars := matchcontinue (inBackendDAE) local BackendDAE.Variables vars1,vars2; - case (BackendDAE.DAELOW(orderedVars = vars1, knownVars = vars2)) + case (BackendDAE.DAE(orderedVars = vars1, knownVars = vars2)) then vars2; end matchcontinue; end daeKnVars; diff --git a/Compiler/CevalScript.mo b/Compiler/CevalScript.mo index 64a6fe24932..75b7f7dbf65 100644 --- a/Compiler/CevalScript.mo +++ b/Compiler/CevalScript.mo @@ -215,7 +215,7 @@ algorithm Absyn.Class class_; DAE.DAElist dae_1,dae; list dael; - BackendDAE.DAELow daelow; + BackendDAE.BackendDAE daelow; BackendDAE.Variables vars; BackendDAE.EquationArray eqnarr; BackendDAE.MultiDimEquation[:] ae; @@ -345,8 +345,8 @@ algorithm Inst.instantiateClass(cache,InnerOuter.emptyInstHierarchy,p_1, path); dae = DAEUtil.transformationsBeforeBackend(dae); ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(path,dae,env)); - /*((daelow as BackendDAE.DAELOW(orderedVars=vars,orderedEqs=eqnarr,complexEqns = BackendDAE.COMPLEX_EQUATIONS(arrayEqs=ae,ifEqns=ifeqns)))) = BackendDAECreate.lower(dae, false, true) "no dummy state" ;*/ - ((daelow as BackendDAE.DAELOW(vars,_,_,_,eqnarr,_,_,ae,_,_,_))) = BackendDAECreate.lower(dae, Env.getFunctionTree(cache), false, true) "no dummy state" ; + /*((daelow as BackendDAE.DAE(orderedVars=vars,orderedEqs=eqnarr,complexEqns = BackendDAE.COMPLEX_EQUATIONS(arrayEqs=ae,ifEqns=ifeqns)))) = BackendDAECreate.lower(dae, false, true) "no dummy state" ;*/ + ((daelow as BackendDAE.DAE(vars,_,_,_,eqnarr,_,_,ae,_,_,_))) = BackendDAECreate.lower(dae, Env.getFunctionTree(cache), false, true) "no dummy state" ; m = BackendDAEUtil.incidenceMatrix(daelow); mt = BackendDAEUtil.transposeMatrix(m); /* jac = BackendDAEUtil.calculateJacobian(vars, eqnarr, ae,ifeqns, m, mt,false); */ @@ -2348,7 +2348,7 @@ algorithm list env; list dael; list ic_1,ic; - BackendDAE.DAELow dlow,dlow_1,indexed_dlow,indexed_dlow_1; + BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow,indexed_dlow_1; list[:] m,mT; Integer[:] ass1,ass2; list> comps; @@ -2405,17 +2405,17 @@ protected function translateModel "function translateModel output Env.Cache outCache; output Values.Value outValue; output Interactive.InteractiveSymbolTable outInteractiveSymbolTable; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; output list outStringLst; output String outFileDir; output list> resultValues; algorithm - (outCache,outValue,outInteractiveSymbolTable,outDAELow,outStringLst,outFileDir,resultValues):= + (outCache,outValue,outInteractiveSymbolTable,outBackendDAE,outStringLst,outFileDir,resultValues):= matchcontinue (inCache,inEnv,className,inInteractiveSymbolTable,inFileNamePrefix,addDummy,inSimSettingsOpt) local Env.Cache cache; list env; - BackendDAE.DAELow indexed_dlow; + BackendDAE.BackendDAE indexed_dlow; Interactive.InteractiveSymbolTable st; list libs; Ceval.Msg msg; @@ -2444,17 +2444,17 @@ protected function translateModelFMU "function translateModelFMU output Env.Cache outCache; output Values.Value outValue; output Interactive.InteractiveSymbolTable outInteractiveSymbolTable; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; output list outStringLst; output String outFileDir; output list> resultValues; algorithm - (outCache,outValue,outInteractiveSymbolTable,outDAELow,outStringLst,outFileDir,resultValues):= + (outCache,outValue,outInteractiveSymbolTable,outBackendDAE,outStringLst,outFileDir,resultValues):= matchcontinue (inCache,inEnv,className,inInteractiveSymbolTable,inFileNamePrefix,addDummy,inSimSettingsOpt) local Env.Cache cache; list env; - BackendDAE.DAELow indexed_dlow; + BackendDAE.BackendDAE indexed_dlow; Interactive.InteractiveSymbolTable st; list libs; Ceval.Msg msg; @@ -2490,7 +2490,7 @@ algorithm list env; list dael; list ic_1,ic; - BackendDAE.DAELow dlow,dlow_1,indexed_dlow,indexed_dlow_1; + BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow,indexed_dlow_1; list[:] m,mT; Integer[:] ass1,ass2; list> comps; @@ -2616,7 +2616,7 @@ algorithm local Values.Value ret_val; Interactive.InteractiveSymbolTable st,st_1,st2; - BackendDAE.DAELow indexed_dlow_1; + BackendDAE.BackendDAE indexed_dlow_1; list libs; String prefix_str,file_dir,cname_str,init_filename,method_str,filenameprefix,makefilename,oldDir,tempDir,tolerance_str,options_str; Absyn.Path classname,w; @@ -3432,7 +3432,7 @@ algorithm list env; list dael; list ic_1,ic; - BackendDAE.DAELow dlow,dlow_1,indexed_dlow,indexed_dlow_1; + BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow,indexed_dlow_1; list[:] m,mT; Integer[:] ass1,ass2; list> comps; @@ -3510,7 +3510,7 @@ algorithm // ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(className,dae,env)); elimLevel = RTOpts.eliminationLevel(); RTOpts.setEliminationLevel(0); // No variable elimination - (dlow as BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(numberOfVars = varSize),orderedEqs = eqns)) + (dlow as BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(numberOfVars = varSize),orderedEqs = eqns)) = BackendDAECreate.lower(dae, Env.getFunctionTree(cache), false/* no dummy variable*/, true); Debug.fcall("dumpdaelow", BackendDump.dump, dlow); RTOpts.setEliminationLevel(elimLevel); // reset elimination level. @@ -3550,7 +3550,7 @@ algorithm // ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(className,dae,env)); elimLevel = RTOpts.eliminationLevel(); RTOpts.setEliminationLevel(0); // No variable elimination - (dlow as BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(numberOfVars = varSize),orderedEqs = eqns)) + (dlow as BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(numberOfVars = varSize),orderedEqs = eqns)) = BackendDAECreate.lower(dae, Env.getFunctionTree(cache), false/* no dummy variable*/, true); Debug.fcall("dumpdaelow", BackendDump.dump, dlow); RTOpts.setEliminationLevel(elimLevel); // reset elimination level. @@ -3862,7 +3862,7 @@ algorithm list env; Absyn.Path classname; Absyn.Program p; - BackendDAE.DAELow indexed_dlow_1; + BackendDAE.BackendDAE indexed_dlow_1; Env.Cache cache; DAE.Exp exp,fileprefix,storeInTemp,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals; DAE.ComponentRef cr; @@ -3878,7 +3878,7 @@ algorithm Boolean x; Integer[:] ass1,ass2; DAE.DAElist dae_1,dae; - BackendDAE.DAELow dlow; + BackendDAE.BackendDAE dlow; list[:] m,mT; list dael; list ic_1,ic; @@ -3902,7 +3902,7 @@ algorithm xml_filename = stringAppendList({filenameprefix,".xml"}); funcelems = DAEUtil.getFunctionList(Env.getFunctionTree(cache)); Print.clearBuf(); - XMLDump.dumpDAELow(dlow,funcelems,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals); + XMLDump.dumpBackendDAE(dlow,funcelems,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals); xml_contents = Print.getString(); Print.clearBuf(); System.writeFile(xml_filename,xml_contents); @@ -3916,7 +3916,7 @@ algorithm local Boolean x; DAE.DAElist dae_1,dae; - BackendDAE.DAELow dlow,dlow_1; + BackendDAE.BackendDAE dlow,dlow_1; list[:] m,mT; list dael; list ic_1,ic; @@ -3943,7 +3943,7 @@ algorithm xml_filename = stringAppendList({filenameprefix,".xml"}); funcelems = DAEUtil.getFunctionList(Env.getFunctionTree(cache)); Print.clearBuf(); - XMLDump.dumpDAELow(dlow_1,funcelems,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals); + XMLDump.dumpBackendDAE(dlow_1,funcelems,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals); xml_contents = Print.getString(); Print.clearBuf(); System.writeFile(xml_filename,xml_contents); @@ -3957,7 +3957,7 @@ algorithm Boolean x; Integer[:] ass1,ass2; DAE.DAElist dae_1,dae; - BackendDAE.DAELow dlow,dlow_1,indexed_dlow,indexed_dlow_1; + BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow,indexed_dlow_1; list[:] m,mT; list dael; list ic_1,ic; @@ -3988,7 +3988,7 @@ algorithm xml_filename = stringAppendList({filenameprefix,".xml"}); funcelems = DAEUtil.getFunctionList(Env.getFunctionTree(cache)); Print.clearBuf(); - XMLDump.dumpDAELow(indexed_dlow_1,funcelems,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals); + XMLDump.dumpBackendDAE(indexed_dlow_1,funcelems,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals); xml_contents = Print.getString(); Print.clearBuf(); System.writeFile(xml_filename,xml_contents); @@ -4259,7 +4259,7 @@ algorithm local Values.Value ret_val; Interactive.InteractiveSymbolTable st,st_1,st2; - BackendDAE.DAELow indexed_dlow_1; + BackendDAE.BackendDAE indexed_dlow_1; list libs; String prefix_str,file_dir,cname_str,init_filename,method_str,filenameprefix,makefilename,oldDir,tempDir,options_str,outputFormat_str; Absyn.Path classname,w; diff --git a/Compiler/ComponentReference.mo b/Compiler/ComponentReference.mo index 0dde3f2818f..4ddbdc5202f 100644 --- a/Compiler/ComponentReference.mo +++ b/Compiler/ComponentReference.mo @@ -736,7 +736,7 @@ algorithm // BZ 2009-12 // For some reason in some examples we get crefs on different forms. // the compare can be crefEqual(CREF_IDENT("mycref",_,{1,2,3}),CREF_IDENT("mycref[1,2,3]",_,{})) - // I do belive this has something to do with variable replacement and DAELow. + // I do belive this has something to do with variable replacement and BackendDAE. // TODO: investigate reason, until then keep as is. // I do believe that this is the same bug as adrians qual-ident bug below. case (DAE.CREF_IDENT(ident = n1,subscriptLst = {}),DAE.CREF_IDENT(ident = n2,subscriptLst = (idx2 as _::_))) diff --git a/Compiler/DAEEXT.mo b/Compiler/DAEEXT.mo index 476a6734535..afb788dc9ff 100644 --- a/Compiler/DAEEXT.mo +++ b/Compiler/DAEEXT.mo @@ -34,7 +34,7 @@ package DAEEXT package: DAEEXT The DAEEXT module is an externally implemented module (in file runtime/daeext.cpp) - used for the BLT and index reduction algorithms in \'DAELow\'. The implementation + used for the BLT and index reduction algorithms in \'BackendDAE\'. The implementation mainly consists of several bitvectors implemented using std::vector since such functionality is not available in MetaModelica Compiler (MMC)." diff --git a/Compiler/DAELow_stub.mo b/Compiler/DAELow_stub.mo deleted file mode 100644 index 884d0abc0ef..00000000000 --- a/Compiler/DAELow_stub.mo +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of OpenModelica. - * - * Copyright (c) 1998-CurrentYear, Linköping University, - * Department of Computer and Information Science, - * SE-58183 Linköping, Sweden. - * - * All rights reserved. - * - * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 - * AND THIS OSMC PUBLIC LICENSE (OSMC-PL). - * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S - * ACCEPTANCE OF THE OSMC PUBLIC LICENSE. - * - * The OpenModelica software and the Open Source Modelica - * Consortium (OSMC) Public License (OSMC-PL) are obtained - * from Linköping University, either from the above address, - * from the URLs: http://www.ida.liu.se/projects/OpenModelica or - * http://www.openmodelica.org, and in the OpenModelica distribution. - * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. - * - * This program is distributed WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH - * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS - * OF OSMC-PL. - * - * See the full OSMC Public License conditions for more details. - * - */ - -package DAELow -" file: DAELow_stub.mo - package: DAELow - description: Just a stub for compiling the frontend. - - RCS: $Id$ -" - - -public constant String derivativeNamePrefix="$DER"; -public constant String pointStr = "$P"; -public constant String leftBraketStr = "$lB"; -public constant String rightBraketStr = "$rB"; -public constant String leftParStr = "$lP"; -public constant String rightParStr = "$rP"; -public constant String commaStr = "$c"; - -end DAELow; - diff --git a/Compiler/DAEQuery.mo b/Compiler/DAEQuery.mo index 8f63f2a4067..9528434e41f 100644 --- a/Compiler/DAEQuery.mo +++ b/Compiler/DAEQuery.mo @@ -57,7 +57,7 @@ import DAEDump; protected constant String matlabStringDelim = "'"; public function writeIncidenceMatrix - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input String fileNamePrefix; input String flatModelicaStr; output String fileName; @@ -84,11 +84,11 @@ public function getEquations "function: getEquations @author adrpo This function returns the equations" - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output String strEqs; algorithm strEqs:= - matchcontinue (inDAELow) + matchcontinue (inBackendDAE) local String s,s1; list ls1; @@ -96,7 +96,7 @@ algorithm list ss; BackendDAE.EquationArray eqns; list wcLst; - case (BackendDAE.DAELOW(orderedEqs = eqns, eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = wcLst))) + case (BackendDAE.DAE(orderedEqs = eqns, eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = wcLst))) equation eqnsl = BackendDAEUtil.equationList(eqns); ls1 = Util.listMap1(eqnsl, equationStr, wcLst); @@ -243,16 +243,16 @@ end getIncidenceRow; public function getVariables "function: getVariables This function returns the variables " - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output String strVars; algorithm strVars:= - matchcontinue (inDAELow) + matchcontinue (inBackendDAE) local list vars; String s; BackendDAE.Variables vars1; - case (BackendDAE.DAELOW(orderedVars = vars1)) + case (BackendDAE.DAE(orderedVars = vars1)) equation vars = varList(vars1); s = dumpVars(vars); @@ -463,18 +463,18 @@ public function incidenceMatrix author: PA Calculates the incidence matrix, i.e. which variables are present in each equation." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output list[:] outIncidenceMatrix; algorithm outIncidenceMatrix:= - matchcontinue (inDAELow) + matchcontinue (inBackendDAE) local list eqnsl; list> lstlst; list[:] arr; BackendDAE.Variables vars; BackendDAE.EquationArray eqns; - case (BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns)) + case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns)) equation eqnsl = BackendDAEUtil.equationList(eqns); lstlst = incidenceMatrix2(vars, eqnsl); diff --git a/Compiler/Derive.mo b/Compiler/Derive.mo index 71b24e4ebdc..f36e642fc74 100644 --- a/Compiler/Derive.mo +++ b/Compiler/Derive.mo @@ -32,7 +32,7 @@ package Derive " file: Derive.mo package: Derive - description: Differentiation of equations from BackendDAE.DAELow + description: Differentiation of equations from BackendDAE.BackendDAE RCS: $Id$ diff --git a/Compiler/Derive_stub.mo b/Compiler/Derive_stub.mo index f5f141cc4c0..07873184184 100644 --- a/Compiler/Derive_stub.mo +++ b/Compiler/Derive_stub.mo @@ -32,7 +32,7 @@ package Derive " file: Derive.mo package: Derive - description: Differentiation of equations from DAELow + description: Differentiation of equations from BackendDAE RCS: $Id$ diff --git a/Compiler/Inline.mo b/Compiler/Inline.mo index 86ba48af038..e7d15b662c1 100644 --- a/Compiler/Inline.mo +++ b/Compiler/Inline.mo @@ -65,10 +65,10 @@ public function inlineCalls searches for calls where the inline flag is true, and inlines them" input Option inFTree "functions"; input list inITLst; - input BackendDAE.DAELow inDAELow; - output BackendDAE.DAELow outDAELow; + input BackendDAE.BackendDAE inBackendDAE; + output BackendDAE.BackendDAE outBackendDAE; algorithm - outDAELow := matchcontinue(inFTree,inITLst,inDAELow) + outBackendDAE := matchcontinue(inFTree,inITLst,inBackendDAE) local Option> fns; Option ftree; @@ -86,7 +86,7 @@ algorithm list alglst; BackendDAE.EventInfo eventInfo; BackendDAE.ExternalObjectClasses extObjClasses; - case(ftree,itlst,BackendDAE.DAELOW(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs,removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses)) + case(ftree,itlst,BackendDAE.DAE(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs,removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses)) equation orderedVars = inlineVariables(orderedVars,(ftree,itlst)); knownVars = inlineVariables(knownVars,(ftree,itlst)); @@ -101,7 +101,7 @@ algorithm eventInfo = inlineEventInfo(eventInfo,(ftree,itlst)); extObjClasses = inlineExtObjClasses(extObjClasses,(ftree,itlst)); then - BackendDAE.DAELOW(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs,removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses); + BackendDAE.DAE(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs,removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses); case(_,_,_) equation Debug.fprintln("failtrace","Inline.inlineCalls failed"); diff --git a/Compiler/Inst.mo b/Compiler/Inst.mo index ef3d9851136..2f14242d424 100644 --- a/Compiler/Inst.mo +++ b/Compiler/Inst.mo @@ -14770,7 +14770,7 @@ algorithm String warnings,eqnSizeStr,varSizeStr,retStr,classNameStr,simpleEqnSizeStr; BackendDAE.EquationArray eqns; Integer elimLevel; - BackendDAE.DAELow dlow,dlow_1,indexed_dlow,indexed_dlow_1; + BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow,indexed_dlow_1; // check the balancing of the instantiated model // special case for no elements! case (classNameOpt, DAE.DAE({},_)) @@ -14787,7 +14787,7 @@ algorithm dae = DAEUtil.transformIfEqToExpr(dae,false); elimLevel = RTOpts.eliminationLevel(); RTOpts.setEliminationLevel(0); // No variable elimination - (dlow as BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(numberOfVars = varSize),orderedEqs = eqns)) + (dlow as BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(numberOfVars = varSize),orderedEqs = eqns)) = BackendDAECreate.lower(dae, false, true); // Debug.fcall("dumpdaelow", BackendDump.dump, dlow); RTOpts.setEliminationLevel(elimLevel); // reset elimination level. diff --git a/Compiler/Linearization.mo b/Compiler/Linearization.mo index e643c1a2fac..092bb5be4cf 100644 --- a/Compiler/Linearization.mo +++ b/Compiler/Linearization.mo @@ -64,21 +64,21 @@ public constant String partialDerivativeNamePrefix="$pDER"; public function generateLinearMatrix // function: generateLinearMatrix // author: wbraun - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input DAE.FunctionTree functionTree; input list inComRef1; // eqnvars input list inComRef2; // vars to differentiate input list inAllVar; - output BackendDAE.DAELow outJacobian; + output BackendDAE.BackendDAE outJacobian; output array outV1; output array outV2; output list> outComps1; algorithm (outJacobian,outV1,outV2,outComps1) := - matchcontinue (inDAELow,functionTree,inComRef1,inComRef2,inAllVar) + matchcontinue (inBackendDAE,functionTree,inComRef1,inComRef2,inAllVar) local DAE.DAElist dae; - BackendDAE.DAELow dlow; + BackendDAE.BackendDAE dlow; list eqvars,diffvars; list varlst; @@ -105,15 +105,15 @@ algorithm list s; String str; - case(dlow as BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),_,{},_,_) + case(dlow as BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),_,{},_,_) equation v = BackendDAEUtil.listVar({}); - then (BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),listArray({}),listArray({}),{}); - case(dlow as BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),_,_,{},_) + then (BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),listArray({}),listArray({}),{}); + case(dlow as BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),_,_,{},_) equation v = BackendDAEUtil.listVar({}); - then (BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),listArray({}),listArray({}),{}); - case(dlow as BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),functionTree,eqvars,diffvars,varlst) + then (BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),listArray({}),listArray({}),{}); + case(dlow as BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),functionTree,eqvars,diffvars,varlst) equation // prepare index for Matrix and variables for simpleEquations @@ -136,7 +136,7 @@ algorithm ie = BackendDAEUtil.listEquation(ie_lst); ae = listArray(ae_lst); al = listArray(algs); - dlow = BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc); + dlow = BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc); // figure out new matching and the strong components m = BackendDAEUtil.incidenceMatrix(dlow); @@ -289,22 +289,22 @@ end checkIndex; public function generateSymbolicJacobian // function: generateSymbolicJacobian // author: lochel - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input DAE.FunctionTree functions; input list inVars; input list stateVars; input list inputVars; input list paramVars; - output BackendDAE.DAELow outJacobian; + output BackendDAE.BackendDAE outJacobian; algorithm - outJacobian := matchcontinue(inDAELow, functions, inVars, stateVars, inputVars, paramVars) + outJacobian := matchcontinue(inBackendDAE, functions, inVars, stateVars, inputVars, paramVars) local - BackendDAE.DAELow daeLow; + BackendDAE.BackendDAE daeLow; DAE.DAElist daeList; list vars; - BackendDAE.DAELow jacobian; + BackendDAE.BackendDAE jacobian; - // DAELOW + // DAE BackendDAE.Variables orderedVars, jacOrderedVars; BackendDAE.Variables knownVars, jacKnownVars; BackendDAE.Variables externalObjects, jacExternalObjects; @@ -316,7 +316,7 @@ algorithm array algorithms, jacAlgorithms; BackendDAE.EventInfo eventInfo, jacEventInfo; BackendDAE.ExternalObjectClasses extObjClasses, jacExtObjClasses; - // end DAELOW + // end DAE list allVars, inputVars, paramVars, stateVars, derivedVariables; list solvedEquations, derivedEquations, derivedEquations2; @@ -336,10 +336,10 @@ algorithm jacEventInfo = BackendDAE.EVENT_INFO({},{}); jacExtObjClasses = {}; - jacobian = BackendDAE.DAELOW(jacOrderedVars, jacKnownVars, jacExternalObjects, jacAliasVars, jacOrderedEqs, jacRemovedEqs, jacInitialEqs, jacArrayEqs, jacAlgorithms, jacEventInfo, jacExtObjClasses); + jacobian = BackendDAE.DAE(jacOrderedVars, jacKnownVars, jacExternalObjects, jacAliasVars, jacOrderedEqs, jacRemovedEqs, jacInitialEqs, jacArrayEqs, jacAlgorithms, jacEventInfo, jacExtObjClasses); then jacobian; - case(daeLow as BackendDAE.DAELOW(orderedVars=orderedVars, knownVars=knownVars, externalObjects=externalObjects, aliasVars=aliasVars, orderedEqs=orderedEqs, removedEqs=removedEqs, initialEqs=initialEqs, arrayEqs=arrayEqs, algorithms=algorithms, eventInfo=eventInfo, extObjClasses=extObjClasses), functions, vars, stateVars, inputVars, paramVars) equation + case(daeLow as BackendDAE.DAE(orderedVars=orderedVars, knownVars=knownVars, externalObjects=externalObjects, aliasVars=aliasVars, orderedEqs=orderedEqs, removedEqs=removedEqs, initialEqs=initialEqs, arrayEqs=arrayEqs, algorithms=algorithms, eventInfo=eventInfo, extObjClasses=extObjClasses), functions, vars, stateVars, inputVars, paramVars) equation Debug.fcall("jacdump", print, "\n+++++++++++++++++++++ daeLow-dump: input +++++++++++++++++++++\n"); Debug.fcall("jacdump", BackendDump.dump, daeLow); Debug.fcall("jacdump", print, "##################### daeLow-dump: input #####################\n\n"); @@ -362,7 +362,7 @@ algorithm jacEventInfo = BackendDAE.EVENT_INFO({},{}); jacExtObjClasses = {}; - jacobian = BackendDAE.DAELOW(jacOrderedVars, jacKnownVars, jacExternalObjects, jacAliasVars, jacOrderedEqs, jacRemovedEqs, jacInitialEqs, jacArrayEqs, jacAlgorithms, jacEventInfo, jacExtObjClasses); + jacobian = BackendDAE.DAE(jacOrderedVars, jacKnownVars, jacExternalObjects, jacAliasVars, jacOrderedEqs, jacRemovedEqs, jacInitialEqs, jacArrayEqs, jacAlgorithms, jacEventInfo, jacExtObjClasses); Debug.fcall("jacdump", print, "\n+++++++++++++++++++++ daeLow-dump: jacobian +++++++++++++++++++++\n"); Debug.fcall("jacdump", BackendDump.dump, jacobian); @@ -370,7 +370,7 @@ algorithm then jacobian; case(_, _, _, _, _,_) equation - Error.addMessage(Error.INTERNAL_ERROR, {"DAELow.generateSymbolicJacobian failed"}); + Error.addMessage(Error.INTERNAL_ERROR, {"BackendDAE.generateSymbolicJacobian failed"}); then fail(); end matchcontinue; end generateSymbolicJacobian; diff --git a/Compiler/Main.mo b/Compiler/Main.mo index 27a125ab574..8900c595b2f 100644 --- a/Compiler/Main.mo +++ b/Compiler/Main.mo @@ -766,7 +766,7 @@ algorithm _:= matchcontinue (inCache,inEnv,inProgram1,inProgram2,inDAElist3,inDAElist4,inPath5) local - BackendDAE.DAELow dlow,dlow_1; + BackendDAE.BackendDAE dlow,dlow_1; list[:] m,mT; array v1,v2; list> comps; @@ -804,8 +804,8 @@ algorithm * * * str = Absyn.pathString(classname); - * str = DAELow.unparseStr(dlow, comps, v1, v2, false,str); - * //Debug.fcall("flat", DAELow.unparseStr,dlow, comps, v1, v2, true); + * str = BackendDAE.unparseStr(dlow, comps, v1, v2, false,str); + * //Debug.fcall("flat", BackendDAE.unparseStr,dlow, comps, v1, v2, true); **/ // Debug.fcall("eqnsizedump",BackendDump.dumpComponentSizes,comps); Debug.fcall("bltdump", BackendDump.dumpComponents, comps); @@ -832,16 +832,16 @@ end optimizeDae; protected function modpar "function: modpar The automatic paralellzation module." - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input array inIntegerArray3; input list> inIntegerLstLst4; algorithm _:= - matchcontinue (inDAELow1,inIntegerArray2,inIntegerArray3,inIntegerLstLst4) + matchcontinue (inBackendDAE1,inIntegerArray2,inIntegerArray3,inIntegerLstLst4) local Integer n,nx,ny,np; - BackendDAE.DAELow indexed_dae,indexed_dae_1,dae; + BackendDAE.BackendDAE indexed_dae,indexed_dae_1,dae; Real l,b,t1,t2,time; String timestr,nps; array ass1,ass2; @@ -897,7 +897,7 @@ protected function simcodegen input SCode.Program inProgram2; input Absyn.Program inProgram3; input DAE.DAElist inDAElist4; - input BackendDAE.DAELow inDAELow5; + input BackendDAE.BackendDAE inBackendDAE5; input array inIntegerArray6; input array inIntegerArray7; input BackendDAE.IncidenceMatrix inIncidenceMatrix8; @@ -905,9 +905,9 @@ protected function simcodegen input list> inIntegerLstLst10; algorithm _:= - matchcontinue (inCache,inEnv,inPath1,inProgram2,inProgram3,inDAElist4,inDAELow5,inIntegerArray6,inIntegerArray7,inIncidenceMatrix8,inIncidenceMatrixT9,inIntegerLstLst10) + matchcontinue (inCache,inEnv,inPath1,inProgram2,inProgram3,inDAElist4,inBackendDAE5,inIntegerArray6,inIntegerArray7,inIncidenceMatrix8,inIncidenceMatrixT9,inIntegerLstLst10) local - BackendDAE.DAELow indexed_dlow,indexed_dlow_1,dlow; + BackendDAE.BackendDAE indexed_dlow,indexed_dlow_1,dlow; String cname_str,filename,funcfilename,init_filename,makefilename,file_dir; Absyn.ComponentRef a_cref; list libs; diff --git a/Compiler/PartFn.mo b/Compiler/PartFn.mo index b2504098b0e..c1af5579c9b 100644 --- a/Compiler/PartFn.mo +++ b/Compiler/PartFn.mo @@ -37,7 +37,7 @@ package PartFn RCS: $Id$ This module contains data structures and functions for partially evaulated functions. - entry point: createPartEvalFunctions, partEvalDAELow, partEvalDAE + entry point: createPartEvalFunctions, partEvalBackendDAE, partEvalDAE " public import Absyn; @@ -55,18 +55,18 @@ protected import Util; type Ident = String; -public function partEvalDAELow -"function: partEvalDAELow - handles partially evaluated function in DAELow format" +public function partEvalBackendDAE +"function: partEvalBackendDAE + handles partially evaluated function in BackendDAE format" input list inFunctions; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output list outFunctions; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; algorithm - (outFunctions,outDAELow) := matchcontinue(inFunctions,inDAELow) + (outFunctions,outBackendDAE) := matchcontinue(inFunctions,inBackendDAE) local list dae; - BackendDAE.DAELow dlow; + BackendDAE.BackendDAE dlow; BackendDAE.Variables orderedVars; BackendDAE.Variables knownVars; BackendDAE.Variables externalObjects; @@ -83,7 +83,7 @@ algorithm false = RTOpts.debugFlag("fnptr") or RTOpts.acceptMetaModelicaGrammar(); then (dae,dlow);*/ - case(dae,BackendDAE.DAELOW(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs,removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses)) + case(dae,BackendDAE.DAE(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs,removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses)) equation (orderedVars,dae) = partEvalVars(orderedVars,dae); (knownVars,dae) = partEvalVars(knownVars,dae); @@ -94,18 +94,18 @@ algorithm (arrayEqs,dae) = partEvalArrEqs(arrayList(arrayEqs),dae); (algorithms,dae) = partEvalAlgs(algorithms,dae); then - (dae,BackendDAE.DAELOW(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs,removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses)); + (dae,BackendDAE.DAE(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs,removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses)); case(_,_) equation - Debug.fprintln("failtrace","- PartFn.partEvalDAELow failed"); + Debug.fprintln("failtrace","- PartFn.partEvalBackendDAE failed"); then fail(); end matchcontinue; -end partEvalDAELow; +end partEvalBackendDAE; protected function partEvalAlgs "function: partEvalAlgs - elabs an algorithm section in DAELow" + elabs an algorithm section in BackendDAE" input DAE.Algorithm[:] inAlgorithms; input list inElementList; output DAE.Algorithm[:] outAlgorithms; @@ -227,7 +227,7 @@ end partEvalVars; protected function partEvalVarLst "function: partEvalVarLst - evals partevalfuncs in a DAELow.var option list" + evals partevalfuncs in a BackendDAE.var option list" input list> inVarList; input list inElementList; output list> outVarList; @@ -384,7 +384,7 @@ end partEvalEqs; protected function partEvalWhenEq "function: partEvalWhenEq - elabs calls in a DAELow when equation" + elabs calls in a BackendDAE when equation" input BackendDAE.WhenEquation inWhenEquation; input list inElementList; output BackendDAE.WhenEquation outWhenEquation; diff --git a/Compiler/SimCode.mo b/Compiler/SimCode.mo index da19a4b8d1d..a5ed41213c3 100644 --- a/Compiler/SimCode.mo +++ b/Compiler/SimCode.mo @@ -742,7 +742,7 @@ public function generateModelCodeFMU template-based code generator on it." input SCode.Program program; input DAE.DAElist dae; - input BackendDAE.DAELow indexedDAELow; + input BackendDAE.BackendDAE indexedBackendDAE; input DAE.FunctionTree functionTree; input Absyn.Path className; input String filenamePrefix; @@ -753,7 +753,7 @@ public function generateModelCodeFMU input BackendDAE.IncidenceMatrix incidenceMatrixT; input list> strongComponents; input Option simSettingsOpt; - output BackendDAE.DAELow outIndexedDAELow; + output BackendDAE.BackendDAE outIndexedBackendDAE; output list libs; output Real timeSimCode; output Real timeTemplates; @@ -766,9 +766,9 @@ public function generateModelCodeFMU Real timeSimCode, timeTemplates; algorithm System.realtimeTick(CevalScript.RT_CLOCK_BUILD_MODEL); - (libs, includes, functions, outIndexedDAELow, dae2) := - createFunctions(program, dae, indexedDAELow, functionTree, className); - simCode := createSimCode(functionTree, outIndexedDAELow, equationIndices, + (libs, includes, functions, outIndexedBackendDAE, dae2) := + createFunctions(program, dae, indexedBackendDAE, functionTree, className); + simCode := createSimCode(functionTree, outIndexedBackendDAE, equationIndices, variableIndices, incidenceMatrix, incidenceMatrixT, strongComponents, className, filenamePrefix, fileDir, functions, includes, libs, simSettingsOpt); timeSimCode := System.realtimeTock(CevalScript.RT_CLOCK_BUILD_MODEL); @@ -793,19 +793,19 @@ public function translateModelFMU output Env.Cache outCache; output Values.Value outValue; output Interactive.InteractiveSymbolTable outInteractiveSymbolTable; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; output list outStringLst; output String outFileDir; output list> resultValues; algorithm - (outCache,outValue,outInteractiveSymbolTable,outDAELow,outStringLst,outFileDir,resultValues):= + (outCache,outValue,outInteractiveSymbolTable,outBackendDAE,outStringLst,outFileDir,resultValues):= matchcontinue (inCache,inEnv,className,inInteractiveSymbolTable,inFileNamePrefix,addDummy, inSimSettingsOpt) local String filenameprefix,file_dir; list p_1; DAE.DAElist dae; list env; - BackendDAE.DAELow dlow,dlow_1,indexed_dlow,indexed_dlow_1; + BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow,indexed_dlow_1; array> m,mT; array ass1,ass2; list> comps; @@ -870,7 +870,7 @@ public function generateModelCode template-based code generator on it." input SCode.Program program; input DAE.DAElist dae; - input BackendDAE.DAELow indexedDAELow; + input BackendDAE.BackendDAE indexedBackendDAE; input DAE.FunctionTree functionTree; input Absyn.Path className; input String filenamePrefix; @@ -881,7 +881,7 @@ public function generateModelCode input BackendDAE.IncidenceMatrix incidenceMatrixT; input list> strongComponents; input Option simSettingsOpt; - output BackendDAE.DAELow outIndexedDAELow; + output BackendDAE.BackendDAE outIndexedBackendDAE; output list libs; output Real timeSimCode; output Real timeTemplates; @@ -894,9 +894,9 @@ public function generateModelCode Real timeSimCode, timeTemplates; algorithm System.realtimeTick(CevalScript.RT_CLOCK_BUILD_MODEL); - (libs, includes, functions, outIndexedDAELow, dae2) := - createFunctions(program, dae, indexedDAELow, functionTree, className); - simCode := createSimCode(functionTree, outIndexedDAELow, equationIndices, + (libs, includes, functions, outIndexedBackendDAE, dae2) := + createFunctions(program, dae, indexedBackendDAE, functionTree, className); + simCode := createSimCode(functionTree, outIndexedBackendDAE, equationIndices, variableIndices, incidenceMatrix, incidenceMatrixT, strongComponents, className, filenamePrefix, fileDir, functions, includes, libs, simSettingsOpt); timeSimCode := System.realtimeTock(CevalScript.RT_CLOCK_BUILD_MODEL); @@ -920,19 +920,19 @@ public function translateModel output Env.Cache outCache; output Values.Value outValue; output Interactive.InteractiveSymbolTable outInteractiveSymbolTable; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; output list outStringLst; output String outFileDir; output list> resultValues; algorithm - (outCache,outValue,outInteractiveSymbolTable,outDAELow,outStringLst,outFileDir,resultValues):= + (outCache,outValue,outInteractiveSymbolTable,outBackendDAE,outStringLst,outFileDir,resultValues):= matchcontinue (inCache,inEnv,className,inInteractiveSymbolTable,inFileNamePrefix,addDummy, inSimSettingsOpt) local String filenameprefix,file_dir; list p_1; DAE.DAElist dae; list env; - BackendDAE.DAELow dlow,dlow_1,indexed_dlow,indexed_dlow_1; + BackendDAE.BackendDAE dlow,dlow_1,indexed_dlow,indexed_dlow_1; array> m,mT; array ass1,ass2; list> comps; @@ -1064,22 +1064,22 @@ algorithm end matchcontinue; end isFunctionPtr; -/* Finds the called functions in DAELow and transforms them to a list of +/* Finds the called functions in BackendDAE and transforms them to a list of libraries and a list of Function uniontypes. */ public function createFunctions input SCode.Program inProgram; input DAE.DAElist inDAElist; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input DAE.FunctionTree functionTree; input Absyn.Path inPath; output list libs; output list includes; output list functions; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; output DAE.DAElist outDAE; algorithm - (libs, includes, functions, outDAELow, outDAE) := - matchcontinue (inProgram,inDAElist,inDAELow,functionTree,inPath) + (libs, includes, functions, outBackendDAE, outDAE) := + matchcontinue (inProgram,inDAElist,inBackendDAE,functionTree,inPath) local list funcPaths, funcRefPaths, funcNormalPaths; list debugpathstrs,libs1,libs2,includes1,includes2; @@ -1087,7 +1087,7 @@ algorithm list funcelems,part_func_elems, funcRefElems, funcNormal; list p; DAE.DAElist dae; - BackendDAE.DAELow dlow; + BackendDAE.BackendDAE dlow; Absyn.Path path; list fns; SimCode sc; @@ -1100,7 +1100,7 @@ algorithm part_func_elems = PartFn.createPartEvalFunctions(funcelems); (dae, part_func_elems) = PartFn.partEvalDAE(dae, part_func_elems); - (part_func_elems, dlow) = PartFn.partEvalDAELow(part_func_elems, dlow); + (part_func_elems, dlow) = PartFn.partEvalBackendDAE(part_func_elems, dlow); funcelems = Util.listUnion(part_func_elems, part_func_elems); //funcelems = Util.listUnion(funcelems, part_func_elems); funcelems = Inline.inlineCallsInFunctions(funcelems,(NONE(),{DAE.NORM_INLINE(), DAE.AFTER_INDEX_RED_INLINE()})); @@ -1118,10 +1118,10 @@ algorithm end createFunctions; public function getCalledFunctionReferences -"Goes through the DAELow structure, finds all function references calls, +"Goes through the BackendDAE structure, finds all function references calls, and returns them in a list. Removes duplicates." input DAE.DAElist dae; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output list res; list explist,fcallexps; list calledfuncs; @@ -1135,7 +1135,7 @@ algorithm equation true = RTOpts.acceptMetaModelicaGrammar(); //fcallexps = getMatchingExpsList(explist, matchFnRefs); - fcallexps = BackendDAEUtil.traverseDAELowExps(dlow,true,getMatchingExps,matchFnRefs); + fcallexps = BackendDAEUtil.traverseBackendDAEExps(dlow,true,getMatchingExps,matchFnRefs); calledfuncs = Util.listMap(fcallexps, getCallPath); res = removeDuplicatePaths(calledfuncs); then res; @@ -1144,7 +1144,7 @@ end getCalledFunctionReferences; protected function generateExternalObjectIncludes "Generates the library paths for external objects" - input BackendDAE.DAELow daelow; + input BackendDAE.BackendDAE daelow; output list includes; output list libs; algorithm @@ -1153,7 +1153,7 @@ algorithm local list> libsL,includesL; BackendDAE.ExternalObjectClasses extObjs; - case BackendDAE.DAELOW(extObjClasses = extObjs) + case BackendDAE.DAE(extObjClasses = extObjs) equation (includesL, libsL) = Util.listMap_2(extObjs, generateExternalObjectInclude); includes = Util.listListUnion(includesL); @@ -1547,7 +1547,7 @@ end elaborateStatement; // Copied from SimCodegen.generateSimulationCode. protected function createSimCode input DAE.FunctionTree functionTree; - input BackendDAE.DAELow inDAELow2; + input BackendDAE.BackendDAE inBackendDAE2; input array inIntegerArray3; input array inIntegerArray4; input BackendDAE.IncidenceMatrix inIncidenceMatrix5; @@ -1563,7 +1563,7 @@ protected function createSimCode output SimCode simCode; algorithm simCode := - matchcontinue (functionTree,inDAELow2,inIntegerArray3,inIntegerArray4,inIncidenceMatrix5,inIncidenceMatrixT6,inIntegerLstLst7,inClassName,filenamePrefix,inString11,functions,externalFunctionIncludes,libs,simSettingsOpt) + matchcontinue (functionTree,inBackendDAE2,inIntegerArray3,inIntegerArray4,inIncidenceMatrix5,inIncidenceMatrixT6,inIntegerLstLst7,inClassName,filenamePrefix,inString11,functions,externalFunctionIncludes,libs,simSettingsOpt) local String cname, filename, funcfilename, fileDir; list> blt_states,blt_no_states,comps; @@ -1571,7 +1571,7 @@ algorithm Integer n_h,nres,maxDelayedExpIndex; list helpVarInfo,helpVarInfo1; DAE.DAElist dae; - BackendDAE.DAELow dlow,dlow2; + BackendDAE.BackendDAE dlow,dlow2; array ass1,ass2; array> m,mt; Absyn.Path class_; @@ -1703,16 +1703,16 @@ end createSimCode; protected function createLinearModelMatrixes input DAE.FunctionTree functions; - input BackendDAE.DAELow inDAELow2; + input BackendDAE.BackendDAE inBackendDAE2; input array inIntegerArray3; input array inIntegerArray4; output list JacobianMatrixes; algorithm JacobianMatrixes := - matchcontinue (functions,inDAELow2,inIntegerArray3,inIntegerArray4) + matchcontinue (functions,inBackendDAE2,inIntegerArray3,inIntegerArray4) local DAE.DAElist dae; - BackendDAE.DAELow dlow,deriveddlow1,deriveddlow2; + BackendDAE.BackendDAE dlow,deriveddlow1,deriveddlow2; array ass1,ass2; //BackendDAE.Variables v,kv; @@ -1740,7 +1740,7 @@ algorithm list LinearMats; - case (functions,dlow as BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),ass1,ass2) + case (functions,dlow as BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc),ass1,ass2) equation true = RTOpts.debugFlag("linearization"); Debug.fcall("linmodel",print,"Generate Linear Model Matrices\n"); @@ -1767,9 +1767,9 @@ algorithm comref_outputvars = Util.listMap(outputvars,BackendVariable.varCref); //e_lst = replaceDerOpInEquationList(e_lst); - //e_lst = solveDAELow(e_lst, varlst, arrayList(ass2)); + //e_lst = solveBackendDAE(e_lst, varlst, arrayList(ass2)); //e = BackendDAEUtil.listEquation(e_lst); - //dlow = BackendDAE.DAELOW(v,kv,exv,av,e,re,ie,ae,al,ev,eoc); + //dlow = BackendDAE.DAE(v,kv,exv,av,e,re,ie,ae,al,ev,eoc); // Create SimCode structure for Jacobian or rather for Linearization // Differentiate the System w.r.t states for matrices A and C @@ -1851,14 +1851,14 @@ end collectDelayExpressions; protected function findDelaySubExpressions "Return all subexpressions of inExp that are calls to delay()" input DAE.Exp inExp; - input list inDummy "this is a dummy for traverseDAELowExps"; + input list inDummy "this is a dummy for traverseBackendDAEExps"; output list outExps; algorithm ((_, outExps)) := Expression.traverseExp(inExp, collectDelayExpressions, {}); end findDelaySubExpressions; protected function extractDelayedExpressions - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output list> delayedExps; output Integer maxDelayedExpIndex; algorithm @@ -1867,7 +1867,7 @@ algorithm list exps; case (dlow) equation - exps = BackendDAEUtil.traverseDAELowExps(dlow,true,findDelaySubExpressions,{}); + exps = BackendDAEUtil.traverseBackendDAEExps(dlow,true,findDelaySubExpressions,{}); delayedExps = Util.listMap(exps, extractIdAndExpFromDelayExp); maxDelayedExpIndex = Util.listFold(Util.listMap(delayedExps, Util.tuple21), intMax, -1); then @@ -1920,16 +1920,16 @@ algorithm end createMakefileParams; protected function generateHelpVarInfo - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input list> comps; output list outHelpVarInfo; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; algorithm - (outHelpVarInfo, outDAELow) := + (outHelpVarInfo, outBackendDAE) := matchcontinue (dlow, comps) case (dlow, comps) local - BackendDAE.DAELow dlow2; + BackendDAE.BackendDAE dlow2; list helpVarInfo1; list helpVarInfo; equation @@ -1941,22 +1941,22 @@ end generateHelpVarInfo; protected function helpVarInfoFromWhenConditionChecks "Return a list of help variables that were introduced by when conditions?" - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input list> comps; output list helpVarList; algorithm helpVarList := - matchcontinue (inDAELow, comps) + matchcontinue (inBackendDAE, comps) local list orderOfEquations,orderOfEquations_1; list eqnl; Integer n; list helpVarInfo1,helpVarInfo2,helpVarInfo; - BackendDAE.DAELow dlow; + BackendDAE.BackendDAE dlow; BackendDAE.EquationArray eqns; list whenClauseList; list> blocks; - case ((dlow as BackendDAE.DAELOW(orderedEqs = eqns,eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = whenClauseList))),blocks) + case ((dlow as BackendDAE.DAE(orderedEqs = eqns,eventInfo = BackendDAE.EVENT_INFO(whenClauseLst = whenClauseList))),blocks) equation orderOfEquations = generateEquationOrder(blocks); eqnl = BackendDAEUtil.equationList(eqns); @@ -1983,7 +1983,7 @@ For all discrete variables in the model, generate code that checks if they have that add events to the event queue: if (change()) { AddEvent(c1);...;AddEvent(cn)} " - input BackendDAE.DAELow daelow; + input BackendDAE.BackendDAE daelow; input list> comps; input array ass1; input array ass2; @@ -1997,7 +1997,7 @@ algorithm list> blocks; BackendDAE.Variables v; list vLst; - case (daelow as BackendDAE.DAELOW(orderedVars = v),blocks,ass1,ass2,m,mT) + case (daelow as BackendDAE.DAE(orderedVars = v),blocks,ass1,ass2,m,mT) equation vLst = BackendDAEUtil.varList(v); vLst = Util.listSelect(vLst,BackendDAEUtil.isVarDiscrete); // select all discrete vars. @@ -2011,7 +2011,7 @@ end buildDiscreteVarChanges; protected function buildDiscreteVarChangesVar "help function to buildDiscreteVarChanges" input BackendDAE.Var var; - input BackendDAE.DAELow daelow; + input BackendDAE.BackendDAE daelow; input BackendDAE.IncidenceMatrixT mT; output String outString; algorithm @@ -2033,7 +2033,7 @@ end buildDiscreteVarChangesVar; protected function crefNotInWhenEquation "Returns true if cref is not solved in any of the equations given as indices which is a when_equation" input Expression.ComponentRef cr; - input BackendDAE.DAELow daelow; + input BackendDAE.BackendDAE daelow; input list eqns; output Boolean res; algorithm @@ -2045,7 +2045,7 @@ algorithm DAE.Exp exp; Boolean b1,b2; case(cr,daelow,{}) then true; - case(cr,daelow as BackendDAE.DAELOW(orderedEqs=eqs),e::eqns) + case(cr,daelow as BackendDAE.DAE(orderedEqs=eqs),e::eqns) equation BackendDAE.WHEN_EQUATION(whenEquation = BackendDAE.WHEN_EQ(_,cr2,exp,_)) = BackendDAEUtil.equationNth(eqs,intAbs(e)-1); //We can asume the same component refs are solved in any else-branch. @@ -2286,7 +2286,7 @@ algorithm end elaborateRecordDeclarationsForMetarecords; protected function createExtObjInfo - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output ExtObjInfo extObjInfo; algorithm extObjInfo := @@ -2299,7 +2299,7 @@ algorithm list constructors; list destructors; list aliases; - case (dlow as BackendDAE.DAELOW(externalObjects=evars, extObjClasses=eclasses)) + case (dlow as BackendDAE.DAE(externalObjects=evars, extObjClasses=eclasses)) equation evarLst = BackendDAEUtil.varList(evars); (includes, _) = generateExternalObjectIncludes(dlow); @@ -2386,12 +2386,12 @@ algorithm end createExtObjInfoSingle; protected function createAlgorithmAndEquationAsserts - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output list algorithmAndEquationAsserts; algorithm algorithmAndEquationAsserts := matchcontinue (dlow) - case(BackendDAE.DAELOW(algorithms=algs)) + case(BackendDAE.DAE(algorithms=algs)) local array algs; list res; @@ -2425,7 +2425,7 @@ algorithm end createAlgorithmAndEquationAssertsFromAlgs; protected function createRemovedEquations - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output list removedEquations; algorithm removedEquations := @@ -2433,7 +2433,7 @@ algorithm local BackendDAE.EquationArray r; list removedEquationsTmp; - case (BackendDAE.DAELOW(removedEqs=r)) + case (BackendDAE.DAE(removedEqs=r)) equation removedEquationsTmp = BackendDAEUtil.equationList(r); @@ -2444,7 +2444,7 @@ algorithm end createRemovedEquations; protected function extractDiscreteModelVars - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input BackendDAE.IncidenceMatrixT mT; output list discreteModelVars; algorithm @@ -2454,7 +2454,7 @@ algorithm BackendDAE.Variables v; list vLst; list vLst2; - case (BackendDAE.DAELOW(orderedVars=v), mT) + case (BackendDAE.DAE(orderedVars=v), mT) equation vLst = BackendDAEUtil.varList(v); // select all discrete vars. @@ -2469,7 +2469,7 @@ end extractDiscreteModelVars; protected function varNotSolvedInWhen input BackendDAE.Var var; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input BackendDAE.IncidenceMatrixT mT; output Boolean include; algorithm @@ -2490,7 +2490,7 @@ algorithm end varNotSolvedInWhen; protected function createSimWhenClauses - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input list helpVarInfo; output list simWhenClauses; algorithm @@ -2498,7 +2498,7 @@ algorithm matchcontinue (dlow,helpVarInfo) local list wc; - case (BackendDAE.DAELOW(eventInfo=BackendDAE.EVENT_INFO(whenClauseLst=wc)),helpVarInfo) + case (BackendDAE.DAE(eventInfo=BackendDAE.EVENT_INFO(whenClauseLst=wc)),helpVarInfo) equation simWhenClauses = createSimWhenClausesWithEqs(wc, wc, helpVarInfo, dlow, 0); then @@ -2510,7 +2510,7 @@ protected function createSimWhenClausesWithEqs input list whenClauses; input list allwhenClauses; input list helpVarInfo; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input Integer currentWhenClauseIndex; output list simWhenClauses; algorithm @@ -2527,7 +2527,7 @@ algorithm list simWhenClauses; case ({}, _, _, _, _) then {}; - case (whenClause :: wc, wc1, helpVarInfo, BackendDAE.DAELOW(orderedEqs=eqs), currentWhenClauseIndex) + case (whenClause :: wc, wc1, helpVarInfo, BackendDAE.DAE(orderedEqs=eqs), currentWhenClauseIndex) equation eqsLst = BackendDAEUtil.equationList(eqs); whenEq = findWhenEquation(eqsLst, currentWhenClauseIndex); @@ -2624,7 +2624,7 @@ protected function createEquations input Boolean includeWhen; input Boolean skipDiscInZc; input Boolean genDiscrete; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input array ass1; input array ass2; input list> comps; @@ -2648,7 +2648,7 @@ algorithm /* ignore when equations if we should not generate them */ case (false, skipDiscInZc, genDiscrete, dlow, ass1, ass2, {index} :: restComps, helpVarInfo) equation - BackendDAE.DAELOW(orderedVars=vars, orderedEqs=eqns) = dlow; + BackendDAE.DAE(orderedVars=vars, orderedEqs=eqns) = dlow; (BackendDAE.WHEN_EQUATION(_,_),_) = getEquationAndSolvedVar(index, eqns, vars, ass2); equations = createEquations(false, skipDiscInZc, genDiscrete, dlow, ass1, ass2, restComps, helpVarInfo); then @@ -2656,7 +2656,7 @@ algorithm /* ignore discrete if we should not generate them */ case (includeWhen, skipDiscInZc, false, dlow, ass1, ass2, {index} :: restComps, helpVarInfo) equation - BackendDAE.DAELOW(orderedVars=vars, orderedEqs=eqns) = dlow; + BackendDAE.DAE(orderedVars=vars, orderedEqs=eqns) = dlow; (BackendDAE.EQUATION(_,_,_),v) = getEquationAndSolvedVar(index, eqns, vars, ass2); true = hasDiscreteVar({v}); equations = createEquations(includeWhen, skipDiscInZc, false, dlow, ass1, ass2, restComps, helpVarInfo); @@ -2665,7 +2665,7 @@ algorithm /* ignore discrete in zero crossing if we should not generate them */ case (includeWhen, true, genDiscrete, dlow, ass1, ass2, {index} :: restComps, helpVarInfo) equation - BackendDAE.DAELOW(orderedVars=vars, orderedEqs=eqns) = dlow; + BackendDAE.DAE(orderedVars=vars, orderedEqs=eqns) = dlow; (BackendDAE.EQUATION(_,_,_),v) = getEquationAndSolvedVar(index, eqns, vars, ass2); true = hasDiscreteVar({v}); zcEqns = BackendDAECreate.zeroCrossingsEquations(dlow); @@ -2713,7 +2713,7 @@ protected function createEquationsLin input Boolean skipDiscInZc; input Boolean genDiscrete; input DAE.FunctionTree functions; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input array ass1; input array ass2; input list> comps; @@ -2771,7 +2771,7 @@ end createEquationsLin; protected function createEquation input Integer eqNum; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input array ass1; input array ass2; input list helpVarInfo; @@ -2821,7 +2821,7 @@ algorithm BackendDAE.WhenEquation whenEquation; /* when eq */ case (eqNum, - BackendDAE.DAELOW(orderedVars=vars, orderedEqs=eqns, eventInfo=BackendDAE.EVENT_INFO(whenClauseLst=wcl)), + BackendDAE.DAE(orderedVars=vars, orderedEqs=eqns, eventInfo=BackendDAE.EVENT_INFO(whenClauseLst=wcl)), ass1, ass2, helpVarInfo) equation (BackendDAE.WHEN_EQUATION(whenEquation,_),_) = getEquationAndSolvedVar(eqNum, eqns, vars, ass2); @@ -2832,7 +2832,7 @@ algorithm SES_WHEN(left, right, conditionsWithHindex); /* single equation: non-state */ case (eqNum, - BackendDAE.DAELOW(orderedVars=vars, orderedEqs=eqns), + BackendDAE.DAE(orderedVars=vars, orderedEqs=eqns), ass1, ass2, helpVarInfo) equation (BackendDAE.EQUATION(e1, e2,_), v as BackendDAE.VAR(varName = cr, varKind = kind)) @@ -2844,7 +2844,7 @@ algorithm SES_SIMPLE_ASSIGN(cr, exp_); /* single equation: state */ case (eqNum, - BackendDAE.DAELOW(orderedVars=vars, orderedEqs=eqns), + BackendDAE.DAE(orderedVars=vars, orderedEqs=eqns), ass1, ass2, helpVarInfo) equation (BackendDAE.EQUATION(e1, e2,_), v as BackendDAE.VAR(varName = cr, varKind = BackendDAE.STATE())) @@ -2855,7 +2855,7 @@ algorithm SES_SIMPLE_ASSIGN(cr, exp_); /* non-state non-linear */ case (e, - BackendDAE.DAELOW(orderedVars=vars,orderedEqs=eqns,arrayEqs=ae), + BackendDAE.DAE(orderedVars=vars,orderedEqs=eqns,arrayEqs=ae), ass1, ass2, helpVarInfo) equation ((eqn as BackendDAE.EQUATION(e1,e2,_)),v as BackendDAE.VAR(varName = cr, varKind = kind)) = @@ -2870,7 +2870,7 @@ algorithm SES_NONLINEAR(index, resEqs, {cr}); /* state nonlinear */ case (e, - BackendDAE.DAELOW(orderedVars=vars,orderedEqs=eqns,arrayEqs=ae), + BackendDAE.DAE(orderedVars=vars,orderedEqs=eqns,arrayEqs=ae), ass1, ass2, helpVarInfo) equation ((eqn as BackendDAE.EQUATION(e1,e2,_)),BackendDAE.VAR(varName = cr, varKind = BackendDAE.STATE())) = @@ -2885,7 +2885,7 @@ algorithm SES_NONLINEAR(index, resEqs, {cr_1}); /* Algorithm for single variable. */ - case (e, BackendDAE.DAELOW(orderedVars=vars,orderedEqs=eqns,algorithms=alg), ass1, ass2, helpVarInfo) + case (e, BackendDAE.DAE(orderedVars=vars,orderedEqs=eqns,algorithms=alg), ass1, ass2, helpVarInfo) local Integer indx; list algInputs,algOutputs; @@ -2904,7 +2904,7 @@ algorithm SES_ALGORITHM(algStatements); /* inverse Algorithm for single variable . */ - case (e, BackendDAE.DAELOW(orderedVars = vars, orderedEqs = eqns,algorithms=alg),ass1,ass2, helpVarInfo) + case (e, BackendDAE.DAE(orderedVars = vars, orderedEqs = eqns,algorithms=alg),ass1,ass2, helpVarInfo) local Integer indx; list algInputs,algOutputs; @@ -2926,7 +2926,7 @@ end createEquation; protected function createEquationLin input Integer eqNum; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input array ass1; input array ass2; input list helpVarInfo; @@ -2974,7 +2974,7 @@ algorithm /* single equation: non-state */ case (eqNum, - BackendDAE.DAELOW(orderedVars=vars, orderedEqs=eqns), + BackendDAE.DAE(orderedVars=vars, orderedEqs=eqns), ass1, ass2, helpVarInfo) equation (BackendDAE.EQUATION(e1, e2,_), v as BackendDAE.VAR(varName = cr, varKind = kind)) @@ -2986,7 +2986,7 @@ algorithm /* // non-state non-linear case (e, - BackendDAE.DAELOW(orderedVars=vars,orderedEqs=eqns,arrayEqs=ae), + BackendDAE.DAE(orderedVars=vars,orderedEqs=eqns,arrayEqs=ae), ass1, ass2, helpVarInfo) equation ((eqn as BackendDAE.EQUATION(e1,e2,_)),v as BackendDAE.VAR(varName = cr, varKind = kind)) = @@ -3001,7 +3001,7 @@ algorithm SES_NONLINEAR(index, resEqs, {cr}); */ /* Algorithm for single variable. */ - case (e, BackendDAE.DAELOW(orderedVars=vars,orderedEqs=eqns,algorithms=alg), ass1, ass2, helpVarInfo) + case (e, BackendDAE.DAE(orderedVars=vars,orderedEqs=eqns,algorithms=alg), ass1, ass2, helpVarInfo) local Integer indx; list algInputs,algOutputs; @@ -3020,7 +3020,7 @@ algorithm SES_ALGORITHM(algStatements); /* inverse Algorithm for single variable . */ - case (e, BackendDAE.DAELOW(orderedVars = vars, orderedEqs = eqns,algorithms=alg),ass1,ass2, helpVarInfo) + case (e, BackendDAE.DAE(orderedVars = vars, orderedEqs = eqns,algorithms=alg),ass1,ass2, helpVarInfo) local Integer indx; list algInputs,algOutputs; @@ -3200,7 +3200,7 @@ end applyResidualReplacementsEqn; protected function createOdeSystem input Boolean genDiscrete "if true generate discrete equations"; - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input array inIntegerArray3; input list inIntegerLst4; @@ -3208,7 +3208,7 @@ protected function createOdeSystem output list equations_; algorithm equations_ := - matchcontinue (genDiscrete,inDAELow1,inIntegerArray2,inIntegerArray3,inIntegerLst4,helpVarInfo) + matchcontinue (genDiscrete,inBackendDAE1,inIntegerArray2,inIntegerArray3,inIntegerLst4,helpVarInfo) local String rettp,fn; list eqn_lst,cont_eqn,disc_eqn; @@ -3216,7 +3216,7 @@ algorithm BackendDAE.Variables vars_1,vars,knvars,exvars; BackendDAE.AliasVariables av; BackendDAE.EquationArray eqns_1,eqns,se,ie; - BackendDAE.DAELow cont_subsystem_dae,daelow,subsystem_dae,dlow; + BackendDAE.BackendDAE cont_subsystem_dae,daelow,subsystem_dae,dlow; array> m,m_1,mt_1; Option>> jac; BackendDAE.JacobianType jac_tp; @@ -3239,7 +3239,7 @@ algorithm String dstr,dstr1,dstr2; list dlstr; /* mixed system of equations, continuous part only */ - case (false,(daelow as BackendDAE.DAELOW(vars,knvars,exvars,av,eqns,se,ie,ae,al, ev,eoc)),ass1,ass2,block_,helpVarInfo) + case (false,(daelow as BackendDAE.DAE(vars,knvars,exvars,av,eqns,se,ie,ae,al, ev,eoc)),ass1,ass2,block_,helpVarInfo) equation (eqn_lst,var_lst) = Util.listMap32(block_, getEquationAndSolvedVar, eqns, vars, ass2); eqn_lst = replaceDerOpInEquationList(eqn_lst); @@ -3254,7 +3254,7 @@ algorithm // is twisted, simple reverse one list eqn_lst = listReverse(eqn_lst); eqns_1 = BackendDAEUtil.listEquation(cont_eqn); - cont_subsystem_dae = BackendDAE.DAELOW(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc); + cont_subsystem_dae = BackendDAE.DAE(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc); m = BackendDAEUtil.incidenceMatrix(cont_subsystem_dae); m_1 = BackendDAEUtil.absIncidenceMatrix(m); mt_1 = BackendDAEUtil.transposeMatrix(m_1); @@ -3265,7 +3265,7 @@ algorithm then equations_; /* mixed system of equations, both continous and discrete eqns*/ - case (true,(dlow as BackendDAE.DAELOW(vars,knvars,exvars,av,eqns,se,ie,ae,al, ev,eoc)),ass1,ass2,block_,helpVarInfo) + case (true,(dlow as BackendDAE.DAE(vars,knvars,exvars,av,eqns,se,ie,ae,al, ev,eoc)),ass1,ass2,block_,helpVarInfo) equation (eqn_lst,var_lst) = Util.listMap32(block_, getEquationAndSolvedVar, eqns, vars, ass2); eqn_lst = replaceDerOpInEquationList(eqn_lst); @@ -3280,7 +3280,7 @@ algorithm // is twisted, simple reverse one list eqn_lst = listReverse(eqn_lst); eqns_1 = BackendDAEUtil.listEquation(cont_eqn); - cont_subsystem_dae = BackendDAE.DAELOW(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc); + cont_subsystem_dae = BackendDAE.DAE(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc); m = BackendDAEUtil.incidenceMatrix(cont_subsystem_dae); m_1 = BackendDAEUtil.absIncidenceMatrix(m); mt_1 = BackendDAEUtil.transposeMatrix(m_1); @@ -3295,9 +3295,9 @@ algorithm then {SES_MIXED(equation_, simVarsDisc, discEqs, values, value_dims)}; /* continuous system of equations try tearing algorithm*/ - case (genDiscrete,(daelow as BackendDAE.DAELOW(vars,knvars,exvars,av,eqns,se,ie,ae,al,ev,eoc)),ass1,ass2,block_,helpVarInfo) + case (genDiscrete,(daelow as BackendDAE.DAE(vars,knvars,exvars,av,eqns,se,ie,ae,al,ev,eoc)),ass1,ass2,block_,helpVarInfo) local - BackendDAE.DAELow subsystem_dae_1,subsystem_dae_2; + BackendDAE.BackendDAE subsystem_dae_1,subsystem_dae_2; array v1,v2,v1_1,v2_1; BackendDAE.IncidenceMatrix m_2,m_3; BackendDAE.IncidenceMatrixT mT_2,mT_3; @@ -3318,7 +3318,7 @@ algorithm // is twisted, simple reverse one list eqn_lst = listReverse(eqn_lst); eqns_1 = BackendDAEUtil.listEquation(eqn_lst); - subsystem_dae = BackendDAE.DAELOW(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc) "not used" ; + subsystem_dae = BackendDAE.DAE(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc) "not used" ; m = BackendDAEUtil.incidenceMatrix(subsystem_dae); m_1 = BackendDAEUtil.absIncidenceMatrix(m); mt_1 = BackendDAEUtil.transposeMatrix(m_1); @@ -3336,7 +3336,7 @@ algorithm then {equation_}; /* continuous system of equations */ - case (genDiscrete,(daelow as BackendDAE.DAELOW(vars,knvars,exvars,av,eqns,se,ie,ae,al,ev,eoc)),ass1,ass2,block_,helpVarInfo) + case (genDiscrete,(daelow as BackendDAE.DAE(vars,knvars,exvars,av,eqns,se,ie,ae,al,ev,eoc)),ass1,ass2,block_,helpVarInfo) equation // extract the variables and equations of the block. (eqn_lst,var_lst) = Util.listMap32(block_, getEquationAndSolvedVar, eqns, vars, ass2); @@ -3350,7 +3350,7 @@ algorithm // is twisted, simple reverse one list eqn_lst = listReverse(eqn_lst); eqns_1 = BackendDAEUtil.listEquation(eqn_lst); - subsystem_dae = BackendDAE.DAELOW(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc); + subsystem_dae = BackendDAE.DAE(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc); m = BackendDAEUtil.incidenceMatrix(subsystem_dae); m_1 = BackendDAEUtil.absIncidenceMatrix(m); mt_1 = BackendDAEUtil.transposeMatrix(m_1); @@ -3371,7 +3371,7 @@ end createOdeSystem; protected function createOdeSystemLin input Boolean genDiscrete "if true generate discrete equations"; - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input array inIntegerArray3; input list inIntegerLst4; @@ -3379,7 +3379,7 @@ protected function createOdeSystemLin output list equations_; algorithm equations_ := - matchcontinue (genDiscrete,inDAELow1,inIntegerArray2,inIntegerArray3,inIntegerLst4,helpVarInfo) + matchcontinue (genDiscrete,inBackendDAE1,inIntegerArray2,inIntegerArray3,inIntegerLst4,helpVarInfo) local String rettp,fn; list eqn_lst,cont_eqn,disc_eqn; @@ -3387,7 +3387,7 @@ algorithm BackendDAE.Variables vars_1,vars,knvars,exvars; BackendDAE.AliasVariables av; BackendDAE.EquationArray eqns_1,eqns,se,ie; - BackendDAE.DAELow cont_subsystem_dae,daelow,subsystem_dae,dlow; + BackendDAE.BackendDAE cont_subsystem_dae,daelow,subsystem_dae,dlow; array> m,m_1,mt_1; Option>> jac; BackendDAE.JacobianType jac_tp; @@ -3410,7 +3410,7 @@ algorithm String dstr,dstr1,dstr2; list dlstr; /* continuous system of equations */ - case (genDiscrete,(daelow as BackendDAE.DAELOW(vars,knvars,exvars,av,eqns,se,ie,ae,al,ev,eoc)),ass1,ass2,block_,helpVarInfo) + case (genDiscrete,(daelow as BackendDAE.DAE(vars,knvars,exvars,av,eqns,se,ie,ae,al,ev,eoc)),ass1,ass2,block_,helpVarInfo) equation // extract the variables and equations of the block. (eqn_lst,var_lst) = Util.listMap32(block_, getEquationAndSolvedVar, eqns, vars, ass2); @@ -3424,7 +3424,7 @@ algorithm // is twisted, simple reverse one list eqn_lst = listReverse(eqn_lst); eqns_1 = BackendDAEUtil.listEquation(eqn_lst); - subsystem_dae = BackendDAE.DAELOW(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc); + subsystem_dae = BackendDAE.DAE(vars_1,knvars,exvars,av,eqns_1,se,ie,ae1,al,ev,eoc); m = BackendDAEUtil.incidenceMatrix(subsystem_dae); m_1 = BackendDAEUtil.absIncidenceMatrix(m); mt_1 = BackendDAEUtil.transposeMatrix(m_1); @@ -3456,19 +3456,19 @@ protected function generateTearingSystem "function: generateTearingSystem input list inIntegerLst6; input Boolean mixedEvent "true if generating the mixed system event code"; input Boolean genDiscrete; - input BackendDAE.DAELow inDAELow; - input Option>> inTplIntegerIntegerDAELowEquationLstOption; + input BackendDAE.BackendDAE inBackendDAE; + input Option>> inTplIntegerIntegerBackendDAEEquationLstOption; input BackendDAE.JacobianType inJacobianType; input list helpVarInfo; output SimEqSystem equation_; algorithm equation_:= - matchcontinue (inIntegerArray2,inIntegerArray3,inIntegerLst4,inIntegerLst5,inIntegerLst6,mixedEvent,genDiscrete,inDAELow,inTplIntegerIntegerDAELowEquationLstOption,inJacobianType,helpVarInfo) + matchcontinue (inIntegerArray2,inIntegerArray3,inIntegerLst4,inIntegerLst5,inIntegerLst6,mixedEvent,genDiscrete,inBackendDAE,inTplIntegerIntegerBackendDAEEquationLstOption,inJacobianType,helpVarInfo) local array ass1,ass2; list block_,block_1,r,t; Integer index; - BackendDAE.DAELow daelow,daelow1; + BackendDAE.BackendDAE daelow,daelow1; Option>> jac; BackendDAE.JacobianType jac_tp; BackendDAE.Variables v,kv,exv; @@ -3486,7 +3486,7 @@ algorithm BackendDAE.ExternalObjectClasses extObjClasses; list simeqnsystem,simeqnsystem1,resEqs; case (ass1,ass2,block_,r,t,mixedEvent,_, - daelow as BackendDAE.DAELOW(orderedVars=v,knownVars=kv,externalObjects=exv,aliasVars=av,orderedEqs=eqn,removedEqs=reeqn,initialEqs=ineq,arrayEqs=ae,algorithms=algorithms,eventInfo=eventInfo,extObjClasses=extObjClasses),jac,jac_tp,helpVarInfo) + daelow as BackendDAE.DAE(orderedVars=v,knownVars=kv,externalObjects=exv,aliasVars=av,orderedEqs=eqn,removedEqs=reeqn,initialEqs=ineq,arrayEqs=ae,algorithms=algorithms,eventInfo=eventInfo,extObjClasses=extObjClasses),jac,jac_tp,helpVarInfo) /* no analythic jacobian available. Generate non-linear system */ equation // get equations and variables @@ -3507,7 +3507,7 @@ algorithm // replace tearing variables in other equations with x_loc[..] eqn_lst2 = generateTearingSystem1(eqn_lst,repl); eqn1 = BackendDAEUtil.listEquation(eqn_lst2); - daelow1=BackendDAE.DAELOW(v,kv,exv,av,eqn1,reeqn,ineq,ae,algorithms,eventInfo,extObjClasses); + daelow1=BackendDAE.DAE(v,kv,exv,av,eqn1,reeqn,ineq,ae,algorithms,eventInfo,extObjClasses); // generade code for other equations simeqnsystem = Util.listMap4(block_1,createEquation,daelow1, ass1, ass2, helpVarInfo); (resEqs,_) = createNonlinearResidualEquations(reqns, ae, {}); @@ -3527,11 +3527,11 @@ protected function generateTearingSystem1 "function: generateTearingSystem1 author: Frenkel TUD Helper function to generateTearingSystem1" - input list inDAELowEquationLst; + input list inBackendDAEEquationLst; input VarTransform.VariableReplacements inVariableReplacements; - output list outDAELowEquationLst; + output list outBackendDAEEquationLst; algorithm - outDAELowEquationLst := matchcontinue (inDAELowEquationLst,inVariableReplacements) + outBackendDAEEquationLst := matchcontinue (inBackendDAEEquationLst,inVariableReplacements) local DAE.Exp e1,e2,e1_1,e2_1; list rest,rest2; @@ -3584,15 +3584,15 @@ algorithm end extractDiscEqs; protected function extractValuesAndDims - input list inDAELowEquationLst1; - input list inDAELowVarLst2; - input list inDAELowEquationLst3; - input list inDAELowVarLst4; + input list inBackendDAEEquationLst1; + input list inBackendDAEVarLst2; + input list inBackendDAEEquationLst3; + input list inBackendDAEVarLst4; output list valuesRet; output list value_dims; algorithm (valuesRet, value_dims) := - matchcontinue (inDAELowEquationLst1,inDAELowVarLst2,inDAELowEquationLst3,inDAELowVarLst4) + matchcontinue (inBackendDAEEquationLst1,inBackendDAEVarLst2,inBackendDAEEquationLst3,inBackendDAEVarLst4) local list rels; list> values,values_1; @@ -3617,8 +3617,8 @@ end extractValuesAndDims; protected function createOdeSystem2 input Boolean mixedEvent "true if generating the mixed system event code"; input Boolean genDiscrete; - input BackendDAE.DAELow inDAELow; - input Option>> inTplIntegerIntegerDAELowEquationLstOption; + input BackendDAE.BackendDAE inBackendDAE; + input Option>> inTplIntegerIntegerBackendDAEEquationLstOption; input BackendDAE.JacobianType inJacobianType; input list block_; input list helpVarInfo; @@ -3626,10 +3626,10 @@ protected function createOdeSystem2 algorithm equations_ := matchcontinue - (mixedEvent,genDiscrete,inDAELow,inTplIntegerIntegerDAELowEquationLstOption,inJacobianType,block_,helpVarInfo) + (mixedEvent,genDiscrete,inBackendDAE,inTplIntegerIntegerBackendDAEEquationLstOption,inJacobianType,block_,helpVarInfo) local Integer cg_id_1,cg_id,eqn_size,unique_id,cg_id1,cg_id2,cg_id3,cg_id4,cg_id5; - BackendDAE.DAELow dae,d; + BackendDAE.BackendDAE dae,d; Option>> jac; BackendDAE.JacobianType jac_tp; BackendDAE.Variables v,kv; @@ -3662,7 +3662,7 @@ algorithm /* constant jacobians. Linear system of equations (A x = b) where A and b are constants. TODO: implement symbolic gaussian elimination here. Currently uses dgesv as for next case */ - case (mixedEvent,genDiscrete,(d as BackendDAE.DAELOW(orderedVars = v,knownVars = kv,orderedEqs = eqn)),SOME(jac),BackendDAE.JAC_CONSTANT(),block_,helpVarInfo) + case (mixedEvent,genDiscrete,(d as BackendDAE.DAE(orderedVars = v,knownVars = kv,orderedEqs = eqn)),SOME(jac),BackendDAE.JAC_CONSTANT(),block_,helpVarInfo) local list> jac; equation @@ -3676,10 +3676,10 @@ algorithm /* constant jacobians. Linear system of equations (A x = b) where A and b are constants. TODO: implement symbolic gaussian elimination here. Currently uses dgesv as for next case */ - case (mixedEvent,genDiscrete,(d as BackendDAE.DAELOW(orderedVars = v,knownVars = kv,orderedEqs = eqn)),SOME(jac),BackendDAE.JAC_TIME_VARYING(),block_,helpVarInfo) + case (mixedEvent,genDiscrete,(d as BackendDAE.DAE(orderedVars = v,knownVars = kv,orderedEqs = eqn)),SOME(jac),BackendDAE.JAC_TIME_VARYING(),block_,helpVarInfo) local list> jac; - BackendDAE.DAELow subsystem_dae_1,subsystem_dae_2; + BackendDAE.BackendDAE subsystem_dae_1,subsystem_dae_2; array v1,v2,v1_1,v2_1; BackendDAE.IncidenceMatrix m,m_1,m_2,m_3; BackendDAE.IncidenceMatrixT mt_1,mT_2,mT_3; @@ -3707,7 +3707,7 @@ algorithm /* Time varying jacobian. Linear system of equations that needs to be solved during runtime. */ - case (mixedEvent,_,(d as BackendDAE.DAELOW(orderedVars = v,knownVars = kv,orderedEqs = eqn, arrayEqs = arrayEqs)),SOME(jac),BackendDAE.JAC_TIME_VARYING(),block_,helpVarInfo) + case (mixedEvent,_,(d as BackendDAE.DAE(orderedVars = v,knownVars = kv,orderedEqs = eqn, arrayEqs = arrayEqs)),SOME(jac),BackendDAE.JAC_TIME_VARYING(),block_,helpVarInfo) local list dlowVars; list simVars; @@ -3725,7 +3725,7 @@ algorithm then {SES_LINEAR(mixedEvent, simVars, beqs, simJac)}; /* Time varying nonlinear jacobian. Non-linear system of equations. */ - case (mixedEvent,_,BackendDAE.DAELOW(orderedVars = v,knownVars = kv,orderedEqs = eqn,arrayEqs=ae),SOME(jac),BackendDAE.JAC_NONLINEAR(),block_,helpVarInfo) + case (mixedEvent,_,BackendDAE.DAE(orderedVars = v,knownVars = kv,orderedEqs = eqn,arrayEqs=ae),SOME(jac),BackendDAE.JAC_NONLINEAR(),block_,helpVarInfo) local list> jac; Integer index; @@ -3738,7 +3738,7 @@ algorithm then {SES_NONLINEAR(index, resEqs, crefs)}; /* No analythic jacobian available. Generate non-linear system. */ - case (mixedEvent,_,BackendDAE.DAELOW(orderedVars = v,knownVars = kv,orderedEqs = eqn,arrayEqs=ae),NONE(),BackendDAE.JAC_NO_ANALYTIC(),block_,helpVarInfo) + case (mixedEvent,_,BackendDAE.DAE(orderedVars = v,knownVars = kv,orderedEqs = eqn,arrayEqs=ae),NONE(),BackendDAE.JAC_NO_ANALYTIC(),block_,helpVarInfo) local list> jac; Integer index; @@ -3875,17 +3875,17 @@ protected function generateRelaxationSystem "function: generateRelaxationSystem input list inIntegerLst4; input list inIntegerLst5; input list inIntegerLst6; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input list helpVarInfo; output list outEqns; algorithm outEqns:= - matchcontinue (mixedEvent,inM,inMT,inIntegerArray2,inIntegerArray3,inIntegerLst4,inIntegerLst5,inIntegerLst6,inDAELow,helpVarInfo) + matchcontinue (mixedEvent,inM,inMT,inIntegerArray2,inIntegerArray3,inIntegerLst4,inIntegerLst5,inIntegerLst6,inBackendDAE,helpVarInfo) local array ass1,ass2,ass1_1,ass2_1; list block_,block_1,block_2,r,t; Integer size; - BackendDAE.DAELow daelow,daelow1; + BackendDAE.BackendDAE daelow,daelow1; BackendDAE.Variables v,v1,kv,exv; BackendDAE.AliasVariables av; BackendDAE.EquationArray eqn,eqn1,reeqn,ineq; @@ -3902,7 +3902,7 @@ algorithm list eqns,reqns,alleqns; VarTransform.VariableReplacements repl,repl_1; case (mixedEvent,m,mT,ass1,ass2,block_,r,t, - daelow as BackendDAE.DAELOW(orderedVars=v,knownVars=kv,externalObjects=exv,aliasVars=av,orderedEqs=eqn,removedEqs=reeqn,initialEqs=ineq,arrayEqs=ae,algorithms=algorithms,eventInfo=eventInfo,extObjClasses=extObjClasses),helpVarInfo) + daelow as BackendDAE.DAE(orderedVars=v,knownVars=kv,externalObjects=exv,aliasVars=av,orderedEqs=eqn,removedEqs=reeqn,initialEqs=ineq,arrayEqs=ae,algorithms=algorithms,eventInfo=eventInfo,extObjClasses=extObjClasses),helpVarInfo) equation // get equations and variables eqn_lst = BackendDAEUtil.equationList(eqn); @@ -3922,7 +3922,7 @@ algorithm block_2 = Util.listIntRange(size); ass1_1 = listArray(block_2); ass2_1 = listArray(block_2); - daelow1=BackendDAE.DAELOW(v1,kv,exv,av,eqn1,reeqn,ineq,ae,algorithms,eventInfo,extObjClasses); + daelow1=BackendDAE.DAE(v1,kv,exv,av,eqn1,reeqn,ineq,ae,algorithms,eventInfo,extObjClasses); // generate code for relaxation equations reqns = generateRelaxedResidualEqns(block_2,mixedEvent,daelow1, ass1_1, ass2_1, helpVarInfo); alleqns = listAppend(reqns,eqns); @@ -4044,7 +4044,7 @@ Author: Frenkel TUD 2010-09 function generateRelaxedResidualEqns generates the equations for the residual eqns" input list inBlock; input Boolean mixedEvent "true if generating the mixed system event code"; - input BackendDAE.DAELow daelow; + input BackendDAE.BackendDAE daelow; input array Ass1; input array Ass2; input list helpVarInfo; @@ -4071,7 +4071,7 @@ algorithm reqn = createEquation(r,daelow, Ass1, Ass2, helpVarInfo); then {reqn}; - case (block_ as _::_::_,mixedEvent,daelow as BackendDAE.DAELOW(orderedVars=v,orderedEqs=eqn,arrayEqs=ae), Ass1, Ass2, helpVarInfo) + case (block_ as _::_::_,mixedEvent,daelow as BackendDAE.DAE(orderedVars=v,orderedEqs=eqn,arrayEqs=ae), Ass1, Ass2, helpVarInfo) equation dlowVars = BackendDAEUtil.varList(v); dlowEqs = BackendDAEUtil.equationList(eqn); @@ -4212,8 +4212,8 @@ end listMap3passthrough; protected function createSingleArrayEqnCode input Boolean mixedEvent "true if generating the mixed system event code"; input Boolean genDiscrete; - input BackendDAE.DAELow inDAELow; - input Option>> inTplIntegerIntegerDAELowEquationLstOption; + input BackendDAE.BackendDAE inBackendDAE; + input Option>> inTplIntegerIntegerBackendDAEEquationLstOption; input BackendDAE.JacobianType inJacobianType; input list block_; input list helpVarInfo; @@ -4221,7 +4221,7 @@ protected function createSingleArrayEqnCode algorithm equations_ := matchcontinue - (mixedEvent,genDiscrete,inDAELow,inTplIntegerIntegerDAELowEquationLstOption,inJacobianType,block_,helpVarInfo) + (mixedEvent,genDiscrete,inBackendDAE,inTplIntegerIntegerBackendDAEEquationLstOption,inJacobianType,block_,helpVarInfo) local Integer indx,cg_id_1,cg_id; list ds; @@ -4241,11 +4241,11 @@ algorithm DAE.ElementSource source "the origin of the element"; BackendDAE.AliasVariables av; BackendDAE.ExternalObjectClasses eoc; - BackendDAE.DAELow subsystem_dae; + BackendDAE.BackendDAE subsystem_dae; SimEqSystem equation_; case (mixedEvent,genDiscrete, - BackendDAE.DAELOW(orderedVars = vars, + BackendDAE.DAE(orderedVars = vars, knownVars = knvars, externalObjects = exvars, aliasVars = av, @@ -4268,7 +4268,7 @@ algorithm then {equation_}; case (mixedEvent,genDiscrete, - BackendDAE.DAELOW(orderedVars = vars, + BackendDAE.DAE(orderedVars = vars, knownVars = knvars, externalObjects = exvars, aliasVars = av, @@ -4288,7 +4288,7 @@ algorithm ealst = Util.listThreadTuple(ea1,ea2); re = Util.listMap1(ealst,BackendEquation.generateEQUATION,source); eqns_1 = BackendDAEUtil.listEquation(re); - subsystem_dae = BackendDAE.DAELOW(vars,knvars,exvars,av,eqns_1,se,ie,ae,al,ev,eoc); + subsystem_dae = BackendDAE.DAE(vars,knvars,exvars,av,eqns_1,se,ie,ae,al,ev,eoc); m = BackendDAEUtil.incidenceMatrix(subsystem_dae); m_1 = BackendDAEUtil.absIncidenceMatrix(m); mt_1 = BackendDAEUtil.transposeMatrix(m_1); @@ -4307,11 +4307,11 @@ algorithm end createSingleArrayEqnCode; protected function createSingleAlgorithmCode - input BackendDAE.DAELow inDAELow; - input Option>> inTplIntegerIntegerDAELowEquationLstOption; + input BackendDAE.BackendDAE inBackendDAE; + input Option>> inTplIntegerIntegerBackendDAEEquationLstOption; output SimEqSystem equation_; algorithm - equation_ := matchcontinue (inDAELow,inTplIntegerIntegerDAELowEquationLstOption) + equation_ := matchcontinue (inBackendDAE,inTplIntegerIntegerBackendDAEEquationLstOption) local Integer indx,cg_id_1,cg_id; list ds; @@ -4330,7 +4330,7 @@ algorithm list algStatements; DAE.ElementSource source "the origin of the element"; - case (BackendDAE.DAELOW(orderedVars = vars,knownVars = knvars,orderedEqs = eqns,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = al,eventInfo = ev),jac) + case (BackendDAE.DAE(orderedVars = vars,knownVars = knvars,orderedEqs = eqns,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = al,eventInfo = ev),jac) equation (BackendDAE.ALGORITHM(indx,_,algOutExpVars,_) :: _) = BackendDAEUtil.equationList(eqns); alg = al[indx + 1]; @@ -4342,7 +4342,7 @@ algorithm equation_ = SES_ALGORITHM(algStatements); then equation_; /* Error message, inverse algorithms not supported yet */ - case (BackendDAE.DAELOW(orderedVars = vars,knownVars = knvars,orderedEqs = eqns,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = al,eventInfo = ev),jac) + case (BackendDAE.DAE(orderedVars = vars,knownVars = knvars,orderedEqs = eqns,removedEqs = se,initialEqs = ie,arrayEqs = ae,algorithms = al,eventInfo = ev),jac) equation (BackendDAE.ALGORITHM(indx,_,algOutExpVars,source) :: _) = BackendDAEUtil.equationList(eqns); alg = al[indx + 1]; @@ -4432,7 +4432,7 @@ algorithm end createSingleArrayEqnCode2; protected function createResidualEquations - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input array ass1; input array ass2; output list residualEquations; @@ -4449,7 +4449,7 @@ algorithm array al; BackendDAE.EventInfo ev; list>> divexplst; - case ((dlow as BackendDAE.DAELOW(orderedVars=vars, + case ((dlow as BackendDAE.DAE(orderedVars=vars, knownVars=knvars, orderedEqs=eqns, removedEqs=se, @@ -4517,7 +4517,7 @@ algorithm end failUnlessResidual; protected function createInitialEquations - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output list initialEquations; algorithm initialEquations := matchcontinue (dlow) @@ -4529,7 +4529,7 @@ algorithm list eqns_lst; BackendDAE.Variables vars; BackendDAE.Variables knvars; - case (BackendDAE.DAELOW(orderedVars=vars, knownVars=knvars)) + case (BackendDAE.DAE(orderedVars=vars, knownVars=knvars)) equation initialEquationsTmp2 = {}; // vars @@ -4555,7 +4555,7 @@ algorithm end createInitialEquations; protected function createParameterEquations - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output list parameterEquations; algorithm parameterEquations := matchcontinue (dlow) @@ -4567,7 +4567,7 @@ algorithm list eqns_lst; BackendDAE.Variables vars; BackendDAE.Variables knvars; - case (BackendDAE.DAELOW(orderedVars=vars, knownVars=knvars)) + case (BackendDAE.DAE(orderedVars=vars, knownVars=knvars)) equation parameterEquationsTmp = {}; // kvars params @@ -4656,11 +4656,11 @@ algorithm end createInitialParamAssignments; protected function createZeroCrossings - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output list zc; algorithm zc := matchcontinue (dlow) - case (BackendDAE.DAELOW(eventInfo=BackendDAE.EVENT_INFO(zeroCrossingLst=zc))) + case (BackendDAE.DAE(eventInfo=BackendDAE.EVENT_INFO(zeroCrossingLst=zc))) then zc; case (_) @@ -4673,7 +4673,7 @@ end createZeroCrossings; protected function createZeroCrossingsNeedSave input list zeroCrossings; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input array ass1; input array ass2; input list> blocks; @@ -4701,7 +4701,7 @@ algorithm end createZeroCrossingsNeedSave; protected function createZeroCrossingNeedSave - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input array ass1; input array ass2; input list eqns2; @@ -4721,7 +4721,7 @@ algorithm BackendDAE.Variables vars, vars_1,knvars,exvars; BackendDAE.AliasVariables av; BackendDAE.EquationArray eqns_1,eqns,se,ie; - BackendDAE.DAELow cont_subsystem_dae,dlow; + BackendDAE.BackendDAE cont_subsystem_dae,dlow; array> m,m_1,mt_1; Option>> jac; BackendDAE.JacobianType jac_tp; @@ -4738,7 +4738,7 @@ algorithm case (_,_,_,{},_) then {}; /* zero crossing for mixed system */ - case ((dlow as BackendDAE.DAELOW(vars, knvars, exvars, av, eqns, se, ie, ae, + case ((dlow as BackendDAE.DAE(vars, knvars, exvars, av, eqns, se, ie, ae, al, ev, eoc)), ass1, ass2, (eqn :: rest), blocks) equation @@ -4752,7 +4752,7 @@ algorithm then (simvar :: crs); /* zero crossing for single equation */ - case ((dlow as BackendDAE.DAELOW(orderedVars = vars)), ass1, ass2, + case ((dlow as BackendDAE.DAE(orderedVars = vars)), ass1, ass2, (eqn :: rest), blocks) local BackendDAE.Variables vars; @@ -4769,7 +4769,7 @@ end createZeroCrossingNeedSave; protected function createModelInfo input Absyn.Path class_; - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input Integer numHelpVars; input Integer numResiduals; input String fileDir; @@ -4807,7 +4807,7 @@ algorithm end createModelInfo; protected function createVarInfo - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input Integer numOutVars; input Integer numInVars; input Integer numHelpVars; @@ -4837,7 +4837,7 @@ algorithm end createVarInfo; protected function createVars - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; output SimVars varsOut; algorithm varsOut := @@ -4852,7 +4852,7 @@ algorithm SimVars varsTmp; BackendDAE.EquationArray ie; list ie_lst; - case (BackendDAE.DAELOW(orderedVars = vars, + case (BackendDAE.DAE(orderedVars = vars, knownVars = knvars, externalObjects = extvars, initialEqs=ie)) @@ -5396,12 +5396,12 @@ end unparseCommentOptionNoAnnotationNoQuote; protected function generateHelpVarsForWhenStatements input list inHelpVarInfo; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; output list outHelpVarInfo; - output BackendDAE.DAELow outDAELow; + output BackendDAE.BackendDAE outBackendDAE; algorithm - (outHelpVarInfo,outDAELow) := - matchcontinue (inHelpVarInfo,inDAELow) + (outHelpVarInfo,outBackendDAE) := + matchcontinue (inHelpVarInfo,inBackendDAE) local list helpvars, helpvars1; BackendDAE.Variables orderedVars; @@ -5416,12 +5416,12 @@ algorithm list algLst; BackendDAE.EventInfo eventInfo; BackendDAE.ExternalObjectClasses extObjClasses; - case (helpvars,BackendDAE.DAELOW(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs, + case (helpvars,BackendDAE.DAE(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs, removedEqs,initialEqs,arrayEqs,algorithms,eventInfo,extObjClasses)) equation (helpvars1,algLst,_) = generateHelpVarsInAlgorithms(listLength(helpvars),arrayList(algorithms)); algorithms2 = listArray(algLst); - then (listAppend(helpvars,helpvars1),BackendDAE.DAELOW(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs, + then (listAppend(helpvars,helpvars1),BackendDAE.DAE(orderedVars,knownVars,externalObjects,aliasVars,orderedEqs, removedEqs,initialEqs,arrayEqs,algorithms2,eventInfo,extObjClasses)); case (_,_) equation @@ -5590,7 +5590,7 @@ protected function selectContinuousEquations input list eqnLst; input Integer eqnIndx; // iterator, starts at 1..n input array ass2; - input BackendDAE.DAELow daelow; + input BackendDAE.BackendDAE daelow; output list outEqnLst; algorithm outEqnLst := matchcontinue(eqnLst,eqnIndx,ass2,daelow) @@ -5601,7 +5601,7 @@ algorithm Boolean b; BackendDAE.Equation e; case({},eqnIndx,ass2,daelow) then {}; - case(e::eqnLst,eqnIndx,ass2,daelow as BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(varArr = vararr))) + case(e::eqnLst,eqnIndx,ass2,daelow as BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(varArr = vararr))) equation v = ass2[eqnIndx]; v_1 = v - 1; @@ -5620,11 +5620,11 @@ protected function generateInitialEquationsFromStart "function: generateInitialE fixed set to true is converted by this function. Fixed set to false means an initial guess, and is not considered here. " - input list inDAELowVarLst; - output list outDAELowEquationLst; + input list inBackendDAEVarLst; + output list outBackendDAEEquationLst; algorithm - outDAELowEquationLst:= - matchcontinue (inDAELowVarLst) + outBackendDAEEquationLst:= + matchcontinue (inBackendDAEVarLst) local list eqns; BackendDAE.Var v; @@ -5710,14 +5710,14 @@ end buildWhenConditionChecks3; protected function buildWhenConditionChecks2 " This function outputs checks for all when clauses that do not have equations but reinit statements. " - input list inDAELowWhenClauseLst1 "List of when clauses"; - input Integer whenClauseIndex "index of the first when clause in inDAELowWhenClauseLst1"; + input list inBackendDAEWhenClauseLst1 "List of when clauses"; + input Integer whenClauseIndex "index of the first when clause in inBackendDAEWhenClauseLst1"; input Integer nextHelpVarIndex; output String outString; output list helpVarLst; algorithm (outString,helpVarLst):= - matchcontinue (inDAELowWhenClauseLst1,whenClauseIndex,nextHelpVarIndex) + matchcontinue (inBackendDAEWhenClauseLst1,whenClauseIndex,nextHelpVarIndex) local Integer i_1,i,nextHelpIndex,numberOfNewHelpVars,nextHelpIndex_1; String res,res2,res1; @@ -5770,14 +5770,14 @@ protected function buildWhenConditionChecks4 of all the when clauses that does not contain equations (only reinit). " input list orderOfEquations "The sorting order of the equations."; - input list inDAELowEquationLst "List of equations."; - input list inDAELowWhenClauseLst "List of when clauses."; + input list inBackendDAEEquationLst "List of equations."; + input list inBackendDAEWhenClauseLst "List of when clauses."; input Integer nextHelpVarIndex "index of the next generated help variable."; output String outString "Generated event checking code"; output list helpVarLst "List of help variables introduced in this function."; algorithm (outString,helpVarLst):= - matchcontinue (orderOfEquations,inDAELowEquationLst,inDAELowWhenClauseLst,nextHelpVarIndex) + matchcontinue (orderOfEquations,inBackendDAEEquationLst,inBackendDAEWhenClauseLst,nextHelpVarIndex) local Integer eqn,nextHelpIndex; String res2,res1,res; @@ -5818,14 +5818,14 @@ protected function buildWhenConditionCheckForEquation " Generates eventchecking code given a when equation. " input Option whenEq "The equation to check for"; - input list inDAELowWhenClauseLst "List of when clauses."; + input list inBackendDAEWhenClauseLst "List of when clauses."; input Boolean isElseWhen "Whether the equation is inside an elsewhen or not."; input Integer nextHelpIndex "Next avalable help variable index."; output String outString "Generated event checking code"; output list helpVarLst "List of help variables introduced in this function."; algorithm (outString, helpVarLst) := - matchcontinue (whenEq,inDAELowWhenClauseLst,isElseWhen, nextHelpIndex) + matchcontinue (whenEq,inBackendDAEWhenClauseLst,isElseWhen, nextHelpIndex) local Boolean isElseWhen; Integer nextHelpInd, ind; @@ -5913,7 +5913,7 @@ protected function buildDiscreteVarChangesVar2 ZeroCrossing(i) generate 'if change(v) needToIterate=1;)'" input Integer eqn; input Expression.ComponentRef cr; - input BackendDAE.DAELow daelow; + input BackendDAE.BackendDAE daelow; output String outString; algorithm outString := matchcontinue(eqn,cr,daelow) @@ -5924,7 +5924,7 @@ algorithm list strLst; list zcIndxLst; - case(eqn,cr,daelow as BackendDAE.DAELOW(eventInfo=BackendDAE.EVENT_INFO(zeroCrossingLst = zcLst))) + case(eqn,cr,daelow as BackendDAE.DAE(eventInfo=BackendDAE.EVENT_INFO(zeroCrossingLst = zcLst))) equation zcIndxLst = zeroCrossingsContainIndex(eqn,0,zcLst); strLst = Util.listMap1(zcIndxLst,buildDiscreteVarChangesAddEvent,cr); @@ -5988,11 +5988,11 @@ protected function mixedCollectRelations2 "function: mixedCollectRelations2 Helper function to mixed_collect_functions. " - input list inDAELowEquationLst; + input list inBackendDAEEquationLst; output list outExpExpLst; algorithm outExpExpLst:= - matchcontinue (inDAELowEquationLst) + matchcontinue (inBackendDAEEquationLst) local list l1,l2,l3,res; DAE.Exp e1,e2; @@ -6097,13 +6097,13 @@ protected function generateMixedDiscretePossibleValues2 "function: generateMixed Helper function to generate_mixed_discrete_possible_values. " input list inExpExpLst; - input list inDAELowVarLst; + input list inBackendDAEVarLst; input Integer inInteger; output list> outStringLstLst; output list outIntegerLst; algorithm (outStringLstLst,outIntegerLst):= - matchcontinue (inExpExpLst,inDAELowVarLst,inInteger) + matchcontinue (inExpExpLst,inBackendDAEVarLst,inInteger) local Integer cg_id; list> values; @@ -6198,12 +6198,12 @@ protected function isMixedSystem "function: isMixedSystem Returns true if the list of variables is an equation system contains both discrete and continuous variables. " - input list inDAELowVarLst; + input list inBackendDAEVarLst; input list inEqns; output Boolean outBoolean; algorithm outBoolean:= - matchcontinue (inDAELowVarLst,inEqns) + matchcontinue (inBackendDAEVarLst,inEqns) local list vs; list eqns; /* A single algorithm section (consists of several eqns) is not mixed system */ @@ -6340,15 +6340,15 @@ protected function singleAlgorithmSection "function: singleAlgorithmSection author: PA Checks if a dae (subsystem) consists of a single algorithm section." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; algorithm _:= - matchcontinue (inDAELow) + matchcontinue (inBackendDAE) local list eqn_lst; BackendDAE.Variables vars; BackendDAE.EquationArray eqnarr; - case (BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqnarr)) + case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqnarr)) equation eqn_lst = BackendDAEUtil.equationList(eqnarr); singleAlgorithmSection2(eqn_lst,NONE()); @@ -6358,11 +6358,11 @@ algorithm end singleAlgorithmSection; protected function singleAlgorithmSection2 - input list inDAELowEquationLst; + input list inBackendDAEEquationLst; input Option Index; algorithm _:= - matchcontinue (inDAELowEquationLst,Index) + matchcontinue (inBackendDAEEquationLst,Index) local list res; Integer i,i1; @@ -6385,15 +6385,15 @@ protected function singleArrayEquation "function: singleArrayEquation author: PA Checks if a dae (subsystem) consists of a single array equation." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; algorithm _:= - matchcontinue (inDAELow) + matchcontinue (inBackendDAE) local list eqn_lst; BackendDAE.Variables vars; BackendDAE.EquationArray eqnarr; - case (BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqnarr)) + case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqnarr)) equation eqn_lst = BackendDAEUtil.equationList(eqnarr); singleArrayEquation2(eqn_lst,NONE()); @@ -6403,11 +6403,11 @@ algorithm end singleArrayEquation; protected function singleArrayEquation2 - input list inDAELowEquationLst; + input list inBackendDAEEquationLst; input Option Index; algorithm _:= - matchcontinue (inDAELowEquationLst,Index) + matchcontinue (inBackendDAEEquationLst,Index) local list res; Integer i,i1; @@ -6576,26 +6576,26 @@ protected function isPartOfMixedSystem "function: isPartOfMixedSystem Helper function to generateZeroCrossing2, returns true if any equation in the equation list of a zero-crossing is part of a mixed system." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input Integer inInteger; input list> inIntegerLstLst; input array inIntegerArray; output Boolean outBoolean; algorithm outBoolean:= - matchcontinue (inDAELow,inInteger,inIntegerLstLst,inIntegerArray) + matchcontinue (inBackendDAE,inInteger,inIntegerLstLst,inIntegerArray) local list block_; list eqn_lst; list var_lst; Boolean res; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.Variables vars; BackendDAE.EquationArray eqns; Integer e; list> blocks; array ass2; - case ((dae as BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns)),e,blocks,ass2) /* equation blocks ass2 */ + case ((dae as BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns)),e,blocks,ass2) /* equation blocks ass2 */ equation block_ = BackendDAEUtil.getEquationBlock(e, blocks); (eqn_lst,var_lst) = Util.listMap32(block_, getEquationAndSolvedVar, eqns, vars, ass2); @@ -6611,25 +6611,25 @@ protected function getZcMixedSystem Helper function to generateZeroCrossing2, returns true if any equation in the equation list of a zero-crossing is part of a mixed system." - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input Integer inInteger; input list> inIntegerLstLst; input array inIntegerArray; output list outIntegerLst; algorithm outIntegerLst:= - matchcontinue (inDAELow,inInteger,inIntegerLstLst,inIntegerArray) + matchcontinue (inBackendDAE,inInteger,inIntegerLstLst,inIntegerArray) local list block_; list eqn_lst; list var_lst; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.Variables vars; BackendDAE.EquationArray eqns; Integer e; list> blocks; array ass2; - case ((dae as BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns)),e,blocks,ass2) /* equation blocks ass2 */ + case ((dae as BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns)),e,blocks,ass2) /* equation blocks ass2 */ equation block_ = BackendDAEUtil.getEquationBlock(e, blocks); (eqn_lst,var_lst) = Util.listMap32(block_, getEquationAndSolvedVar, eqns, vars, ass2); @@ -6644,7 +6644,7 @@ protected function splitOutputBlocks parts, one for continous output variables and one for discrete output values. This must be done to ensure that discrete variables are calculated before and after a discrete event." - input BackendDAE.DAELow dlow; + input BackendDAE.BackendDAE dlow; input array ass1; input array ass2; input BackendDAE.IncidenceMatrix m; @@ -6657,7 +6657,7 @@ algorithm local BackendDAE.Variables vars,vars2,knvars; list varLst, varLstDiscrete; BackendDAE.EquationArray eqns; - case (dlow as BackendDAE.DAELOW(orderedVars=vars,knownVars = knvars,orderedEqs=eqns),ass1,ass2,m,mT,blocks) equation + case (dlow as BackendDAE.DAE(orderedVars=vars,knownVars = knvars,orderedEqs=eqns),ass1,ass2,m,mT,blocks) equation varLst = BackendDAEUtil.varList(vars); varLstDiscrete = Util.listSelect(varLst,BackendDAEUtil.isVarDiscrete); vars2 = BackendDAEUtil.listVar(varLstDiscrete); @@ -7021,11 +7021,11 @@ end useZerocrossing; protected function hasDiscreteVar "Returns true if var list contains a discrete time variable." - input list inDAELowVarLst; + input list inBackendDAEVarLst; output Boolean outBoolean; algorithm outBoolean := - matchcontinue (inDAELowVarLst) + matchcontinue (inBackendDAEVarLst) local Boolean res; BackendDAE.Var v; @@ -7044,11 +7044,11 @@ end hasDiscreteVar; protected function hasContinousVar "Returns true if var list contains a continous time variable." - input list inDAELowVarLst; + input list inBackendDAEVarLst; output Boolean outBoolean; algorithm outBoolean := - matchcontinue (inDAELowVarLst) + matchcontinue (inBackendDAEVarLst) local Boolean res; BackendDAE.Var v; @@ -7679,7 +7679,7 @@ algorithm case(inExp,inDlowMode as (vars,varlst,dzer)) local DAE.Exp exp; - BackendDAE.DAELow dlow; + BackendDAE.BackendDAE dlow; BackendDAE.DivZeroExpReplace dzer; list divlst; BackendDAE.Variables vars; diff --git a/Compiler/TaskGraph.mo b/Compiler/TaskGraph.mo index f4a01ac6558..94b20ecf25a 100644 --- a/Compiler/TaskGraph.mo +++ b/Compiler/TaskGraph.mo @@ -39,7 +39,7 @@ package TaskGraph This module is used in the modpar part of OpenModelica for bulding task graphs from the BLT decomposition for automatic parallelization. The exported function buildTaskgraph takes the lowered form of the DAE defined in - DAELow and two assignments vectors (which variable is solved in which equation) and + BackendDAE and two assignments vectors (which variable is solved in which equation) and the list of blocks given by the BLT decomposition. The package uses TaskGraphExt for the task graph datastructure itself, which @@ -65,22 +65,22 @@ protected import VarTransform; protected import System; public function buildTaskgraph "" - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input array inIntegerArray3; input list> inIntegerLstLst4; algorithm - _ := matchcontinue (inDAELow1,inIntegerArray2,inIntegerArray3,inIntegerLstLst4) + _ := matchcontinue (inBackendDAE1,inIntegerArray2,inIntegerArray3,inIntegerLstLst4) local Integer starttask,endtask; list vars,knvars; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; BackendDAE.VariableArray vararr,knvararr; array ass1,ass2; list> blocks; DAE.ComponentRef cref_; - case ((dae as BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(varArr = vararr),knownVars = BackendDAE.VARIABLES(varArr = knvararr))),ass1,ass2,blocks) + case ((dae as BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(varArr = vararr),knownVars = BackendDAE.VARIABLES(varArr = knvararr))),ass1,ass2,blocks) equation print("starting buildtaskgraph\n"); starttask = TaskGraphExt.newTask("start"); @@ -115,13 +115,13 @@ protected function buildInits "function: buildInits This function traverses the DAE and calls external functions to build the initialization values for the DAE This is implemented in C++ as a set of vectors" - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; algorithm - _ := matchcontinue (inDAELow) + _ := matchcontinue (inBackendDAE) local list vars,kvars; BackendDAE.VariableArray vararr,kvararr; - case (BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(varArr = vararr),knownVars = BackendDAE.VARIABLES(varArr = kvararr))) + case (BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(varArr = vararr),knownVars = BackendDAE.VARIABLES(varArr = kvararr))) equation vars = BackendDAEUtil.vararrayList(vararr); kvars = BackendDAEUtil.vararrayList(kvararr); @@ -133,9 +133,9 @@ algorithm end buildInits; protected function buildInits2 - input list inDAELowVarLst; + input list inBackendDAEVarLst; algorithm - _ := matchcontinue (inDAELowVarLst) + _ := matchcontinue (inBackendDAEVarLst) local String v,origname_str; DAE.Exp value; @@ -247,11 +247,11 @@ algorithm end buildInits2; protected function addVariables - input list inDAELowVarLst; + input list inBackendDAEVarLst; input Integer inInteger; algorithm _:= - matchcontinue (inDAELowVarLst,inInteger) + matchcontinue (inBackendDAEVarLst,inInteger) local Integer start; BackendDAE.Var v; @@ -267,15 +267,15 @@ algorithm end addVariables; protected function buildBlocks - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input array inIntegerArray3; input list> inIntegerLstLst4; algorithm _:= - matchcontinue (inDAELow1,inIntegerArray2,inIntegerArray3,inIntegerLstLst4) + matchcontinue (inBackendDAE1,inIntegerArray2,inIntegerArray3,inIntegerLstLst4) local - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array ass1,ass2; list block_; list> blocks; @@ -302,13 +302,13 @@ algorithm end buildBlocks; protected function buildEquation "Build task graph for a single equation." - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input array inIntegerArray3; input Integer inInteger4; algorithm _:= - matchcontinue (inDAELow1,inIntegerArray2,inIntegerArray3,inInteger4) + matchcontinue (inBackendDAE1,inIntegerArray2,inIntegerArray3,inInteger4) local Integer e_1,v_1,e,indx; DAE.Exp e1,e2,varexp,expr; @@ -324,7 +324,7 @@ algorithm BackendDAE.Variables vars; BackendDAE.EquationArray eqns; array ass1,ass2; - case (BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns),ass1,ass2,e) + case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns),ass1,ass2,e) equation e_1 = e - 1 "Solving for non-states" ; BackendDAE.EQUATION(e1,e2,_) = BackendDAEUtil.equationNth(eqns, e_1); @@ -344,7 +344,7 @@ algorithm Expression.print_exp_str expr => s2 & print s2 & print \"\\n\" &" ; then (); - case (BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns),ass1,ass2,e) + case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns),ass1,ass2,e) local Integer v; equation e_1 = e - 1 "Solving the state s means solving for der(s)" ; @@ -371,16 +371,16 @@ algorithm Expression.print_exp_str expr => s2 & print s2 & print \"\\n\" &" ; then (); - case (BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns),ass1,ass2,e) /* rule int_sub(e,1) => e\' & - DAELow.equation_nth(eqns,e\') => BackendDAE.EQUATION(e1,e2,_) & + case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns),ass1,ass2,e) /* rule int_sub(e,1) => e\' & + BackendDAE.equation_nth(eqns,e\') => BackendDAE.EQUATION(e1,e2,_) & vector_nth(ass2,e\') => v & ( v==variable no solved in this equation )) int_sub(v,1) => v\' & - DAELow.vararray_nth(vararr,v\') => BackendDAE.VAR(cr,_,_,_,_,_,_,_,_,origname,_,dae_var_attr,comment,flow) & + BackendDAE.vararray_nth(vararr,v\') => BackendDAE.VAR(cr,_,_,_,_,_,_,_,_,origname,_,dae_var_attr,comment,flow) & let varexp = DAE.CREF(cr,DAE.ET_REAL) & not ExpressionSolve.solve(e1,e2,varexp) => _ & print \"nonlinear equation not implemented yet\\n\" -------------------------------- - build_equation(BackendDAE.DAELOW(BackendDAE.VARIABLES(_,_,vararr,_,_),_,eqns,_,_,_,_,_),ass1,ass2,e) => fail + build_equation(BackendDAE.DAE(BackendDAE.VARIABLES(_,_,vararr,_,_),_,eqns,_,_,_,_,_),ass1,ass2,e) => fail */ local Integer v; equation @@ -402,7 +402,7 @@ algorithm buildNonlinearEquations({varexp}, {DAE.BINARY(e1,DAE.SUB(DAE.ET_REAL()),e2)}); then (); - case (BackendDAE.DAELOW(orderedVars = vars,orderedEqs = eqns),ass1,ass2,e) + case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns),ass1,ass2,e) equation e_1 = e - 1 "Solving nonlinear for non-states" ; BackendDAE.EQUATION(e1,e2,_) = BackendDAEUtil.equationNth(eqns, e_1); @@ -669,18 +669,18 @@ algorithm end addEdgesFromVars; protected function buildSystem "Build task graph for a system of equations" - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input array inIntegerArray3; input list inIntegerLst4; algorithm _:= - matchcontinue (inDAELow1,inIntegerArray2,inIntegerArray3,inIntegerLst4) + matchcontinue (inBackendDAE1,inIntegerArray2,inIntegerArray3,inIntegerLst4) local Integer tid; list predtasks; list predtaskids,system; - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array ass1,ass2; case (dae,ass1,ass2,system) equation @@ -700,7 +700,7 @@ algorithm end buildSystem; protected function buildSystem2 - input BackendDAE.DAELow inDAELow1; + input BackendDAE.BackendDAE inBackendDAE1; input array inIntegerArray2; input array inIntegerArray3; input list inIntegerLst4; @@ -708,9 +708,9 @@ protected function buildSystem2 output list outStringLst; algorithm outStringLst:= - matchcontinue (inDAELow1,inIntegerArray2,inIntegerArray3,inIntegerLst4,inInteger5) + matchcontinue (inBackendDAE1,inIntegerArray2,inIntegerArray3,inIntegerLst4,inInteger5) local - BackendDAE.DAELow dae; + BackendDAE.BackendDAE dae; array ass1,ass2; Integer tid,e_1,v_1,e; DAE.Exp e1,e2; @@ -727,7 +727,7 @@ algorithm BackendDAE.EquationArray eqns; list rest; case (dae,ass1,ass2,{},tid) then {}; - case ((dae as BackendDAE.DAELOW(orderedVars = BackendDAE.VARIABLES(varArr = vararr),orderedEqs = eqns)),ass1,ass2,(e :: rest),tid) + case ((dae as BackendDAE.DAE(orderedVars = BackendDAE.VARIABLES(varArr = vararr),orderedEqs = eqns)),ass1,ass2,(e :: rest),tid) equation e_1 = e - 1; BackendDAE.EQUATION(e1,e2,_) = BackendDAEUtil.equationNth(eqns, e_1); diff --git a/Compiler/XMLDump.mo b/Compiler/XMLDump.mo index 257e734b935..ed9620dbb3f 100644 --- a/Compiler/XMLDump.mo +++ b/Compiler/XMLDump.mo @@ -260,7 +260,7 @@ protected import System; protected constant String HASH_TB_CREFS_LIST = "hashTb"; protected constant String HASH_TB_STRING_LIST_OLDVARS = "hashTbOldVars"; - //All this constants below are used in the dumpDAELow method. + //All this constants below are used in the dumpBackendDAE method. protected constant String EQUATIONS = "equations"; protected constant String EQUATIONS_ = "Equations"; protected constant String SIMPLE = "simple"; @@ -965,9 +965,9 @@ algorithm end dumpDAEInstDims2; -public function dumpDAELow " +public function dumpBackendDAE " - This function dumps the DAELow representaton to stdout as XML format. + This function dumps the BackendDAE representaton to stdout as XML format. The output is like: @@ -1003,18 +1003,18 @@ public function dumpDAELow " -The XML output could change depending on the content of the DAELow structure, in +The XML output could change depending on the content of the BackendDAE structure, in particular all the elements are optional, it means that if no element is present the relative tag is not printed. " - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; input list functions; input DAE.Exp addOriginalIncidenceMatrix; input DAE.Exp addSolvingInfo; input DAE.Exp addMathMLCode; input DAE.Exp dumpResiduals; algorithm - _ := matchcontinue (inDAELow,functions,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals) + _ := matchcontinue (inBackendDAE,functions,addOriginalIncidenceMatrix,addSolvingInfo,addMathMLCode,dumpResiduals) local list vars,knvars,extvars; @@ -1063,7 +1063,7 @@ algorithm DAE.Exp addOrInMatrix,addSolInfo,addMML,dumpRes; - case (BackendDAE.DAELOW(vars_orderedVars as BackendDAE.VARIABLES(crefIdxLstArr=crefIdxLstArr_orderedVars,strIdxLstArr=strIdxLstArr_orderedVars,varArr=varArr_orderedVars,bucketSize=bucketSize_orderedVars,numberOfVars=numberOfVars_orderedVars), + case (BackendDAE.DAE(vars_orderedVars as BackendDAE.VARIABLES(crefIdxLstArr=crefIdxLstArr_orderedVars,strIdxLstArr=strIdxLstArr_orderedVars,varArr=varArr_orderedVars,bucketSize=bucketSize_orderedVars,numberOfVars=numberOfVars_orderedVars), vars_knownVars as BackendDAE.VARIABLES(crefIdxLstArr=crefIdxLstArr_knownVars,strIdxLstArr=strIdxLstArr_knownVars,varArr=varArr_knownVars,bucketSize=bucketSize_knownVars,numberOfVars=numberOfVars_knownVars), vars_externalObject as BackendDAE.VARIABLES(crefIdxLstArr=crefIdxLstArr_externalObject,strIdxLstArr=strIdxLstArr_externalObject,varArr=varArr_externalObject,bucketSize=bucketSize_externalObject,numberOfVars=numberOfVars_externalObject), _,eqns,reqns,ieqns,ae,algs,BackendDAE.EVENT_INFO(zeroCrossingLst = zc),extObjCls),inFunctions,addOrInMatrix,addSolInfo,addMML,dumpRes) @@ -1097,11 +1097,11 @@ algorithm dumpArrayEqns(ae_lst,ARRAY_OF_EQUATIONS,addMML,dumpRes); dumpAlgorithms(arrayList(algs)); dumpFunctions(inFunctions); - dumpSolvingInfo(addOrInMatrix,addSolInfo,inDAELow); + dumpSolvingInfo(addOrInMatrix,addSolInfo,inBackendDAE); dumpStrCloseTag(DAE_CLOSE); then (); end matchcontinue; -end dumpDAELow; +end dumpBackendDAE; public function dumpDAEVariableAttributes " @@ -1309,7 +1309,7 @@ end dumpEqns2; public function dumpEquation " This function is necessary to print an equation element. Since in Modelica is possible to have different kind of -equations, the DAELow representation of the OMC distinguish +equations, the BackendDAE representation of the OMC distinguish between: - normal equations - array equations @@ -2094,7 +2094,7 @@ end dumpFunctionNames2; function dumpFunctionsStr " This function returns the code of all the functions -that are used in the DAELow model. +that are used in the BackendDAE model. The functions are printed as Modelica code. " input list inL; @@ -2678,11 +2678,11 @@ public function dumpSolvingInfo " " input DAE.Exp addOriginalIncidenceMatrix; input DAE.Exp addSolvingInfo; - input BackendDAE.DAELow inDAELow; + input BackendDAE.BackendDAE inBackendDAE; algorithm _:= - matchcontinue (addOriginalIncidenceMatrix,addSolvingInfo,inDAELow) - local BackendDAE.DAELow dlow; + matchcontinue (addOriginalIncidenceMatrix,addSolvingInfo,inBackendDAE) + local BackendDAE.BackendDAE dlow; case (DAE.BCONST(bool=false),DAE.BCONST(bool=false),_) equation then (); @@ -2768,7 +2768,7 @@ end dumpStrCloseTag; public function dumpStrFunctions " This function is used to print all the information of the functions -are used in the DAELow model. +are used in the BackendDAE model. The functions are printed using the inFunctions string containing the body of the functions. " @@ -3564,7 +3564,7 @@ end relopSymbol; public function dumpResidual " This function is necessary to print an equation element as a residual. Since in Modelica is possible to have different kind of -equations, the DAELow representation of the OMC distinguish +equations, the BackendDAE representation of the OMC distinguish between: - normal equations - array equations