-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBRATU2D.SIF
144 lines (99 loc) · 3.09 KB
/
BRATU2D.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
***************************
* SET UP THE INITIAL DATA *
***************************
NAME BRATU2D
* Problem :
* *********
* The 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.
* There are P*P variables.
*IE P 7 $-PARAMETER n=P**2 original value
*IE P 10 $-PARAMETER n=P**2
*IE P 22 $-PARAMETER n=P**2
*IE P 32 $-PARAMETER n=P**2
IE P 72 $-PARAMETER n=P**2
* LAMBDA is the Bratu problem parameter. It should be positive.
RE LAMBDA 4.0 $-PARAMETER > 0
* Define a few helpful parameters
RE 1.0 1.0
IE 1 1
IE 2 2
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)
ND
GROUPS
* Define a group per inner discretized point.
* The linear term shows the Laplace operator.
DO I 2 P-1
IA I+1 I 1
IA I-1 I -1
DO J 2 P-1
IA J+1 J 1
IA J-1 J -1
XE G(I,J) U(I,J) 4.0
XE G(I,J) U(I+1,J) -1.0 U(I-1,J) -1.0
XE G(I,J) U(I,J+1) -1.0 U(I,J-1) -1.0
ND
BOUNDS
FR BRATU2D 'DEFAULT'
* Fix the variables on the lower and upper edges of the unit square
DO J 1 P
XX BRATU2D U(1,J) 0.0
XX BRATU2D U(P,J) 0.0
ND
* Fix the variables on the left and right edges of the unit square
DO I 2 P-1
XX BRATU2D U(I,P) 0.0
XX BRATU2D U(I,1) 0.0
ND
ELEMENT TYPE
EV EXP U
ELEMENT USES
T 'DEFAULT' EXP
DO I 2 P-1
DO J 2 P-1
ZV A(I,J) U U(I,J)
ND
GROUP USES
DO I 2 P-1
DO J 2 P-1
ZE G(I,J) A(I,J) -C
ND
OBJECT BOUND
LO BRATU2D 0.0
* Solution
*LO SOLTN 0.0
ENDATA
***********************
* SET UP THE FUNCTION *
* AND RANGE ROUTINES *
***********************
ELEMENTS BRATU2D
TEMPORARIES
M EXP
R EXPU
INDIVIDUALS
* Parametric exponential
T EXP
A EXPU EXP( U )
F EXPU
G U EXPU
H U U EXPU
ENDATA