11 #include "sll_working_precision.h"
12 #include "sll_errors.h"
28 sll_int32 :: n_dofs(3)
30 sll_real64 :: factor = 1.0_f64
32 sll_real64,
allocatable :: inv_eig_values_1(:)
33 sll_real64,
allocatable :: inv_eig_values_2(:)
34 sll_real64,
allocatable :: inv_eig_values_3(:)
56 subroutine create_mass1( self, n_dofs, inv_eig_values_1, inv_eig_values_2, inv_eig_values_3)
58 sll_int32,
intent( in ) :: n_dofs(3)
59 sll_real64,
intent( in ) :: inv_eig_values_1(:)
60 sll_real64,
intent( in ) :: inv_eig_values_2(:)
61 sll_real64,
intent( in ) :: inv_eig_values_3(:)
63 sll_comp64 :: array1d_x(n_dofs(1)), array1d_y(n_dofs(2)), array1d_z(n_dofs(3))
66 self%n_global_rows = product( n_dofs)
67 self%n_global_cols = self%n_global_rows
69 allocate(self%inv_eig_values_1(n_dofs(1)))
70 self%inv_eig_values_1 = inv_eig_values_1
71 allocate(self%inv_eig_values_2(n_dofs(2)))
72 self%inv_eig_values_2 = inv_eig_values_2
73 allocate(self%inv_eig_values_3(n_dofs(3)))
74 self%inv_eig_values_3 = inv_eig_values_3
90 real(kind=f64),
intent(in ) :: rhs(:)
91 real(kind=f64),
intent( out ) :: unknown(:)
93 sll_int32 :: ind, i, j, k, n_dofs(3)
94 sll_comp64 :: scratch(self%n_dofs(1), self%n_dofs(2), self%n_dofs(3))
95 sll_comp64 :: array1d_x(self%n_dofs(1)), array1d_y(self%n_dofs(2)), array1d_z(self%n_dofs(3))
105 array1d_x(i) = cmplx( rhs(ind), 0_f64, kind=f64)
109 scratch(i,j,k) = array1d_x(i)
116 array1d_y(j) = scratch(i,j,k)
120 scratch(i,j,k) = array1d_y(j)
127 array1d_z(k) = scratch(i,j,k)
131 scratch(i,j,k) = array1d_z(k)
141 scratch(i,j,k) = scratch(i,j,k)* &
142 cmplx(self%inv_eig_values_1(i)* &
143 self%inv_eig_values_2(j)* &
144 self%inv_eig_values_3(k) /self%factor, 0.0_f64, f64)
155 array1d_z(k) = scratch(i,j,k)
159 scratch(i,j,k) = array1d_z(k)
167 array1d_y(j) = scratch(i,j,k)
171 scratch(i,j,k) = array1d_y(j)
180 array1d_x(i) = scratch(i,j,k)
186 unknown(ind) = real( array1d_x(i), kind=f64 )
195 character(len=*),
intent( in ) :: filename
206 logical,
intent( in ) :: verbose
208 self%verbose = verbose
integer, parameter, public sll_p_fft_forward
Flag to specify forward FFT (negative sign) [value -1].
subroutine, public sll_s_fft_exec_c2c_1d(plan, array_in, array_out)
Compute fast Fourier transform in complex to complex mode.
subroutine, public sll_s_fft_init_c2c_1d(plan, nx, array_in, array_out, direction, normalized, aligned, optimization)
Create new 1d complex to complex plan.
integer, parameter, public sll_p_fft_backward
Flag to specify backward FFT (positive sign) [value 1].
module for abstract linear solver
Invert a circulant matrix based on diagonalization in Fourier space (3d version)
subroutine free_mass1(self)
subroutine create_mass1(self, n_dofs, inv_eig_values_1, inv_eig_values_2, inv_eig_values_3)
subroutine print_info_mass1(self)
subroutine read_from_file_mass1(self, filename)
subroutine set_verbose_mass1(self, verbose)
subroutine solve_real_mass1(self, rhs, unknown)
Type for FFT plan in SeLaLib.
class for abstract linear solver
Linear solver for FFT-based inversion of 3d tensor product of circulant matrices (extending the abstr...