-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFMINSURF.SIF
252 lines (180 loc) · 5.91 KB
/
FMINSURF.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
***************************
* SET UP THE INITIAL DATA *
***************************
NAME FMINSURF
* Problem :
* *********
* The free boundary minimum surface problem.
* The problem comes from the discretization of the minimum surface
* problem on the unit square with "free boundary conditions"
* one must find the minumum surface over the unit square
* (which is clearly 1.0). Furthermore, the average distance of the surface
* from zero is also minimized.
* The Hessian is dense.
* 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) + b(i,j) ) ) / (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)
* Source: setting the boundary free in
* A Griewank and Ph. Toint,
* "Partitioned variable metric updates for large structured
* optimization problems",
* Numerische Mathematik 39:429-448, 1982.
* SIF input: Ph. Toint, November 1991.
* classification OUR2-MY-V-0
* P is the number of points in one side of the unit square
*IE P 4 $-PARAMETER n = 16 original value
*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
IE P 75 $-PARAMETER n = 5625
*IE P 100 $-PARAMETER n = 10000
*IE P 125 $-PARAMETER n = 15625
* Define the plane giving the boundary conditions
RE H00 1.0
RE SLOPEJ 4.0
RE SLOPEI 8.0
* 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
RI RP P
R* P2 RP RP
R* P4 P2 P2
IE 1 1
IE 2 2
R* STON INVP-1 SLOPEI
R* WTOE INVP-1 SLOPEJ
R+ H01 H00 SLOPEJ
R+ H10 H00 SLOPEI
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
* Average height groups
DO J 1 P
DO I 1 P
XN AVH X(I,J) 1.0
ND
ZN AVH 'SCALE' P4
CONSTANTS
X FMINSURF 'DEFAULT' -1.0
FMINSURF AVH 0.0
BOUNDS
FR FMINSURF 'DEFAULT'
START POINT
* All variables not on the boundary are set to 0.0
XV FMINSURF 'DEFAULT' 0.0
* Starting values on the lower and upper edges
DO J 1 P
IA J-1 J -1
RI RJ-1 J-1
R* TH RJ-1 WTOE
R+ TL TH H00
R+ TU TH H10
Z FMINSURF X(1,J) TL
Z FMINSURF X(P,J) TU
ND
* Starting values on the left and right edges
DO I 2 P-1
IA I-1 I -1
RI RI-1 I-1
R* TV RI-1 STON
R+ TR TV H00
R+ TL TV H01
Z FMINSURF X(I,P) TL
Z FMINSURF X(I,1) TR
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 or least-squares type
GV SQROOT ALPHA
GV L2 GVAR
GROUP USES
* The overage distance group of of least-squares type
T AVH L2
* All other 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 FMINSURF 0.0
* Solution
*LO SOLTN 1.0
ENDATA
***********************
* SET UP THE FUNCTION *
* AND RANGE ROUTINES *
***********************
ELEMENTS FMINSURF
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 FMINSURF
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 )
* least-squares groups
T L2
F GVAR * GVAR
G GVAR + GVAR
H 2.0D0
ENDATA