Skip to content

Commit 1f072ef

Browse files
author
Peter Aronsson
committed
-Merged -r 4222 from MathCoreOSMC branch (connect two-dimensional array of components)
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4424 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 33cc1a0 commit 1f072ef

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

Compiler/Env.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ algorithm
15231523
((flatArrayType as (Types.T_COMPLEX(_,tvars,_,_),_)),adims) = Types.flattenArrayType(tmpty);
15241524
false = Types.isComplexConnector(flatArrayType);
15251525

1526-
indexSubscriptLists = createSubs(adims);
1526+
indexSubscriptLists = createSubs(listReverse(adims));
15271527

15281528
lst1 = localInsideConnectorFlowvars3_2(tvars, id, indexSubscriptLists);
15291529
lst2 = localInsideConnectorFlowvars2(l);

Compiler/Error.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ protected constant list<tuple<Integer, MessageType, Severity, String>> errorTabl
450450
(ASSERT_CONSTANT_FALSE_ERROR,SYMBOLIC(),ERROR(),
451451
"assert triggered during translation: %s"),
452452
(SETTING_FIXED_ATTRIBUTE,TRANSLATION(),WARNING(),
453-
"No variable has fixed=false but model contains initial equations. Setting fixed=false to the following variables: %s"),
453+
"Using overdeterimed solver for initialization. Setting fixed=false to the following variables: %s"),
454454
(PROPAGATE_START_VALUE,TRANSLATION(),WARNING(),
455455
"Failed to propagate the start value from variable dummy state %s to state %s. Provide a start value for the selected state instead"),
456456
(SEMI_SUPPORTED_FUNCTION,TRANSLATION(),WARNING(),

Compiler/Inst.mo

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9031,7 +9031,10 @@ protected function daeDeclare
90319031
"function: daeDeclare
90329032
Given a global component name, a type, and a set of attributes, this function declares a component for the DAE result.
90339033
Altough this function returns a list of DAE.Element, only one component is actually declared.
9034-
The functions daeDeclare2 and daeDeclare3 below are helper functions that perform parts of the task."
9034+
The functions daeDeclare2 and daeDeclare3 below are helper functions that perform parts of the task.
9035+
Note: Currently, this function can only declare scalar variables, i.e. the element type of an array type is used. To indicate that the variable
9036+
is an array, the InstDims attribute is used. This will need to be redesigned in the futurue, when array variables should not be flattened out in the frontend.
9037+
"
90359038
input Exp.ComponentRef inComponentRef;
90369039
input ClassInf.State inState;
90379040
input Types.Type inType;

Compiler/Types.mo

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,43 @@ algorithm
19551955
end matchcontinue;
19561956
end makeArray;
19571957

1958+
public function makeArraySubscripts "function: makeArray
1959+
This function makes an array type given a Type and a list of Exp.Subscript
1960+
"
1961+
input Type inType;
1962+
input list<Exp.Subscript> lst;
1963+
output Type outType;
1964+
algorithm
1965+
outType:=
1966+
matchcontinue (inType,lst)
1967+
local
1968+
Type t;
1969+
Integer i;
1970+
Exp.Exp e;
1971+
case (t,{}) then t;
1972+
case (t,Exp.WHOLEDIM::lst)
1973+
equation
1974+
t = makeArraySubscripts((T_ARRAY(DIM(NONE),t),NONE),lst);
1975+
then
1976+
t;
1977+
case (t,Exp.SLICE(e)::lst)
1978+
equation
1979+
t = makeArraySubscripts((T_ARRAY(DIM(NONE),t),NONE),lst);
1980+
then
1981+
t;
1982+
1983+
case (t,Exp.INDEX(Exp.ICONST(i))::lst)
1984+
equation
1985+
t = makeArraySubscripts((T_ARRAY(DIM(SOME(i)),t),NONE),lst);
1986+
then
1987+
t;
1988+
case (t,Exp.INDEX(_)::lst)
1989+
equation
1990+
t = makeArraySubscripts((T_ARRAY(DIM(NONE),t),NONE),lst);
1991+
then
1992+
t;
1993+
end matchcontinue;
1994+
end makeArraySubscripts;
19581995

19591996
public function dimensionsEqual "Returns true if two dimensions are 'equal', i.e. if both
19601997
are specified, return comparison of dimension size,

0 commit comments

Comments
 (0)