-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCBRATU2D.SIF
193 lines (137 loc) · 4.25 KB
/
CBRATU2D.SIF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
***************************
* SET UP THE INITIAL DATA *
***************************
NAME CBRATU2D
* Problem :
* *********
* The complex 2D Bratu problem on the unit square, using finite
* differences.
* Source: problem 3 in
* J.J. More',
* "A collection of nonlinear model problems"
* Proceedings of the AMS-SIAM Summer seminar on the Computational
* Solution of Nonlinear Systems of Equations, Colorado, 1988.
* Argonne National Laboratory MCS-P60-0289, 1989.
* SIF input: Ph. Toint, Dec 1989.
* classification NOR2-MN-V-V
* P is the number of points in one side of the unit square (variable).
* There are 2*P**2 variables
IE P 4 $-PARAMETER n = 32 original value
*IE P 7 $-PARAMETER n = 98
*IE P 16 $-PARAMETER n = 512
*IE P 23 $-PARAMETER n = 1058
IE P 40 $-PARAMETER n = 3200
* LAMBDA is the Bratu problem parameter. It should be positive.
RE LAMBDA 5.0 $-PARAMETER Bratu parameter > 0
* Define a few helpful parameters
IE 1 1
IE 2 2
RE 1.0 1.0
IA P-1 P -1
RI RP-1 P-1
R/ H 1.0 RP-1
R* H2 H H
R* C H2 LAMBDA
RM -C C -1.0
VARIABLES
* Define one variable per discretized point in the unit square
DO J 1 P
DO I 1 P
X U(I,J)
X X(I,J)
ND
GROUPS
* Define a group per inner discretized point.
* The linear term shows the Laplace operator.
DO I 2 P-1
IA R I 1
IA S I -1
DO J 2 P-1
IA V J 1
IA W J -1
XE G(I,J) U(I,J) 4.0
XE G(I,J) U(R,J) -1.0 U(S,J) -1.0
XE G(I,J) U(I,V) -1.0 U(I,W) -1.0
XE F(I,J) X(I,J) 4.0
XE F(I,J) X(R,J) -1.0 X(S,J) -1.0
XE F(I,J) X(I,V) -1.0 X(I,W) -1.0
ND
BOUNDS
FR CBRATU2D 'DEFAULT'
* Fix the variables on the lower and upper edges of the unit square
DO J 1 P
XX CBRATU2D U(1,J) 0.0
XX CBRATU2D U(P,J) 0.0
XX CBRATU2D X(1,J) 0.0
XX CBRATU2D X(P,J) 0.0
ND
* Fix the variables on the left and right edges of the unit square
DO I 2 P-1
XX CBRATU2D U(I,P) 0.0
XX CBRATU2D U(I,1) 0.0
XX CBRATU2D X(I,P) 0.0
XX CBRATU2D X(I,1) 0.0
ND
START POINT
XV CBRATU2D 'DEFAULT' 0.0
ELEMENT TYPE
* Separate real and complex parts
EV RPART U V
EV CPART U V
ELEMENT USES
DO I 2 P-1
DO J 2 P-1
XT A(I,J) RPART
ZV A(I,J) U U(I,J)
ZV A(I,J) V X(I,J)
XT B(I,J) CPART
ZV B(I,J) U U(I,J)
ZV B(I,J) V X(I,J)
ND
GROUP USES
DO I 2 P-1
DO J 2 P-1
ZE G(I,J) A(I,J) -C
ZE F(I,J) B(I,J) -C
ND
OBJECT BOUND
LO CBRATU2D 0.0
* Solution
*LO SOLTN 0.0
ENDATA
***********************
* SET UP THE FUNCTION *
* AND RANGE ROUTINES *
***********************
ELEMENTS CBRATU2D
TEMPORARIES
M EXP
M COS
M SIN
R EXPU
R EXPUS
R EXPUC
INDIVIDUALS
* Real part
T RPART
A EXPU EXP( U )
A EXPUC EXPU * COS( V )
A EXPUS EXPU * SIN( V )
F EXPUC
G U EXPUC
G V - EXPUS
H U U EXPUC
H U V - EXPUS
H V V - EXPUC
* Complex part
T CPART
A EXPU EXP( U )
A EXPUC EXPU * COS( V )
A EXPUS EXPU * SIN( V )
F EXPUS
G U EXPUS
G V EXPUC
H U U EXPUS
H U V EXPUC
H V V - EXPUS
ENDATA