Initialize a object for SIAC filter.
88 implicit none
89 class(SIAC_filter), intent(inout) :: this
90 integer, intent(in) :: r
91 integer, intent(in) :: l
92 real(RP), intent(in) :: x_pts_per_elem(:)
93 class(LineElement), intent(in) :: elem1D
94
95 integer :: i
96 integer :: p
97 integer :: m
98
99 real(RP), allocatable :: IntrpMat_dummy(:,:)
100 real(RP) :: x0, x1, x2
101 real(RP), allocatable :: int_x_tmp(:)
102
103 real(RP), allocatable :: P1D_ori(:,:)
104
105
106 this%spline_r = r
107 this%spline_num = r + 1
108 this%spline_ord = l
109
110 this%KernelHalfW = ceiling(0.5_rp * real(r+l,kind=rp))
111
112 this%Npts_per_elem = size(x_pts_per_elem)
113
114
115 allocate( this%x_pts_per_elem(this%Npts_per_elem) )
116 this%x_pts_per_elem(:) = x_pts_per_elem(:)
117
118 this%NintGLPt = ceiling( ( r + l ) / 2.0_rp )
119 allocate( intrpmat_dummy(this%NintGLPt,elem1d%Np) )
120 allocate( this%int_x(this%NintGLPt), this%int_w(this%NintGLPt) )
121
122 intrpmat_dummy(:,:) = elem1d%GenIntGaussLegendreIntrpMat( this%NintGLPt, this%int_w, this%int_x )
123
124 allocate( this%IntrpMat(this%NintGLPt,elem1d%Np,2,this%Npts_per_elem) )
125 allocate( int_x_tmp(this%NintGLPt) )
126 allocate( p1d_ori(this%NintGLPt,elem1d%Np) )
127 do i=1, this%Npts_per_elem
128 x0 = - 1.0_rp; x2 = 1.0_rp
129 x1 = x_pts_per_elem(i)
130
131 int_x_tmp(:) = x0 + 0.5_rp * (x1 - x0) * ( 1.0_rp + this%int_x(:) )
133 do p=1, elem1d%Np
134 p1d_ori(:,p) = p1d_ori(:,p) * sqrt(real(p-1,kind=rp) + 0.5_rp)
135 end do
136 this%IntrpMat(:,:,1,i) = matmul( p1d_ori, elem1d%invV )
137
138
139 int_x_tmp(:) = x1 + 0.5_rp * (x2 - x1) * ( 1.0_rp + this%int_x(:) )
141 do p=1, elem1d%Np
142 p1d_ori(:,p) = p1d_ori(:,p) * sqrt(real(p-1,kind=rp) + 0.5_rp)
143 end do
144 this%IntrpMat(:,:,2,i) = matmul( p1d_ori, elem1d%invV )
145
146 end do
147
148
149 allocate( this%kernel_func_coef(0:r) )
150 call calculate_kernel_func_coef( this%kernel_func_coef, &
151 r, l, this%int_x, this%int_w, this%NintGLPt )
152
153 allocate( this%kernel_func(this%NintGLPt,2,-this%KernelHalfW:this%KernelHalfW,this%Npts_per_elem) )
154
155 do i=1, this%Npts_per_elem
156 call construct_kernel_func( this%kernel_func(:,:,:,i), &
157 r, l, this%kernel_func_coef, this%KernelHalfW, &
158 this%int_x, this%NintGLPt, x_pts_per_elem(i) )
159 end do
160
161 log_info("SIAC_filter_Init",*) "r, l=", r, l
162 log_info("SIAC_filter_Init",*) "KernelFunc coef:", this%kernel_func_coef
163 do i=1, this%Npts_per_elem
164 log_info("SIAC_filter_Init",*) "--- KernelFunc xi=", x_pts_per_elem(i)
165 do m=-this%KernelHalfW,this%KernelHalfW
166 log_info("SIAC_filter_Init",*) this%kernel_func(:,1,m,i), ":", this%kernel_func(:,2,m,i)
167 end do
168 end do
169
170 do i=1, this%Npts_per_elem
171 log_info("SIAC_filter_Init",*) "--- InterpMat xi=", x_pts_per_elem(i)
172 log_info("SIAC_filter_Init",*) "L", this%IntrpMat(1,:,1,i)
173 log_info("SIAC_filter_Init",*) "L", this%IntrpMat(2,:,1,i)
174 log_info("SIAC_filter_Init",*) "R", this%IntrpMat(1,:,2,i)
175 log_info("SIAC_filter_Init",*) "R", this%IntrpMat(2,:,2,i)
176 end do
177
178 return
Module common / Polynomial.
real(rp) function, dimension(size(x), nord+1), public polynomial_genlegendrepoly(nord, x)
A function to obtain the values of Legendre polynomials which are evaluated at arbitrary points.
real(rp) function, dimension(size(x), nord+1), public polynomial_genlagrangepoly(nord, x_lgl, x)
A function to obtain the Lagrange basis functions related to the Gauss-Legendre-Lobatto (GLL) points.