Skip to content

Commit f2fab7b

Browse files
author
Peter Aronsson
committed
Implemented BLT sorting using dummy derivative index reduction technique, accessed by giving the flag +d=blt and possibly bltdump.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1196 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent ff32697 commit f2fab7b

File tree

10 files changed

+2678
-14
lines changed

10 files changed

+2678
-14
lines changed

modeq/Makefile.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LDFLAGS = -L$(RMLHOME)/lib/plain $(ANTLR_LIBP) -lrml -lm -lantlr $(LIBSOCKET) \
3737
PROG = modeq
3838
AST = absyn_builder/absyn_builder.a
3939
RTOBJ = runtime/systemimpl.o ../c_runtime/libc_runtime.a runtime/rtopts.o runtime/socketimpl.o \
40-
runtime/printimpl.o runtime/cacheimpl.o runtime/ptolemyio.o $(CORBAOBJ)
40+
runtime/printimpl.o runtime/cacheimpl.o runtime/ptolemyio.o runtime/daeext.o $(CORBAOBJ)
4141

4242
SRCRML= absyn.rml \
4343
algorithm.rml \
@@ -48,6 +48,8 @@ SRCRML= absyn.rml \
4848
codegen.rml \
4949
connect.rml \
5050
dae.rml \
51+
daelow.rml \
52+
derive.rml \
5153
debug.rml \
5254
dump.rml \
5355
dumpgraphviz.rml \

modeq/connect.rml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ relation equ_equations : Exp.ComponentRef list => DAE.Element list =
141141

142142
axiom equ_equations [_] => []
143143

144-
rule equ_equations y::cs => eq
144+
rule equ_equations (y::cs) => eq
145145
------------------------
146146
equ_equations x::y::cs
147147
=> DAE.EQUATION(Exp.CREF(x,Exp.OTHER), Exp.CREF(y,Exp.OTHER))::eq

modeq/daeext.rml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
(*
2+
Copyright PELAB, Linkoping University
3+
4+
This file is part of Open Source Modelica (OSM).
5+
6+
OSM is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2 of the License, or
9+
(at your option) any later version.
10+
11+
OSM is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with Foobar; if not, write to the Free Software
18+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19+
20+
*)
21+
22+
(**
23+
** file: daelow.rml
24+
** module: DAELow
25+
** description: DAELow a lower form of DAE including sparse matrises for
26+
** BLT decomposition, etc.
27+
**
28+
** RCS: %W% %E%
29+
**
30+
**)
31+
32+
(** - Module header *)
33+
34+
module DAEEXT:
35+
36+
37+
relation init_marks: (int,int) => () (* sets v_mark(i), e_mark(i) to false *)
38+
relation e_mark: (int) => () (* sets e_mark(i) to true *)
39+
relation get_e_mark: (int) => bool (* returns e_mark(i) *)
40+
relation v_mark: (int) => () (* sets v_mark(i) to true *)
41+
relation get_v_mark: (int) => bool (* returns e_mark(i) *)
42+
relation dump_marked_equations: (int) => ()
43+
relation dump_marked_variables: (int) => ()
44+
45+
relation init_lowlink: int => ()
46+
relation init_number: int => ()
47+
relation set_lowlink: (int,int) => ()
48+
relation get_lowlink: (int) => int
49+
relation set_number: (int,int) => ()
50+
relation get_number: (int) => int
51+
52+
relation init_v: (int) => ()
53+
relation init_f: (int) => ()
54+
relation set_v: (int,int) => ()
55+
relation get_v: (int) => (int)
56+
57+
relation set_f: (int,int) => ()
58+
relation get_f: (int) => (int)
59+
60+
relation vector_setnth: (int vector,int,int) => ()
61+
62+
end
63+

0 commit comments

Comments
 (0)