12 #include "sll_assert.h"
13 #include "sll_memory.h"
14 #include "sll_working_precision.h"
36 sll_real64 :: delta_x(3)
37 sll_int32 :: n_dofs0(3)
38 sll_int32 :: n_dofs1(3)
39 sll_int32 :: s_deg_0(3)
40 sll_int32 :: s_deg_1(3)
45 sll_real64,
allocatable :: mass_line0_1(:)
46 sll_real64,
allocatable :: mass_line0_2(:)
47 sll_real64,
allocatable :: mass_line0_3(:)
48 sll_real64,
allocatable :: mass_line1_1(:)
49 sll_real64,
allocatable :: mass_line1_2(:)
50 sll_real64,
allocatable :: mass_line1_3(:)
67 sll_real64,
intent( in ) :: lx(3)
68 sll_int32,
intent( in ) :: n_cells(3)
69 sll_int32,
intent( in ) :: s_deg_0(3)
70 logical,
optional :: clamped
74 sll_real64,
allocatable :: eig_values_mass_0_1(:)
75 sll_real64,
allocatable :: eig_values_mass_0_2(:)
76 sll_real64,
allocatable :: eig_values_mass_0_3(:)
77 sll_real64,
allocatable :: eig_values_mass_1_1(:)
78 sll_real64,
allocatable :: eig_values_mass_1_2(:)
79 sll_real64,
allocatable :: eig_values_mass_1_3(:)
82 self%delta_x = lx / real(n_cells,f64)
83 self%s_deg_0 = s_deg_0
84 self%s_deg_1 = s_deg_0 - 1
85 self%n_dofs0 = n_cells
86 self%n_dofs1 = n_cells
88 if(
present(clamped) )
then
90 self%n_dofs0(1) = n_cells(1)+self%s_deg_0(1)
91 self%n_dofs1(1) = n_cells(1)+self%s_deg_1(1)
95 allocate( self%mass_line0_1(s_deg_0(1)+1) )
96 allocate( self%mass_line1_1(s_deg_0(1)) )
97 allocate( self%mass_line0_2(s_deg_0(2)+1) )
98 allocate( self%mass_line1_2(s_deg_0(2)) )
99 allocate( self%mass_line0_3(s_deg_0(3)+1) )
100 allocate( self%mass_line1_3(s_deg_0(3)) )
110 self%mass_line0_1 = self%delta_x(1) * self%mass_line0_1
111 self%mass_line1_1 = self%delta_x(1) * self%mass_line1_1
113 self%mass_line0_2 = self%delta_x(2) * self%mass_line0_2
114 self%mass_line1_2 = self%delta_x(2) * self%mass_line1_2
116 self%mass_line0_3 = self%delta_x(3) * self%mass_line0_3
117 self%mass_line1_3 = self%delta_x(3) * self%mass_line1_3
119 allocate( eig_values_mass_0_1( self%n_dofs0(1) ) )
120 allocate( eig_values_mass_0_2( self%n_dofs0(2) ) )
121 allocate( eig_values_mass_0_3( self%n_dofs0(3) ) )
122 allocate( eig_values_mass_1_1( self%n_dofs1(1) ) )
123 allocate( eig_values_mass_1_2( self%n_dofs1(2) ) )
124 allocate( eig_values_mass_1_3( self%n_dofs1(3) ) )
127 eig_values_mass_0_1 )
129 eig_values_mass_0_2 )
131 eig_values_mass_0_3 )
133 eig_values_mass_1_1 )
135 eig_values_mass_1_2 )
137 eig_values_mass_1_3 )
139 eig_values_mass_0_1 = 1._f64/eig_values_mass_0_1
140 eig_values_mass_0_2 = 1._f64/eig_values_mass_0_2
141 eig_values_mass_0_3 = 1._f64/eig_values_mass_0_3
142 eig_values_mass_1_1 = 1._f64/eig_values_mass_1_1
143 eig_values_mass_1_2 = 1._f64/eig_values_mass_1_2
144 eig_values_mass_1_3 = 1._f64/eig_values_mass_1_3
146 call self%inverse_mass1_1d(1)%create( self%n_dofs1, eig_values_mass_1_1, eig_values_mass_0_2, eig_values_mass_0_3 )
147 call self%inverse_mass1_1d(2)%create( self%n_dofs0, eig_values_mass_0_1, eig_values_mass_1_2, eig_values_mass_0_3 )
148 call self%inverse_mass1_1d(3)%create( self%n_dofs0, eig_values_mass_0_1, eig_values_mass_0_2, eig_values_mass_1_3 )
150 call self%inverse_mass2_1d(1)%create( self%n_dofs0, eig_values_mass_0_1, eig_values_mass_1_2, eig_values_mass_1_3 )
151 call self%inverse_mass2_1d(2)%create( self%n_dofs1, eig_values_mass_1_1, eig_values_mass_0_2, eig_values_mass_1_3 )
152 call self%inverse_mass2_1d(3)%create( self%n_dofs1, eig_values_mass_1_1, eig_values_mass_1_2, eig_values_mass_0_3 )
154 call self%inverse_mass1_3d%create( 3, 3 )
155 call self%inverse_mass2_3d%create( 3, 3 )
157 call self%inverse_mass1_3d%set( j, j, self%inverse_mass1_1d(j) )
158 call self%inverse_mass2_3d%set( j, j, self%inverse_mass2_1d(j) )
172 call self%inverse_mass1_1d(j)%free()
173 call self%inverse_mass2_1d(j)%free()
176 call self%inverse_mass1_3d%free()
177 call self%inverse_mass2_3d%free()
module for a block linear solver
Invert a circulant matrix based on diagonalization in Fourier space (3d version)
Module interface to solve Maxwell's equations with coordinate transformation in 3D The linear systems...
subroutine init_3d_trafo(self, Lx, n_cells, s_deg_0, clamped)
subroutine free_3d_trafo(self)
Utilites for Maxwell solver's with spline finite elements.
subroutine, public sll_s_spline_fem_mass_line(degree, mass_line)
Computes the mass line for a mass matrix with degree splines.
subroutine, public sll_s_spline_fem_compute_mass_eig(n_cells, degree, mass_line, eig_values_mass)
Compute eigenvalues of mass matrix with given line mass_line.
class for a linear solver_block
Linear solver for FFT-based inversion of 3d tensor product of circulant matrices (extending the abstr...