Changeset 084a836 in OpenModelica for Compiler/FrontEnd/InstUtil.mo
- Timestamp:
- 2016-02-10T15:49:38+01:00 (8 years ago)
- 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:
- c1ec6d8f
- Parents:
- a384029e
- git-author:
- Jan Šilar <jan.silar@…> (11/09/15 12:26:02)
- git-committer:
- hudson <openmodelica@…> (02/10/16 15:49:38)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Compiler/FrontEnd/InstUtil.mo
ra384029e r084a836 8944 8944 (N,fieldLst) = getDomNFields(inDomFieldLst,domainCr,info); 8945 8945 then list(newEQFun(i, lhs_exp, rhs_exp, domainCr, comment, info, fieldLst) for i in 2:N-1); 8946 //same as previous but with ".interior" 8946 8947 case SCode.EQUATION(SCode.EQ_EQUALS(expLeft = lhs_exp, expRight = rhs_exp, 8947 8948 domainOpt = SOME(domainCr as Absyn.CREF_QUAL(name, subscripts, Absyn.CREF_IDENT(name="interior"))), … … 8951 8952 (N,fieldLst) = getDomNFields(inDomFieldLst,domainCr1,info); 8952 8953 then list(newEQFun(i, lhs_exp, rhs_exp, domainCr1, comment, info, fieldLst) for i in 2:N-1); 8954 //left boundary condition 8955 case SCode.EQUATION(SCode.EQ_EQUALS(expLeft = lhs_exp, expRight = rhs_exp, 8956 domainOpt = SOME(domainCr as Absyn.CREF_QUAL(name, subscripts, Absyn.CREF_IDENT(name="left"))), 8957 comment = comment, info = info)) 8958 equation 8959 domainCr1 = Absyn.CREF_IDENT(name, subscripts); 8960 (N,fieldLst) = getDomNFields(inDomFieldLst,domainCr1,info); 8961 then 8962 {newEQFun(1, lhs_exp, rhs_exp, domainCr1, comment, info, fieldLst)}; 8963 //right boundary condition 8964 case SCode.EQUATION(SCode.EQ_EQUALS(expLeft = lhs_exp, expRight = rhs_exp, 8965 domainOpt = SOME(domainCr as Absyn.CREF_QUAL(name, subscripts, Absyn.CREF_IDENT(name="right"))), 8966 comment = comment, info = info)) 8967 equation 8968 domainCr1 = Absyn.CREF_IDENT(name, subscripts); 8969 (N,fieldLst) = getDomNFields(inDomFieldLst,domainCr1,info); 8970 then 8971 {newEQFun(N, lhs_exp, rhs_exp, domainCr1, comment, info, fieldLst)}; 8972 8953 8973 end matchcontinue; 8954 8974 … … 9038 9058 protected Boolean skip, failVar; 9039 9059 protected Absyn.ComponentRef domainCr; 9060 protected Absyn.Ident domName; 9040 9061 algorithm 9041 9062 failVar := false; 9042 9063 (i, fieldLst, domainCr, info, skip) := inTup; 9064 Absyn.CREF_IDENT(name = domName) := domainCr; 9043 9065 if skip then 9044 9066 outExp := inExp; … … 9051 9073 list<Absyn.Subscript> subscripts; 9052 9074 Absyn.ComponentRef fieldCr; 9053 9075 case Absyn.CREF(Absyn.CREF_QUAL(name = domName, subscripts = {}, componentRef=Absyn.CREF_IDENT(name="x",subscripts={}))) 9076 //coordinate x 9077 then 9078 Absyn.CREF(Absyn.CREF_QUAL(name = domName, subscripts = {}, componentRef=Absyn.CREF_IDENT(name="x",subscripts = {Absyn.SUBSCRIPT(Absyn.INTEGER(i))}))); 9054 9079 case Absyn.CREF(fieldCr as Absyn.CREF_IDENT(name, subscripts)) 9055 9080 //field 9056 9081 equation 9057 if not List.isMemberOnTrue(fieldCr,fieldLst,Absyn.crefEqual) then 9058 failVar = true; 9059 Error.addSourceMessageAndFail(Error.COMPILER_ERROR,{"Field variable ", name, " has different domain than the equation."}, info); 9060 end if; 9082 true = List.isMemberOnTrue(fieldCr,fieldLst,Absyn.crefEqual); 9061 9083 then 9062 9084 Absyn.CREF(Absyn.CREF_IDENT(name, Absyn.SUBSCRIPT(Absyn.INTEGER(i))::subscripts)); … … 9066 9088 if not List.isMemberOnTrue(fieldCr,fieldLst,Absyn.crefEqual) then 9067 9089 failVar = true; 9068 Error.addSourceMessageAndFail(Error.COMPILER_ERROR,{"Field variable ", name, "has different domain than the equation or is not a field." }, info);9090 Error.addSourceMessageAndFail(Error.COMPILER_ERROR,{"Field variable '" + name + "' has different domain than the equation or is not a field." }, info); 9069 9091 end if; 9070 9092 skip = true; … … 9080 9102 Absyn.INTEGER(2), 9081 9103 Absyn.MUL(), 9082 Absyn.CREF(Absyn.CREF_QUAL( "omega"/*fieldDomainName*/,{},Absyn.CREF_IDENT("dx",{})))9104 Absyn.CREF(Absyn.CREF_QUAL(domName,{},Absyn.CREF_IDENT("dx",{}))) 9083 9105 ) 9084 9106 );
Note: See TracChangeset
for help on using the changeset viewer.