10 #include "sll_working_precision.h"
11 #include "sll_errors.h"
27 sll_int32 :: n_dofs(2)
29 sll_real64 :: factor = 1.0_f64
31 sll_real64,
allocatable :: eig_values_1(:)
32 sll_real64,
allocatable :: eig_values_2(:)
56 sll_int32,
intent( in ) :: n_dofs(2)
57 sll_real64,
intent( in ) :: eig_values_1(:)
58 sll_real64,
intent( in ) :: eig_values_2(:)
60 sll_comp64 :: array1d_x(n_dofs(1)), array1d_y(n_dofs(2))
64 allocate(self%eig_values_1(n_dofs(1)))
65 self%eig_values_1 = eig_values_1
66 allocate(self%eig_values_2(n_dofs(2)))
67 self%eig_values_2 = eig_values_2
80 real(kind=f64),
intent(in ) :: rhs(:)
81 real(kind=f64),
intent( out) :: unknown(:)
83 sll_int32 :: ind, i, j, n_dofs(2)
84 sll_comp64 :: scratch(self%n_dofs(1), self%n_dofs(2))
85 sll_comp64 :: array1d_x(self%n_dofs(1)), array1d_y(self%n_dofs(2))
95 array1d_x(i) = cmplx( rhs(ind), 0_f64, kind=f64)
99 scratch(i,j) = array1d_x(i)
106 array1d_y(j) = scratch(i,j)
110 scratch(i,j) = array1d_y(j)
119 scratch(i,j) = scratch(i,j)/ &
120 cmplx(self%eig_values_1(i)* &
121 self%eig_values_2(j)* &
122 self%factor, 0.0_f64, f64)
133 array1d_y(j) = scratch(i,j)
137 scratch(i,j) = array1d_y(j)
146 array1d_x(i) = scratch(i,j)
152 unknown(ind) = real( array1d_x(i), kind=f64 )
164 complex(kind=f64),
intent(in ) :: rhs(:)
165 complex(kind=f64),
intent( out) :: unknown(:)
167 sll_error(
'solve_complex',
'Procedure not implemented.')
173 character(len=*),
intent( in ) :: filename
184 logical,
intent( in ) :: verbose
186 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 (2d version)
subroutine print_info_mass1(self)
subroutine read_from_file_mass1(self, filename)
subroutine solve_complex_mass1(self, rhs, unknown)
subroutine solve_real_mass1(self, rhs, unknown)
subroutine set_verbose_mass1(self, verbose)
subroutine create_mass1(self, n_dofs, eig_values_1, eig_values_2)
subroutine free_mass1(self)
Type for FFT plan in SeLaLib.
class for abstract linear solver
Data type for a linear solver inverting a 2d tensor product of circulant matrices based on FFT.