PyFishPack 0.1.0__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PyFishPack/__init__.py +86 -0
- PyFishPack/__pycache__/__init__.cpython-313.pyc +0 -0
- PyFishPack/__pycache__/apps.cpython-313.pyc +0 -0
- PyFishPack/_dummy.c +23 -0
- PyFishPack/_dummy.cp313-win_amd64.pyd +0 -0
- PyFishPack/apps.py +3640 -0
- PyFishPack/fishpack.cp313-win_amd64.dll.a +0 -0
- PyFishPack/fishpack.cp313-win_amd64.pyd +0 -0
- PyFishPack/meson.build +213 -0
- PyFishPack/src/archive/f77/Makefile +19 -0
- PyFishPack/src/archive/f77/blktri.f +1404 -0
- PyFishPack/src/archive/f77/cblktri.f +1414 -0
- PyFishPack/src/archive/f77/cmgnbn.f +1592 -0
- PyFishPack/src/archive/f77/comf.f +186 -0
- PyFishPack/src/archive/f77/fftpack.f +2968 -0
- PyFishPack/src/archive/f77/genbun.f +1335 -0
- PyFishPack/src/archive/f77/gnbnaux.f +314 -0
- PyFishPack/src/archive/f77/hstcrt.f +443 -0
- PyFishPack/src/archive/f77/hstcsp.f +683 -0
- PyFishPack/src/archive/f77/hstcyl.f +485 -0
- PyFishPack/src/archive/f77/hstplr.f +538 -0
- PyFishPack/src/archive/f77/hstssp.f +634 -0
- PyFishPack/src/archive/f77/hw3crt.f +687 -0
- PyFishPack/src/archive/f77/hwscrt.f +512 -0
- PyFishPack/src/archive/f77/hwscsp.f +728 -0
- PyFishPack/src/archive/f77/hwscyl.f +538 -0
- PyFishPack/src/archive/f77/hwsplr.f +602 -0
- PyFishPack/src/archive/f77/hwsssp.f +780 -0
- PyFishPack/src/archive/f77/pois3d.f +550 -0
- PyFishPack/src/archive/f77/poistg.f +875 -0
- PyFishPack/src/archive/f77/sepaux.f +361 -0
- PyFishPack/src/archive/f77/sepeli.f +1029 -0
- PyFishPack/src/archive/f77/sepx4.f +958 -0
- PyFishPack/src/centered_axisymmetric_spherical_solver.f90 +1002 -0
- PyFishPack/src/centered_cartesian_helmholtz_solver_3d.f90 +819 -0
- PyFishPack/src/centered_cartesian_solver.f90 +583 -0
- PyFishPack/src/centered_cylindrical_solver.f90 +634 -0
- PyFishPack/src/centered_helmholtz_solvers.f90 +156 -0
- PyFishPack/src/centered_polar_solver.f90 +746 -0
- PyFishPack/src/centered_real_linear_systems_solver.f90 +280 -0
- PyFishPack/src/centered_spherical_solver.f90 +928 -0
- PyFishPack/src/complex_block_tridiagonal_linear_systems_solver.f90 +1947 -0
- PyFishPack/src/complex_linear_systems_solver.f90 +1787 -0
- PyFishPack/src/fftpack_c_api.f90 +86 -0
- PyFishPack/src/fishpack.f90 +191 -0
- PyFishPack/src/fishpack.pyf +504 -0
- PyFishPack/src/fishpack_c_api.f90 +365 -0
- PyFishPack/src/fishpack_original.pyf +2119 -0
- PyFishPack/src/fishpack_precision.f90 +53 -0
- PyFishPack/src/general_linear_systems_solver_3d.f90 +296 -0
- PyFishPack/src/iterative_solvers.f90 +969 -0
- PyFishPack/src/main.f90 +10 -0
- PyFishPack/src/pyfishpack_module.c +1302 -0
- PyFishPack/src/real_block_tridiagonal_linear_systems_solver.f90 +319 -0
- PyFishPack/src/sepeli.f90 +1454 -0
- PyFishPack/src/sepx4.f90 +1338 -0
- PyFishPack/src/staggered_axisymmetric_spherical_solver.f90 +908 -0
- PyFishPack/src/staggered_cartesian_solver.f90 +553 -0
- PyFishPack/src/staggered_cylindrical_solver.f90 +630 -0
- PyFishPack/src/staggered_helmholtz_solvers.f90 +172 -0
- PyFishPack/src/staggered_polar_solver.f90 +651 -0
- PyFishPack/src/staggered_real_linear_systems_solver.f90 +258 -0
- PyFishPack/src/staggered_spherical_solver.f90 +758 -0
- PyFishPack/src/three_dimensional_solvers.f90 +602 -0
- PyFishPack/src/type_CenteredCyclicReductionUtility.f90 +1714 -0
- PyFishPack/src/type_CyclicReductionUtility.f90 +472 -0
- PyFishPack/src/type_FishpackWorkspace.f90 +290 -0
- PyFishPack/src/type_GeneralizedCyclicReductionUtility.f90 +1980 -0
- PyFishPack/src/type_PeriodicFastFourierTransform.f90 +3789 -0
- PyFishPack/src/type_SepAux.f90 +586 -0
- PyFishPack/src/type_StaggeredCyclicReductionUtility.f90 +893 -0
- pyfishpack-0.1.0.dist-info/DELVEWHEEL +2 -0
- pyfishpack-0.1.0.dist-info/METADATA +81 -0
- pyfishpack-0.1.0.dist-info/RECORD +81 -0
- pyfishpack-0.1.0.dist-info/WHEEL +5 -0
- pyfishpack-0.1.0.dist-info/licenses/LICENSE +21 -0
- pyfishpack-0.1.0.dist-info/top_level.txt +1 -0
- pyfishpack.libs/libgcc_s_seh-1-25d59ccffa1a9009644065b069829e07.dll +0 -0
- pyfishpack.libs/libgfortran-5-08f2195cfa0d823e13371c5c3186a82a.dll +0 -0
- pyfishpack.libs/libquadmath-0-c5abb9113f1ee64b87a889958e4b7418.dll +0 -0
- pyfishpack.libs/libwinpthread-1-83908d14abfafb8b3bfa38cf51ecee56.dll +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
!
|
|
2
|
+
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
3
|
+
! * *
|
|
4
|
+
! * copyright (c) 2005 by UCAR *
|
|
5
|
+
! * *
|
|
6
|
+
! * University Corporation for Atmospheric Research *
|
|
7
|
+
! * *
|
|
8
|
+
! * all rights reserved *
|
|
9
|
+
! * *
|
|
10
|
+
! * Fishpack *
|
|
11
|
+
! * *
|
|
12
|
+
! * A Package of Fortran *
|
|
13
|
+
! * *
|
|
14
|
+
! * Subroutines and Example Programs *
|
|
15
|
+
! * *
|
|
16
|
+
! * for Modeling Geophysical Processes *
|
|
17
|
+
! * *
|
|
18
|
+
! * by *
|
|
19
|
+
! * *
|
|
20
|
+
! * John Adams, Paul Swarztrauber and Roland Sweet *
|
|
21
|
+
! * *
|
|
22
|
+
! * of *
|
|
23
|
+
! * *
|
|
24
|
+
! * the National Center for Atmospheric Research *
|
|
25
|
+
! * *
|
|
26
|
+
! * Boulder, Colorado (80307) U.S.A. *
|
|
27
|
+
! * *
|
|
28
|
+
! * which is sponsored by *
|
|
29
|
+
! * *
|
|
30
|
+
! * the National Science Foundation *
|
|
31
|
+
! * *
|
|
32
|
+
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
33
|
+
!
|
|
34
|
+
module staggered_real_linear_systems_solver
|
|
35
|
+
|
|
36
|
+
use fishpack_precision, only: &
|
|
37
|
+
wp, & ! Working precision
|
|
38
|
+
ip ! Integer precision
|
|
39
|
+
|
|
40
|
+
use type_FishpackWorkspace, only: &
|
|
41
|
+
FishpackWorkspace
|
|
42
|
+
|
|
43
|
+
use type_StaggeredCyclicReductionUtility, only: &
|
|
44
|
+
StaggeredCyclicReductionUtility
|
|
45
|
+
|
|
46
|
+
! Explicit typing only
|
|
47
|
+
implicit none
|
|
48
|
+
|
|
49
|
+
! Everything is private unless stated otherwise
|
|
50
|
+
private
|
|
51
|
+
public :: poistg
|
|
52
|
+
|
|
53
|
+
! Parameters confined to the module
|
|
54
|
+
real(wp), parameter :: TWO = 2.0_wp
|
|
55
|
+
real(wp), parameter :: LOG_TWO = log(TWO)
|
|
56
|
+
|
|
57
|
+
contains
|
|
58
|
+
|
|
59
|
+
! SUBROUTINE poistg(nperod, n, mperod, m, a, b, c, idimy, y, ierror)
|
|
60
|
+
!
|
|
61
|
+
!
|
|
62
|
+
! DIMENSION OF a(m), b(m), c(m), y(idimy, n)
|
|
63
|
+
! ARGUMENTS
|
|
64
|
+
!
|
|
65
|
+
! PURPOSE Solves the linear system of equations
|
|
66
|
+
! for unknown x values, where i=1, 2, ..., m
|
|
67
|
+
! and j=1, 2, ..., n
|
|
68
|
+
!
|
|
69
|
+
! a(i)*x(i-1, j) + b(i)*x(i, j) + c(i)*x(i+1, j)
|
|
70
|
+
! + x(i, j-1) - TWO *x(i, j) + x(i, j+1)
|
|
71
|
+
! = y(i, j)
|
|
72
|
+
!
|
|
73
|
+
! The indices i+1 and i-1 are evaluated modulo m,
|
|
74
|
+
! i.e. x(0, j) = x(m, j) and x(m+1, j) = x(1, j), and
|
|
75
|
+
! x(i, 0) may be equal to x(i, 1) or -x(i, 1), and
|
|
76
|
+
! x(i, n+1) may be equal to x(i, n) or -x(i, n),
|
|
77
|
+
! depending on an input parameter.
|
|
78
|
+
!
|
|
79
|
+
! USAGE call poistg(nperod, n, mperod, m, a, b, c, idimy, y, ierror)
|
|
80
|
+
!
|
|
81
|
+
! ARGUMENTS
|
|
82
|
+
! ON INPUT
|
|
83
|
+
!
|
|
84
|
+
! nperod
|
|
85
|
+
! Indicates values which x(i, 0) and x(i, n+1)
|
|
86
|
+
! are assumed to have.
|
|
87
|
+
! = 1 if x(i, 0) = -x(i, 1) and x(i, n+1) = -x(i, n
|
|
88
|
+
! = 2 if x(i, 0) = -x(i, 1) and x(i, n+1) = x(i, n
|
|
89
|
+
! = 3 if x(i, 0) = x(i, 1) and x(i, n+1) = x(i, n
|
|
90
|
+
! = 4 if x(i, 0) = x(i, 1) and x(i, n+1) = -x(i, n
|
|
91
|
+
!
|
|
92
|
+
! n
|
|
93
|
+
! the number of unknowns in the j-direction.
|
|
94
|
+
! n must be greater than 2.
|
|
95
|
+
!
|
|
96
|
+
! mperod
|
|
97
|
+
! = 0 if a(1) and c(m) are not zero
|
|
98
|
+
! = 1 if a(1) = c(m) = 0
|
|
99
|
+
!
|
|
100
|
+
! m
|
|
101
|
+
! the number of unknowns in the i-direction.
|
|
102
|
+
! m must be greater than 2.
|
|
103
|
+
!
|
|
104
|
+
! a, b, c
|
|
105
|
+
! One-dimensional arrays of length m that
|
|
106
|
+
! specify the coefficients in the linear
|
|
107
|
+
! equations given above. If mperod = 0 the
|
|
108
|
+
! array elements must not depend on index i,
|
|
109
|
+
! but must be constant. Specifically, the
|
|
110
|
+
! subroutine checks the following condition
|
|
111
|
+
! a(i) = c(1)
|
|
112
|
+
! b(i) = b(1)
|
|
113
|
+
! c(i) = c(1)
|
|
114
|
+
! for i = 1, 2, ..., m.
|
|
115
|
+
!
|
|
116
|
+
! idimy
|
|
117
|
+
! The row (or first) dimension of the two-
|
|
118
|
+
! dimensional array y as it appears in the
|
|
119
|
+
! program calling poistg. This parameter is
|
|
120
|
+
! used to specify the variable dimension of y.
|
|
121
|
+
! idimy must be at least m.
|
|
122
|
+
!
|
|
123
|
+
! y
|
|
124
|
+
! A two-dimensional array that specifies the
|
|
125
|
+
! values of the right side of the linear system
|
|
126
|
+
! of equations given above.
|
|
127
|
+
! y must be dimensioned at least m x n.
|
|
128
|
+
!
|
|
129
|
+
! ON OUTPUT
|
|
130
|
+
!
|
|
131
|
+
! Y
|
|
132
|
+
! Contains the solution x.
|
|
133
|
+
!
|
|
134
|
+
! ierror
|
|
135
|
+
! An error flag that indicates invalid input
|
|
136
|
+
! parameters. except for number zero, a
|
|
137
|
+
! solution is not attempted.
|
|
138
|
+
! = 0 no error
|
|
139
|
+
! = 1 if m <= 2
|
|
140
|
+
! = 2 if n <= 2
|
|
141
|
+
! = 3 idimy < m
|
|
142
|
+
! = 4 if nperod < 1 or nperod > 4
|
|
143
|
+
! = 5 if mperod < 0 or mperod > 1
|
|
144
|
+
! = 6 if mperod = 0 and a(i) /= c(1)
|
|
145
|
+
! or b(i) /= b(1) or c(i) /= c(1)
|
|
146
|
+
! for some i = 1, 2, ..., m.
|
|
147
|
+
! = 7 if mperod == 1 and (a(1)/= 0 or c(m)/= 0)
|
|
148
|
+
! = 20 If the dynamic allocation of real and
|
|
149
|
+
! complex workspace required for solution
|
|
150
|
+
! fails (for example if n, m are too large
|
|
151
|
+
! for your computer)
|
|
152
|
+
!
|
|
153
|
+
! Since this is the only means of indicating a
|
|
154
|
+
! possibly incorrect call to pois3d, the user
|
|
155
|
+
! should test ierror after the call.
|
|
156
|
+
!
|
|
157
|
+
!
|
|
158
|
+
! HISTORY Written by Roland Sweet at NCAR in the late
|
|
159
|
+
! 1970's. Released on NCAR'S public software
|
|
160
|
+
! libraries in January, 1980.
|
|
161
|
+
! Revised in June 2004 by John Adams using
|
|
162
|
+
! Fortran 90 dynamically allocated workspace.
|
|
163
|
+
!
|
|
164
|
+
!
|
|
165
|
+
! ALGORITHM This subroutine is an implementation of the
|
|
166
|
+
! algorithm presented in the reference below.
|
|
167
|
+
!
|
|
168
|
+
! TIMING For large m and n, the execution time is
|
|
169
|
+
! roughly proportional to m*n*log2(n).
|
|
170
|
+
!
|
|
171
|
+
! ACCURACY To measure the accuracy of the algorithm a
|
|
172
|
+
! uniform random number generator was used to
|
|
173
|
+
! create a solution array x for the system given
|
|
174
|
+
! in the 'purpose' section above, with
|
|
175
|
+
!
|
|
176
|
+
! a(i) = c(i) = -HALF * b(i) = 1, i=1, 2, ..., m
|
|
177
|
+
! and, when mperod = 1
|
|
178
|
+
! a(1) = c(m) = 0
|
|
179
|
+
! b(1) = b(m) =-1.
|
|
180
|
+
!
|
|
181
|
+
! The solution x was substituted into the given
|
|
182
|
+
! system and, using double precision, a right sid
|
|
183
|
+
! y was computed. using this array y subroutine
|
|
184
|
+
! poistg was called to produce an approximate
|
|
185
|
+
! solution z. then the relative error, defined a
|
|
186
|
+
!
|
|
187
|
+
! e = max(abs(z(i, j)-x(i, j)))/max(abs(x(i, j)))
|
|
188
|
+
!
|
|
189
|
+
! where the two maxima are taken over i=1, 2, ..., m
|
|
190
|
+
! and j=1, 2, ..., n, was computed. values of e are
|
|
191
|
+
! given in the table below for some typical value
|
|
192
|
+
! of m and n.
|
|
193
|
+
!
|
|
194
|
+
! m (=n) mperod nperod e
|
|
195
|
+
! ------ ------ ------ ------
|
|
196
|
+
!
|
|
197
|
+
! 31 0-1 1-4 9.e-13
|
|
198
|
+
! 31 1 1 4.e-13
|
|
199
|
+
! 31 1 3 3.e-13
|
|
200
|
+
! 32 0-1 1-4 3.e-12
|
|
201
|
+
! 32 1 1 3.e-13
|
|
202
|
+
! 32 1 3 1.e-13
|
|
203
|
+
! 33 0-1 1-4 1.e-12
|
|
204
|
+
! 33 1 1 4.e-13
|
|
205
|
+
! 33 1 3 1.e-13
|
|
206
|
+
! 63 0-1 1-4 3.e-12
|
|
207
|
+
! 63 1 1 1.e-12
|
|
208
|
+
! 63 1 3 2.e-13
|
|
209
|
+
! 64 0-1 1-4 4.e-12
|
|
210
|
+
! 64 1 1 1.e-12
|
|
211
|
+
! 64 1 3 6.e-13
|
|
212
|
+
! 65 0-1 1-4 2.e-13
|
|
213
|
+
! 65 1 1 1.e-11
|
|
214
|
+
! 65 1 3 4.e-13
|
|
215
|
+
!
|
|
216
|
+
! REFERENCES Schumann, U. and R. Sweet, "A direct method
|
|
217
|
+
! for the solution of Poisson's equation with
|
|
218
|
+
! Neumann boundary conditions on a staggered
|
|
219
|
+
! grid of arbitrary size, " J. Comp. Phys.
|
|
220
|
+
! 20 (1976), pp. 171-182.
|
|
221
|
+
!
|
|
222
|
+
subroutine poistg(nperod, n, mperod, m, a, b, c, idimy, y, ierror)
|
|
223
|
+
|
|
224
|
+
! Dummy arguments
|
|
225
|
+
integer(ip), intent(in) :: nperod
|
|
226
|
+
integer(ip), intent(in) :: n
|
|
227
|
+
integer(ip), intent(in) :: mperod
|
|
228
|
+
integer(ip), intent(in) :: m
|
|
229
|
+
integer(ip), intent(in) :: idimy
|
|
230
|
+
integer(ip), intent(out) :: ierror
|
|
231
|
+
real(wp), intent(in) :: a(:)
|
|
232
|
+
real(wp), intent(in) :: b(:)
|
|
233
|
+
real(wp), intent(in) :: c(:)
|
|
234
|
+
real(wp), intent(inout) :: y(:,:)
|
|
235
|
+
|
|
236
|
+
! Local variables
|
|
237
|
+
integer(ip) :: irwk, icwk
|
|
238
|
+
type(FishpackWorkspace) :: workspace
|
|
239
|
+
type(StaggeredCyclicReductionUtility) :: util
|
|
240
|
+
|
|
241
|
+
! Compute workspace dimensions
|
|
242
|
+
irwk = m * (9 + int(log(real(n, kind=wp))/LOG_TWO,kind=ip)) + 4 * n
|
|
243
|
+
icwk = 0
|
|
244
|
+
|
|
245
|
+
! Allocate memory
|
|
246
|
+
call workspace%create(irwk, icwk)
|
|
247
|
+
|
|
248
|
+
! Solve system
|
|
249
|
+
associate( rew => workspace%real_workspace )
|
|
250
|
+
call util%poistg_lower_routine(nperod, n, mperod, m, a, b, c, idimy, y, ierror, rew)
|
|
251
|
+
end associate
|
|
252
|
+
|
|
253
|
+
! Release memory
|
|
254
|
+
call workspace%destroy()
|
|
255
|
+
|
|
256
|
+
end subroutine poistg
|
|
257
|
+
|
|
258
|
+
end module staggered_real_linear_systems_solver
|