-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNLMSURF.SIF
314 lines (225 loc) · 7.42 KB
/
NLMSURF.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
***************************
* SET UP THE INITIAL DATA *
***************************
NAME NLMSURF
* Problem :
* *********
* The minimum surface problem with nonlinear boundary condition
* The problem comes from the discretization of the minimum surface
* problem on the unit square: given a set of boundary conditions on
* the four sides of the square, one must find the surface which
* meets these boundary conditions and is of minimum area.
* The unit square is discretized into (p-1)**2 little squares. The
* heights of the considered surface above the corners of these little
* squares are the problem variables, There are p**2 of them.
* Given these heights, the area above a little square is
* approximated by the
* S(i,j) = sqrt( 1 + 0.5(p-1)**2 ( a(i,j)**2 + b(i,j)**2 ) ) / (p-1)**2
* where
* a(i,j) = x(i,j) - x(i+1,j+1)
* and
* b(i,j) = x(i+1,j) - x(i,j+1)
* In the Nonlinear Mininum Surface, the boundary conditions are
* given by the following nonlinear functions:
* x(i,1) = 1 + 8t + 10(1-t)**2
* x(i,p) = 5 + 8t + 10(2-t)**2
* where
* t = (i-1)/(p-1)
* and
* x(1,j) = 1 + 4t + 10(1+t)**2
* x(p,j) = 9 + 4t + 10t**2
* where
* t = (j-1)/(p-1).
* Source:
* A Griewank and Ph. Toint,
* "Partitioned variable metric updates for large structured
* optimization problems",
* Numerische Mathematik 39:429-448, 1982.
* SIF input: Ph. Toint, Dec 1989.
* classification OXR2-MY-V-0
* P is the number of points in one side of the unit square
*IE P 4 $-PARAMETER n = 16
*IE P 7 $-PARAMETER n = 49
*IE P 8 $-PARAMETER n = 64
*IE P 11 $-PARAMETER n = 121
*IE P 31 $-PARAMETER n = 961
*IE P 32 $-PARAMETER n = 1024 original value
IE P 75 $-PARAMETER n = 5625
*IE P 100 $-PARAMETER n = 10000
*IE P 125 $-PARAMETER n = 15625
* Define a few helpful parameters
I+ TWOP P P
IA P-1 P -1
I* PP-1 P P-1
RI RP-1 P-1
RD INVP-1 RP-1 1.0
R* RP-1SQ INVP-1 INVP-1
RD SCALE RP-1SQ 1.0
R* SQP-1 RP-1 RP-1
RM PARAM SQP-1 0.5
IE 1 1
IE 2 2
VARIABLES
* Define one variable per discretized point in the unit square
DO J 1 P
DO I 1 P
X X(I,J)
ND
GROUPS
* Define a group per little square
DO I 1 P-1
DO J 1 P-1
ZN S(I,J) 'SCALE' SCALE
ND
CONSTANTS
X NLMSURF 'DEFAULT' -1.0
BOUNDS
FR NLMSURF 'DEFAULT'
* Fix the variables on the lower and upper edges of the unit square
DO J 1 P
IA J-1 J -1
RI RJ-1 J-1
R* T RJ-1 INVP-1
R* T2 T T
RM 4T T 4.0
RA T+1 T 1.0
R* T1SQ T+1 T+1
RM 10T1SQ T1SQ 10.0
R+ TL 10T1SQ 4T
RA LOWER TL 1.0
RM 10T2 T2 10.0
R+ TU 10T2 4T
RA UPPER TU 9.0
ZX NLMSURF X(1,J) LOWER
ZX NLMSURF X(P,J) UPPER
ND
* Fix the variables on the left and right edges of the unit square
DO I 2 P-1
IA I-1 I -1
RI RI-1 I-1
R* T RI-1 INVP-1
RA T-1 T -1.0
R* T-1SQ T-1 T-1
RM 10T-SQ T-1SQ 10.0
RM 8T T 8.0
R+ TL 8T 10T-SQ
RA LEFT TL 1.0
RA T-2 T -2.0
R* T-2SQ T-2 T-2
RM 10T2SQ T-2SQ 10.0
R+ TR 8T 10T2SQ
RA RIGHT TR 5.0
ZX NLMSURF X(I,P) LEFT
ZX NLMSURF X(I,1) RIGHT
ND
START POINT
* All variables not on the boundary are set to 0.0
XV NLMSURF 'DEFAULT' 0.0
* Start from the boundary values on the lower and upper edges
DO J 1 P
IA J-1 J -1
RI RJ-1 J-1
R* T RJ-1 INVP-1
R* T2 T T
RM 4T T 4.0
RA T+1 T 1.0
R* T1SQ T+1 T+1
RM 10T1SQ T1SQ 10.0
R+ TL 10T1SQ 4T
RA LOWER TL 1.0
RM 10T2 T2 10.0
R+ TU 10T2 4T
RA UPPER TU 9.0
Z NLMSURF X(1,J) LOWER
Z NLMSURF X(P,J) UPPER
ND
* Start from the boundary values on the left and right edges
DO I 2 P-1
IA I-1 I -1
RI RI-1 I-1
R* T RI-1 INVP-1
RA T-1 T -1.0
R* T-1SQ T-1 T-1
RM 10T-SQ T-1SQ 10.0
RM 8T T 8.0
R+ TL 8T 10T-SQ
RA LEFT TL 1.0
RA T-2 T -2.0
R* T-2SQ T-2 T-2
RM 10T2SQ T-2SQ 10.0
R+ TR 8T 10T2SQ
RA RIGHT TR 5.0
Z NLMSURF X(I,P) LEFT
Z NLMSURF X(I,1) RIGHT
ND
ELEMENT TYPE
* The only element type.
EV ISQ V1 V2
IV ISQ U
ELEMENT USES
* Each little square has two elements using diagonal and
* antidiagonal corner values
DO I 1 P-1
IA I+1 I 1
DO J 1 P-1
IA J+1 J 1
XT A(I,J) ISQ
ZV A(I,J) V1 X(I,J)
ZV A(I,J) V2 X(I+1,J+1)
XT B(I,J) ISQ
ZV B(I,J) V1 X(I+1,J)
ZV B(I,J) V2 X(I,J+1)
ND
GROUP TYPE
* Groups are of the square root type
GV SQROOT ALPHA
GROUP USES
* All groups are of SQRT type.
DO I 1 P-1
DO J 1 P-1
XT S(I,J) SQROOT
ZE S(I,J) A(I,J) PARAM
ZE S(I,J) B(I,J) PARAM
ND
OBJECT BOUND
LO NLMSURF 0.0
* Solution
*LO SOLTN(4) 32.15908307
*LO SOLTN(7) 36.18183929
*LO SOLTN(8) 36.60092706
*LO SOLTN(11) 37.37901870
*LO SOLTN(31) 38.57170723
*LO SOLTN(32) 38.59107615
*LO SOLTN(75) ???
*LO SOLTN(100) ???
*LO SOLTN(125) ???
ENDATA
***********************
* SET UP THE FUNCTION *
* AND RANGE ROUTINES *
***********************
ELEMENTS NLMSURF
INDIVIDUALS
* Difference squared
T ISQ
R U V1 1.0 V2 -1.0
F U * U
G U U + U
H U U 2.0
ENDATA
*********************
* SET UP THE GROUPS *
* ROUTINE *
*********************
GROUPS NLMSURF
TEMPORARIES
M SQRT
R SQRAL
INDIVIDUALS
* square root groups
T SQROOT
A SQRAL SQRT(ALPHA)
F SQRAL
G 0.5D0 / SQRAL
H -0.25D0 / ( SQRAL * ALPHA )
ENDATA