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,86 @@
|
|
|
1
|
+
module fftpack_c_api
|
|
2
|
+
|
|
3
|
+
use, intrinsic :: iso_c_binding, only: &
|
|
4
|
+
c_double, &
|
|
5
|
+
c_int, &
|
|
6
|
+
c_ptr, &
|
|
7
|
+
c_f_pointer
|
|
8
|
+
use type_PeriodicFastFourierTransform, only: &
|
|
9
|
+
rffti, rfftf, rfftb, &
|
|
10
|
+
sinti, sint, costi, cost, &
|
|
11
|
+
sinqi, sinqf, sinqb, cosqi, cosqf, cosqb, &
|
|
12
|
+
cffti, cfftf, cfftb
|
|
13
|
+
|
|
14
|
+
implicit none
|
|
15
|
+
|
|
16
|
+
contains
|
|
17
|
+
|
|
18
|
+
subroutine pyfp_fftpack_real_transform(n, x_ptr, kind, direction) &
|
|
19
|
+
bind(C, name="pyfp_fftpack_real_transform")
|
|
20
|
+
|
|
21
|
+
integer(c_int), value :: n, kind, direction
|
|
22
|
+
type(c_ptr), value :: x_ptr
|
|
23
|
+
real(c_double), pointer :: x(:)
|
|
24
|
+
real(c_double), allocatable :: wsave(:)
|
|
25
|
+
|
|
26
|
+
call c_f_pointer(x_ptr, x, [n])
|
|
27
|
+
|
|
28
|
+
select case (kind)
|
|
29
|
+
case (0_c_int)
|
|
30
|
+
allocate(wsave(2*n + 15))
|
|
31
|
+
call rffti(n, wsave)
|
|
32
|
+
if (direction == 0_c_int) then
|
|
33
|
+
call rfftf(n, x, wsave)
|
|
34
|
+
else
|
|
35
|
+
call rfftb(n, x, wsave)
|
|
36
|
+
end if
|
|
37
|
+
case (1_c_int)
|
|
38
|
+
allocate(wsave(3*n + 15))
|
|
39
|
+
call sinti(n, wsave)
|
|
40
|
+
call sint(n, x, wsave)
|
|
41
|
+
case (2_c_int)
|
|
42
|
+
allocate(wsave(3*n + 15))
|
|
43
|
+
call costi(n, wsave)
|
|
44
|
+
call cost(n, x, wsave)
|
|
45
|
+
case (3_c_int)
|
|
46
|
+
allocate(wsave(3*n + 15))
|
|
47
|
+
call sinqi(n, wsave)
|
|
48
|
+
if (direction == 0_c_int) then
|
|
49
|
+
call sinqf(n, x, wsave)
|
|
50
|
+
else
|
|
51
|
+
call sinqb(n, x, wsave)
|
|
52
|
+
end if
|
|
53
|
+
case (4_c_int)
|
|
54
|
+
allocate(wsave(3*n + 15))
|
|
55
|
+
call cosqi(n, wsave)
|
|
56
|
+
if (direction == 0_c_int) then
|
|
57
|
+
call cosqf(n, x, wsave)
|
|
58
|
+
else
|
|
59
|
+
call cosqb(n, x, wsave)
|
|
60
|
+
end if
|
|
61
|
+
case default
|
|
62
|
+
return
|
|
63
|
+
end select
|
|
64
|
+
|
|
65
|
+
end subroutine pyfp_fftpack_real_transform
|
|
66
|
+
|
|
67
|
+
subroutine pyfp_fftpack_complex_transform(n, cdata_ptr, direction) &
|
|
68
|
+
bind(C, name="pyfp_fftpack_complex_transform")
|
|
69
|
+
|
|
70
|
+
integer(c_int), value :: n, direction
|
|
71
|
+
type(c_ptr), value :: cdata_ptr
|
|
72
|
+
real(c_double), pointer :: c(:)
|
|
73
|
+
real(c_double), allocatable :: wsave(:)
|
|
74
|
+
|
|
75
|
+
call c_f_pointer(cdata_ptr, c, [2*n])
|
|
76
|
+
allocate(wsave(4*n + 15))
|
|
77
|
+
call cffti(n, wsave)
|
|
78
|
+
if (direction == 0_c_int) then
|
|
79
|
+
call cfftf(n, c, wsave)
|
|
80
|
+
else
|
|
81
|
+
call cfftb(n, c, wsave)
|
|
82
|
+
end if
|
|
83
|
+
|
|
84
|
+
end subroutine pyfp_fftpack_complex_transform
|
|
85
|
+
|
|
86
|
+
end module fftpack_c_api
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
module fishpack
|
|
2
|
+
|
|
3
|
+
use, intrinsic :: ISO_Fortran_env, only: &
|
|
4
|
+
stdout => OUTPUT_UNIT, &
|
|
5
|
+
stderr => ERROR_UNIT
|
|
6
|
+
|
|
7
|
+
use fishpack_precision, only: &
|
|
8
|
+
wp, & ! working precision
|
|
9
|
+
ip, & ! integer precision
|
|
10
|
+
PI, HALF_PI, TWO_PI
|
|
11
|
+
|
|
12
|
+
use real_block_tridiagonal_linear_systems_solver, &
|
|
13
|
+
only: blktri
|
|
14
|
+
|
|
15
|
+
use complex_block_tridiagonal_linear_systems_solver, only: &
|
|
16
|
+
cblktri
|
|
17
|
+
|
|
18
|
+
use complex_linear_systems_solver, only: &
|
|
19
|
+
cmgnbn
|
|
20
|
+
|
|
21
|
+
use centered_real_linear_systems_solver, only: &
|
|
22
|
+
genbun
|
|
23
|
+
|
|
24
|
+
use three_dimensional_solvers, only: &
|
|
25
|
+
pois3d, & ! general_linear_systems_solver_3d
|
|
26
|
+
hw3crt ! centered_cartesian_helmholtz_solver_3d
|
|
27
|
+
|
|
28
|
+
use staggered_real_linear_systems_solver, only: &
|
|
29
|
+
poistg
|
|
30
|
+
|
|
31
|
+
use module_sepeli, only: &
|
|
32
|
+
sepeli
|
|
33
|
+
|
|
34
|
+
use module_sepx4, only: &
|
|
35
|
+
sepx4
|
|
36
|
+
|
|
37
|
+
use staggered_helmholtz_solvers, only: &
|
|
38
|
+
hstcrt, & ! Staggered cartesian solver
|
|
39
|
+
hstplr, & ! Staggered polar solver
|
|
40
|
+
hstcyl, & ! Staggered cylindrical solver
|
|
41
|
+
hstssp, & ! Staggered spherical solver
|
|
42
|
+
hstcsp ! Staggered axisymmetric spherical solver
|
|
43
|
+
|
|
44
|
+
use centered_helmholtz_solvers, only: &
|
|
45
|
+
hwscrt, & ! Centered cartesian solver
|
|
46
|
+
hwsplr, & ! Centered polar solver
|
|
47
|
+
hwscyl, & ! Centered cylindrical solver
|
|
48
|
+
hwsssp, & ! Centered spherical solver
|
|
49
|
+
hwscsp ! Centered axisymmetric spherical solver
|
|
50
|
+
|
|
51
|
+
use type_FishpackWorkspace, only: &
|
|
52
|
+
FishpackWorkspace
|
|
53
|
+
|
|
54
|
+
use type_PeriodicFastFourierTransform, only: &
|
|
55
|
+
PeriodicFastFourierTransform
|
|
56
|
+
|
|
57
|
+
! Explicit typing only
|
|
58
|
+
implicit none
|
|
59
|
+
|
|
60
|
+
! Everything is private unless stated otherwise
|
|
61
|
+
private
|
|
62
|
+
public :: wp, ip
|
|
63
|
+
public :: PI, HALF_PI, TWO_PI
|
|
64
|
+
public :: FishpackWorkspace
|
|
65
|
+
public :: PeriodicFastFourierTransform
|
|
66
|
+
public :: blktri
|
|
67
|
+
public :: cblktri
|
|
68
|
+
public :: cmgnbn
|
|
69
|
+
public :: genbun
|
|
70
|
+
public :: hstcrt
|
|
71
|
+
public :: hstcsp
|
|
72
|
+
public :: hstcyl
|
|
73
|
+
public :: hstplr
|
|
74
|
+
public :: hstssp
|
|
75
|
+
public :: hw3crt
|
|
76
|
+
public :: hwscrt
|
|
77
|
+
public :: hwscsp
|
|
78
|
+
public :: hwscyl
|
|
79
|
+
public :: hwsplr
|
|
80
|
+
public :: hwsssp
|
|
81
|
+
public :: pois3d
|
|
82
|
+
public :: poistg
|
|
83
|
+
public :: sepeli
|
|
84
|
+
public :: sepx4
|
|
85
|
+
public :: check_output, assert_equal
|
|
86
|
+
|
|
87
|
+
interface check_output
|
|
88
|
+
module procedure common_check_output
|
|
89
|
+
module procedure check_output_with_pertrb
|
|
90
|
+
module procedure check_output_with_2nd_and_4th_order_errors
|
|
91
|
+
end interface
|
|
92
|
+
|
|
93
|
+
contains
|
|
94
|
+
|
|
95
|
+
subroutine common_check_output(routine, ierror, input, output)
|
|
96
|
+
|
|
97
|
+
! Dummy arguments
|
|
98
|
+
character(len=*), intent(in) :: routine
|
|
99
|
+
integer(ip), intent(in) :: ierror
|
|
100
|
+
real(wp), intent(in) :: input
|
|
101
|
+
real(wp), intent(in) :: output
|
|
102
|
+
|
|
103
|
+
! Print earlier output from platforms with 64-bit floating point
|
|
104
|
+
! arithmetic followed by the output from this computer
|
|
105
|
+
if (assert_equal(input, output)) then
|
|
106
|
+
write(stdout, '(a)') 'PASS'
|
|
107
|
+
else
|
|
108
|
+
write(stderr, '(a)') '======================================================================'
|
|
109
|
+
write(stderr, '(/a/)') ' ***FAIL: '//routine//' test program***'
|
|
110
|
+
write(stderr, '(a)') ' Previous 64-bit floating point arithmetic result '
|
|
111
|
+
write(stderr, '(a,e23.15e3)') ' ierror = 0, discretization error = ', input
|
|
112
|
+
write(stderr, '(/a)') ' The output from your computer is: '
|
|
113
|
+
write(stderr, '(a,i3,a,e23.15e3/)') ' ierror = ', ierror, ' discretization error = ', output
|
|
114
|
+
write(stderr, '(a)') '======================================================================'
|
|
115
|
+
end if
|
|
116
|
+
|
|
117
|
+
end subroutine common_check_output
|
|
118
|
+
|
|
119
|
+
subroutine check_output_with_pertrb(routine, ierror, &
|
|
120
|
+
input, output, pertrb_in, pertrb_out)
|
|
121
|
+
|
|
122
|
+
! Dummy arguments
|
|
123
|
+
character(len=*), intent(in) :: routine
|
|
124
|
+
integer(ip), intent(in) :: ierror
|
|
125
|
+
real(wp), intent(in) :: input, pertrb_in
|
|
126
|
+
real(wp), intent(in) :: output, pertrb_out
|
|
127
|
+
|
|
128
|
+
! Print earlier output from platforms with 64-bit floating point
|
|
129
|
+
! arithmetic followed by the output from this computer
|
|
130
|
+
if (assert_equal(input, output)) then
|
|
131
|
+
write(stdout, '(a)') 'PASS'
|
|
132
|
+
else
|
|
133
|
+
write(stderr, '(a)') '======================================================================'
|
|
134
|
+
write(stderr, '(/a/)') ' ***FAIL: '//routine//' test program***'
|
|
135
|
+
write(stderr, '(a)') ' Previous 64-bit floating point arithmetic result '
|
|
136
|
+
write(stderr, '(a,e23.15e3)') ' ierror = 0, pertrb = ', pertrb_in
|
|
137
|
+
write(stderr, '(a,e23.15e3)') ' discretization error = ', input
|
|
138
|
+
write(stdout, '(/a)') ' The output from your computer is: '
|
|
139
|
+
write(stdout, '(a,i3,a,e23.15e3)') ' ierror = ', ierror, ', pertrb = ', pertrb_out
|
|
140
|
+
write(stdout, '(a,e23.15e3/)') ' discretization error = ', output
|
|
141
|
+
write(stderr, '(a)') '======================================================================'
|
|
142
|
+
end if
|
|
143
|
+
|
|
144
|
+
end subroutine check_output_with_pertrb
|
|
145
|
+
|
|
146
|
+
subroutine check_output_with_2nd_and_4th_order_errors(routine, &
|
|
147
|
+
ierror2, input2, output2, ierror4, input4, output4)
|
|
148
|
+
|
|
149
|
+
! Dummy arguments
|
|
150
|
+
character(len=*), intent(in) :: routine
|
|
151
|
+
integer(ip), intent(in) :: ierror2, ierror4
|
|
152
|
+
real(wp), intent(in) :: input2, output2, input4, output4
|
|
153
|
+
|
|
154
|
+
! Print earlier output from platforms with 64-bit floating point
|
|
155
|
+
! arithmetic followed by the output from this computer
|
|
156
|
+
if (assert_equal(input2, output2) .and. assert_equal(input4, output4)) then
|
|
157
|
+
write(stdout, '(a)') 'PASS'
|
|
158
|
+
else
|
|
159
|
+
write(stderr, '(a)') '======================================================================'
|
|
160
|
+
write(stderr, '(/a/)') ' ***FAIL: '//routine//' test program***'
|
|
161
|
+
write(stderr, '(a)') ' Previous 64-bit floating point arithmetic result '
|
|
162
|
+
write(stdout, '(a)') ' 2nd-order ierror = 0'
|
|
163
|
+
write(stdout, '(a,e23.15e3)') ' 2nd-order discretization error =', input2
|
|
164
|
+
write(stdout, '(a)') ' 4th-order ierror = 0'
|
|
165
|
+
write(stdout, '(a,e23.15e3/)') ' 4th-order discretization error =', input4
|
|
166
|
+
write(stdout, '(/a)') ' The output from your computer is: '
|
|
167
|
+
write(stdout, '(a,i3)') ' 2nd-order ierror =', ierror2
|
|
168
|
+
write(stdout, '(a,e23.15e3)') ' 2nd-order discretization error =', output2
|
|
169
|
+
write(stdout, '(a,i3)') ' 4th-order ierror =', ierror4
|
|
170
|
+
write(stdout, '(a,e23.15e3/)') ' 4th-order discretization error =', output4
|
|
171
|
+
write(stderr, '(a)') '======================================================================'
|
|
172
|
+
end if
|
|
173
|
+
|
|
174
|
+
end subroutine check_output_with_2nd_and_4th_order_errors
|
|
175
|
+
|
|
176
|
+
pure function assert_equal(first, second) &
|
|
177
|
+
result(return_value)
|
|
178
|
+
|
|
179
|
+
! Dummy arguments
|
|
180
|
+
real(wp), intent(in) :: first
|
|
181
|
+
real(wp), intent(in) :: second
|
|
182
|
+
logical :: return_value
|
|
183
|
+
|
|
184
|
+
! Local variables
|
|
185
|
+
real(wp), parameter :: ZERO = 0.0_wp
|
|
186
|
+
|
|
187
|
+
return_value = (abs(first - second) > ZERO)
|
|
188
|
+
|
|
189
|
+
end function assert_equal
|
|
190
|
+
|
|
191
|
+
end module fishpack
|