forked from johannesgerer/jburkardt-f77
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfishpack.html
More file actions
643 lines (610 loc) · 18.9 KB
/
fishpack.html
File metadata and controls
643 lines (610 loc) · 18.9 KB
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
<html>
<head>
<title>
FISHPACK - A Poisson Equation Solver
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
FISHPACK <br> A Poisson Equation Solver
</h1>
<hr>
<p>
<b>FISHPACK</b>
is a FORTRAN77 library which
solves several forms of Poisson's equation,
by John Adams, Paul Swarztraube, Roland Sweet.
</p>
<p>
<b>FISHPACK</b> is a package of subroutines for solving separable partial
differential equations in various coordinate systems. Such equations
include the Laplace, Poisson and Helmholtz equations and have the form:
<pre><code>
Uxx + Uyy = 0 (Laplace)
Uxx + Uyy = F(X,Y) (Poisson)
Uxx + Uyy + lambda*U = F(X,Y) (Helmholtz)
</code></pre>
in two dimensional cartesian coordinates.
</p>
<p>
<b>FISHPACK</b> is not limited to the 2D cartesian case. It can set up
and solve the equations in coordinate systems including:
<ul>
<li>
2D cartesian,
</li>
<li>
2D polar,
</li>
<li>
2D cylindrical,
</li>
<li>
3D spherical,
</li>
<li>
3D axisymmetric spherical (cylindrical),
</li>
<li>
3D cartesian.
</li>
</ul>
</p>
<p>
The algorithm uses 5 point finite differences
and an evenly spaced grid. Other routines are included
which solve related problems in which the derivative terms have
coefficient functions.
</p>
<p>
In the documentation, the words "standard" and "staggered"
grid are used. The difference between these grids is simple. In
the one dimensional case, a standard grid of size H on the interval
(A,B) would be (A, A+H, A+2*H, ..., B-H, B) whereas a staggered
grid would be (A+H/2, A+3H/2, ..., B-3H/2, B-H/2). Versions of
2D solvers are offered below using both kinds of grids. Depending
on the boundary conditions, or other singularities near the boundary,
one or the other type of grid may be preferred.
<p>
<p>
The version of FISHPACK presented here has been altered and adapted somewhat.
To obtain a clean and correct copy of the original version, go to
<a href = "http://www.netlib.org/fishpack/index.html">
http://www.netlib.org/fishpack/index.html </a>
</p>
<h3 align = "center">
Related Programs:
</h3>
<p>
<a href = "../../f77_src/betis/betis.html">
BETIS</a>,
a FORTRAN77 program which
solves Laplace's equation in a 2D region using the boundary element method.
</p>
<p>
<a href = "../../m_src/fem_50/fem_50.html">
FEM_50</a>,
a MATLAB program which
solves Laplace's equation in an arbitrary region using the finite element method.
</p>
<p>
<a href = "../../f77_src/fem2d_poisson_rectangle/fem2d_poisson_rectangle.html">
FEM2D_POISSON_RECTANGLE</a>,
a FORTRAN77 program which
solves Poisson's equation in a 2D rectangle using the finite element method.
</p>
<p>
<a href = "../../f_src/fftpack5/fftpack5.html">
FFTPACK5</a>,
a FORTRAN90 library which
computes Fast Fourier Transforms. A version of this library
is included in FISHPACK.
</p>
<p>
<a href = "../../f77_src/serba/serba.html">
SERBA</a>,
a FORTRAN77 program which
solves problems in planar elasticity using the boundary element method.
</p>
<p>
<a href = "../../f_src/slatec/slatec.html">
SLATEC</a>,
a FORTRAN90 library which
includes a copy of FISHPACK.
</p>
<h3 align = "center">
Author:
</h3>
<p>
Paul Swarztrauber, Roland Sweet.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Ulrich Schumann, Roland Sweet,<br>
A direct method for the solution of Poisson's equation with Neumann
boundary conditions on a staggered grid of arbitrary size,<br>
Journal of Computational Physics,<br>
Volume 20, 1976, pages 171-182.
</li>
<li>
Paul Swarztrauber,<br>
A direct method for the discrete solution of separable elliptic
equations,<br>
SIAM Journal on Numerical Analysis,<br>
Volume 11, 1974, pages 1136-1150.
</li>
<li>
Paul Swarztrauber, Roland Sweet,<br>
Efficient FORTRAN Subprograms for the Solution of Elliptic Equations,<br>
NCAR Technical Report TN/IA-109,<br>
National Center for Atmospheric Research, 1975.
</li>
<li>
Roland Sweet,<br>
A cyclic reduction algorithm for solving block tridiagonal systems
of arbitrary dimensions,<br>
SIAM Journal on Numerical Analysis,<br>
Volume 14, September 1977, pages 706-720.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "fishpack.f">fishpack.f</a>, the source code;
</li>
<li>
<a href = "fishpack.sh">fishpack.sh</a>,
commands to compile the source code;
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<b>FISHPACK_PRB</b> runs many tests on the FISHPACK software.
<ul>
<li>
<a href = "fishpack_prb.f">fishpack_prb.f</a>, a sample calling
program;
</li>
<li>
<a href = "fishpack_prb.sh">fishpack_prb.sh</a>, commands to
compile, link and run the sample calling program;
</li>
<li>
<a href = "fishpack_prb_output.txt">fishpack_prb_output.txt</a>,
the output file.
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>BCRH</b>
</li>
<li>
<b>BLKTR1</b> solves the linear system
</li>
<li>
<b>BLKTRI</b> solve linear system derived from a separable elliptic equation.
</li>
<li>
<b>BSRH</b>
</li>
<li>
<b>CBLKTR</b> is a complex version of BLKTRI.
</li>
<li>
<b>CCMPB</b> computes the roots of the b polynomials using routine
</li>
<li>
<b>CHKPR4</b> checks the input parameters.
</li>
<li>
<b>CHKPRM</b> checks the input parameters for errors.
</li>
<li>
<b>CHKSN4</b> checks if the PDE that SEPX4 must solve is a singular operator.
</li>
<li>
<b>CHKSNG</b> checks if the PDE that SEPELI must solve is a singular operator.
</li>
<li>
<b>CMGNBN:</b> complex generalized Buneman algorithm, linear equation solver.
</li>
<li>
<b>CMPCSG</b> computes required cosine values in ascending order.
</li>
<li>
<b>CMPMRG</b> merges two ascending strings of numbers.
</li>
<li>
<b>CMPOSD</b> solves Poisson's equation for Dirichlet boundary conditions.
</li>
<li>
<b>CMPOSN</b> solves Poisson's equation with Neumann boundary conditions.
</li>
<li>
<b>CMPOSP</b> solves poisson equation with periodic boundary conditions.
</li>
<li>
<b>CMPTR3</b> solves a tridiagonal system.
</li>
<li>
<b>CMPTRX</b> solves a system of linear equations where the
</li>
<li>
<b>COFX</b> sets coefficients in the x-direction.
</li>
<li>
<b>COFX4</b> sets coefficients in the x-direction.
</li>
<li>
<b>COFY</b> sets coefficients in y direction
</li>
<li>
<b>COMPB</b> computes the roots of the b polynomials using subroutine
</li>
<li>
<b>COSGEN</b> computes required cosine values in ascending order.
</li>
<li>
<b>COSQB</b> backward cosine quarter wave transform.
</li>
<li>
<b>COSQB1</b> is a utility routine for COSQB.
</li>
<li>
<b>COSQF</b> forward cosine quarter wave transform.
</li>
<li>
<b>COSQF1</b> is a utility routine for COSQF.
</li>
<li>
<b>COSQI</b> initializes the cosine quarter wave transform.
</li>
<li>
<b>COST</b> cosine transform.
</li>
<li>
<b>COSTI</b> initializes the cosine transform.
</li>
<li>
<b>CPADD</b> computes the eigenvalues of the periodic tridiagonal matrix
</li>
<li>
<b>cproc</b> applies a sequence of matrix operations to the vector x and
</li>
<li>
<b>cprocp</b> applies a sequence of matrix operations to the vector x and
</li>
<li>
<b>cprod</b> applies a sequence of matrix operations to the vector x and
</li>
<li>
<b>cprodp</b> applies a sequence of matrix operations to the vector x and
</li>
<li>
<b>DEFE4</b> first approximates the truncation error given by
</li>
<li>
<b>DEFER</b> first approximates the truncation error given by
</li>
<li>
<b>DX</b> computes second order finite difference
</li>
<li>
<b>DX4</b> computes second order finite difference
</li>
<li>
<b>DY</b> computes second order finite difference
</li>
<li>
<b>DY4</b> computes second order finite difference
</li>
<li>
<b>EPMACH</b> computes an approximate machiine epsilon (accuracy)
</li>
<li>
<b>FDUMP</b> creates an error dump.
</li>
<li>
<b>GENBUN:</b> generalized Buneman algorithm, linear equation solver.
</li>
<li>
<b>HSTCRT:</b> solves the standard five-point finite difference
approximation on a staggered grid to the Helmholtz equation in
cartesian coordinates.
</li>
<li>
<b>HSTCS1</b> is a utility routine for HSTCSP.
</li>
<li>
<b>HSTCSP</b> solves the standard five-point finite difference
approximation on a staggered grid to the modified Helmholtz equation
in spherical coordinates assuming axisymmetry (no dependence on
longitude).
</li>
<li>
<b>HSTCYL</b> solves the standard five-point finite difference
approximation on a staggered grid to the modified helmholtz
equation in cylindrical coordinates.
This two-dimensional modified Helmholtz equation results
from the Fourier transform of a three-dimensional Poisson
equation.
</li>
<li>
<b>HSTPLR</b> solves the standard five-point finite difference
approximation on a staggered grid to the Helmholtz equation in
polar coordinates.
</li>
<li>
<b>HSTSSP</b> solves the standard five-point finite difference
approximation on a staggered grid to the Helmholtz equation in
spherical coordinates and on the surface of the unit sphere
(radius of 1).
</li>
<li>
<b>HW3CRT</b> solves the standard seven-point finite
difference approximation to the Helmholtz equation in Cartesian
coordinates.
</li>
<li>
<b>HWSCRT</b> solves the standard five-point finite
difference approximation to the Helmholtz equation in Cartesian
coordinates.
</li>
<li>
<b>HWSCS1</b> is a utility routine for HWSCSP.
</li>
<li>
<b>HWSCSP</b> solves a finite difference approximation to the
modified Helmholtz equation in spherical coordinates assuming
axisymmetry (no dependence on longitude).
This two dimensional modified Helmholtz equation results from
the Fourier transform of the three dimensional Poisson equation.
</li>
<li>
<b>HWSCYL</b> solves a finite difference approximation to the
Helmholtz equation in cylindrical coordinates.
This modified Helmholtz equation results from the Fourier
transform of the three-dimensional Poisson equation.
</li>
<li>
<b>HWSPLR</b> solves a finite difference approximation to the
Helmholtz equation in polar coordinates.
</li>
<li>
<b>HWSSS1</b> is a utility routine for HWSSSP.
</li>
<li>
<b>HWSSSP</b> solves a finite difference approximation to the
Helmholtz equation in spherical coordinates and on the surface of
the unit sphere (radius of 1).
</li>
<li>
<b>INDXB</b> indexes the first root of the B(I,IR) polynomial.
</li>
<li>
<b>INDXC</b>
</li>
<li>
<b>INXCA</b>
</li>
<li>
<b>INXCB</b>
</li>
<li>
<b>INXCC</b>
</li>
<li>
<b>J4SAVE</b> sets or gets variables needed by the error handler.
</li>
<li>
<b>MERGE</b> merges two ascending strings of numbers in the array TCOS.
</li>
<li>
<b>MINSO4</b> orthogonalizes the array usol with respect to
</li>
<li>
<b>MINSOL</b> orthogonalizes the array usol with respect to
</li>
<li>
<b>ORTHO4</b> orthogonalizes the array usol with respect to
</li>
<li>
<b>ORTHOG</b> orthogonalizes the array usol with respect to
</li>
<li>
<b>PGSF</b>
</li>
<li>
<b>PIMACH</b> supplies the value of the constant pi correct to
</li>
<li>
<b>POIS3D</b> solves a special set of linear equations.
</li>
<li>
<b>POISD2</b> solves Poisson's equation for Dirichlet boundary conditions.
</li>
<li>
<b>POISN2</b> solves Poisson's equation with Neumann boundary conditions.
</li>
<li>
<b>POISP2</b> solves Poisson's equation with periodic boundary conditions.
</li>
<li>
<b>POISTG</b> solves a special set of linear equations.
</li>
<li>
<b>POS3D1</b>
</li>
<li>
<b>POSTG2</b> solves Poisson's equation on a staggered grid.
</li>
<li>
<b>PPADD</b> computes the eigenvalues of the periodic tridiagonal matrix
</li>
<li>
<b>PROC</b> applies a sequence of matrix operations to the vector x and
</li>
<li>
<b>PROCP</b> applies a sequence of matrix operations to the vector x and
</li>
<li>
<b>PROD</b> applies a sequence of matrix operations to the vector x and
</li>
<li>
<b>PRODP</b> applies a sequence of matrix operations to the vector x
</li>
<li>
<b>RADB2</b> - backward Fourier transform, radix 2.
</li>
<li>
<b>RADB3</b> - backward Fourier transform, radix 3.
</li>
<li>
<b>RADB4</b> - backward Fourier transform, radix 4.
</li>
<li>
<b>RADB5</b> - backward Fourier transform, radix 5.
</li>
<li>
<b>RADBG</b> - backward Fourier transform, general radix.
</li>
<li>
<b>RADF2</b> - forward Fourier transform, radix 2.
</li>
<li>
<b>RADF3</b> - forward Fourier transform, radix 3.
</li>
<li>
<b>RADF4</b> - forward Fourier transform, radix 4.
</li>
<li>
<b>RADF5</b> - forward Fourier transform, radix 5.
</li>
<li>
<b>RADFG</b> - forward Fourier transform, general radix.
</li>
<li>
<b>RFFTB</b> - backward Fourier transform.
</li>
<li>
<b>RFFTB1</b>
</li>
<li>
<b>RFFTF</b> - forward Fourier transform.
</li>
<li>
<b>RFFTF1</b>
</li>
<li>
<b>RFFTI</b> - initialized Fourier transform.
</li>
<li>
<b>RFFTI1</b>
</li>
<li>
<b>SEPELI</b> 2D general separable elliptic problem, second or fourth order scheme.
</li>
<li>
<b>SEPX4</b> 2D restricted separable elliptic problem, second or fourth order scheme.
</li>
<li>
<b>SINQB</b> backward sine quarter wave transform.
</li>
<li>
<b>SINQF</b> forward sine quarter wave transform.
</li>
<li>
<b>SINQI</b> initializes the sine quarter wave transform.
</li>
<li>
<b>SINT:</b> the sine transform.
</li>
<li>
<b>SINTI</b> initializes the sine transform.
</li>
<li>
<b>SPELI4</b> sets up vectors and arrays for input to BLKTRI
</li>
<li>
<b>SPELIP</b> sets up vectors and arrays for input to BLKTRI
</li>
<li>
<b>STORE</b> forces its argument to be stored.
</li>
<li>
<b>TEVLC</b>
</li>
<li>
<b>TEVLS</b> finds the eigenvalues of a symmetric tridiagonal matrix.
</li>
<li>
<b>TRI3</b>
</li>
<li>
<b>TRID</b>
</li>
<li>
<b>TRIS4</b> solves for a non-zero eigenvector corresponding
</li>
<li>
<b>TRISP</b> solves for a non-zero eigenvector corresponding
</li>
<li>
<b>TRIX</b> solves a system of linear equations where the
</li>
<li>
<b>XERCNT</b> allows the user to control error handling.
</li>
<li>
<b>XERHLT</b> aborts the program and prints an error message.
</li>
<li>
<b>XERMAX</b> sets the maximum number of appearances of an error message.
</li>
<li>
<b>XERMSG</b> processes an error message.
</li>
<li>
<b>XERPRN</b> prints an error message.
</li>
<li>
<b>XERSVE</b> records that an error has occurred.
</li>
<li>
<b>XGETUA</b> returns error unit numbers.
</li>
<li>
<b>XSETF</b> sets the error control flag.
</li>
<li>
<b>XSETUN</b> sets the error message output unit.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../f77_src.html">
the FORTRAN77 source codes</a>.
</p>
<hr>
<i>
Last revised on 15 October 2012.
</i>
<!-- John Burkardt -->
</body>
</html>