11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.19 2000/02/11 13:35:16 peterg
# %% Added the new MTTpar generation
# %%
# %% Revision 1.18 1999/11/14 22:22:17 peterg
# %% Removed checks for implicit - now done at command-line level.
# %%
# %% Revision 1.17 1999/11/04 04:54:24 peterg
|
>
>
>
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.1 2000/05/11 10:55:57 peterg
# %% Initial revision
# %%
# %% Revision 1.19 2000/02/11 13:35:16 peterg
# %% Added the new MTTpar generation
# %%
# %% Revision 1.18 1999/11/14 22:22:17 peterg
# %% Removed checks for implicit - now done at command-line level.
# %%
# %% Revision 1.17 1999/11/04 04:54:24 peterg
|
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# Inform user
echo Creating $1_$2.m
#Create the $2 file complete with headers.
case $representation in
simpar)
echo "% Script file $1_$2.m" > $1_$2.m
echo "%% $2 file ($1_$2.m)" >> $1_$2.m
echo "%% Generated by MTT at `date`" >> $1_$2.m
echo '% Dummy globals' >> $1_$2.m
echo 'global ...' >> $1_$2.m
echo 'mtt_dummy_global;' >> $1_$2.m
;;
numpar)
lang_header $1 numpar m '' MTTpar > $1_numpar.m
;;
*)
echo "function $name = $1_$2$arg" > $1_$2.m
echo "%% $2 file ($1_$2.m)" >> $1_$2.m
|
|
<
<
<
<
<
|
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
# Inform user
echo Creating $1_$2.m
#Create the $2 file complete with headers.
case $representation in
simpar)
lang_header -noglobals $1 simpar m '' mttsimpar > $1_simpar.m
;;
numpar)
lang_header $1 numpar m '' MTTpar > $1_numpar.m
;;
*)
echo "function $name = $1_$2$arg" > $1_$2.m
echo "%% $2 file ($1_$2.m)" >> $1_$2.m
|
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
}
{
N=split($1,a,"=");
if (N==2) {
LHS = a[1];
RHS = a[2];
gsub(quote, doublequote, RHS);
sub(/^[ ]*LAST/, "mttLAST", LHS);
sub(/^[ ]*DT/, "mttDT", LHS);
sub(/^[ ]*STEPFACTOR/, "mttSTEPFACTOR", LHS);
sub(/^[ ]*METHOD/, "mttMETHOD", LHS);
sub(/^[ ]*WMIN/, "mttWMIN", LHS);
sub(/^[ ]*WMAX/, "mttWMAX", LHS);
sub(/^[ ]*WSTEPS/, "mttWSTEPS", LHS);
sub(/^[ ]*INPUT/, "mttinput", LHS);
LHS = tolower(LHS);
RHS = tolower(RHS);
sub(/["]*euler["]*/, 1, RHS);
sub(/["]*implicit["]*/, 2, RHS);
statement = sprintf("%s= %s",LHS,RHS);
if ( (match(statement,";")==0)&&\
((match(statement,"if ")==0))&&\
|
|
|
|
|
|
|
|
|
|
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
}
{
N=split($1,a,"=");
if (N==2) {
LHS = a[1];
RHS = a[2];
gsub(quote, doublequote, RHS);
sub(/^[ ]*LAST/, "MTTsimpar.LAST", LHS);
sub(/^[ ]*DT/, "MTTsimpar.DT", LHS);
sub(/^[ ]*STEPFACTOR/, "MTTsimpar.STEPFACTOR", LHS);
sub(/^[ ]*METHOD/, "MTTsimpar.METHOD", LHS);
sub(/^[ ]*WMIN/, "MTTsimpar.WMIN", LHS);
sub(/^[ ]*WMAX/, "MTTsimpar.WMAX", LHS);
sub(/^[ ]*WSTEPS/, "MTTsimpar.WSTEPS", LHS);
sub(/^[ ]*INPUT/, "MTTsimpar.input", LHS);
LHS = tolower(LHS);
RHS = tolower(RHS);
sub(/["]*euler["]*/, 1, RHS);
sub(/["]*implicit["]*/, 2, RHS);
statement = sprintf("%s= %s",LHS,RHS);
if ( (match(statement,";")==0)&&\
((match(statement,"if ")==0))&&\
|