Changeset b3fb8f57 in OpenModelica


Ignore:
Timestamp:
2012-11-19T17:06:05+01:00 (11 years ago)
Author:
Jens Frenkel <jens.frenkel@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
a998770c
Parents:
e0f41a7
Message:
  • add in case of constant variables every time a parameter bound equation to the simulation code and in case of parameters only if it is not constant

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13968 f25d12d1-65f4-0310-ae8a-bbce733d8d8e

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Compiler/BackEnd/SimCodeUtil.mo

    r0bb1572 rb3fb8f57  
    68246824      DAE.ElementSource source;
    68256825      list<Integer> v1,v2;
    6826       Integer pos,epos;
     6826      Integer pos;
    68276827      list<BackendDAE.Var> v,kn;
     6828      Boolean b1,b2;
    68286829     
    68296830    case ((var as BackendDAE.VAR(varName=cr, bindExp=SOME(e), source = source),(eqns,v,kn,v1,v2,pos)))
    68306831      equation
    6831         false = Expression.isConst(e);
     6832        b1 = BackendVariable.isParam(var);
     6833        b2 = Expression.isConstValue(e);
     6834        // if not parameter use it, else use it only if not constant
     6835        true = (not b1) or (b1 and not b2);
    68326836        cre = Expression.crefExp(cr);
    68336837        initialEquation = BackendDAE.EQUATION(cre, e, source);
    6834         epos = listLength(v1)+1;
    68356838        var1 = BackendVariable.setVarKind(var,BackendDAE.VARIABLE());
    68366839      then
    6837         ((var,(initialEquation :: eqns,var1::v,kn,epos::v1,pos::v2,pos+1)));
    6838        
     6840        ((var,(initialEquation :: eqns,var1::v,kn,pos::v1,pos::v2,pos+1)));       
    68396841    case ((var,(eqns,v,kn,v1,v2,pos)))
    68406842      equation
Note: See TracChangeset for help on using the changeset viewer.