11#include "scaleFElib.h"
19 use scale_prc,
only: prc_abort
63 procedure :: final => meshfieldfilteroperation1d_final
64 procedure :: apply => meshfieldfilteroperation1d_apply_filter
65 procedure :: apply_gl_lc => meshfieldfilteroperation1d_apply_filter_gl_lc
77 private :: extract_tmp1d
89 FilterShape, FilterWidthFac, &
92 mesh1D, Nnode_1D_GL, IF_r )
96 character(*),
intent(in) :: FilterOptrType
97 character(*),
intent(in) :: FilterShape
98 real(RP),
intent(in) :: FilterWidthFac
99 integer,
intent(in) :: Nnode_1D_reconst
100 integer,
intent(in) :: sfield_num
101 integer,
intent(in),
optional :: Nnode_1D_GL
102 integer,
intent(in),
optional :: IF_r
106 filteroptrtype, filtershape, filterwidthfac, &
107 nnode_1d_reconst, nnode_1d_gl, if_r )
109 if (
present(nnode_1d_gl))
then
110 this%Nnode_GL = nnode_1d_gl
112 this%Nnode_GL = mesh1d%refElem1D%Np
117 call this%vars_comm%Init( sfield_num, 0, mesh1d, &
118 halosize_1d=this%hHaloSize )
120 log_info(
'MeshFieldFilterOperation1D_Init',*)
"Unsupported mesh type is specified. Check!"
128 subroutine meshfieldfilteroperation1d_final( this )
133 call this%vars_comm%Final()
135 end subroutine meshfieldfilteroperation1d_final
139 subroutine meshfieldfilteroperation1d_apply_filter( this, q_list, &
143 type(
meshfield1d),
intent(inout),
target :: q_list(this%vars_comm%field_num_tot)
144 class(
meshbase1d),
intent(in),
target :: mesh1D
148 real(RP),
allocatable :: tmp1D(:,:,:)
155 do iv=1, this%vars_comm%field_num_tot
156 comm_vars_list(iv)%field1D => q_list(iv)
158 call this%vars_comm%Put(comm_vars_list, 1)
159 call this%vars_comm%Exchange()
160 call this%vars_comm%Get(comm_vars_list, 1)
162 do n=1, mesh1d%LOCAL_MESH_NUM
163 lmesh1d => mesh1d%lcmesh_list(n)
164 elem1d => lmesh1d%refElem1D
165 allocate( tmp1d(-this%hHaloSize+1:elem1d%Np+this%hHaloSize,0:2,lmesh1d%Ne) )
167 do iv=1, this%vars_comm%field_num_tot
168 call extract_tmp1d( tmp1d, &
169 q_list(iv)%local(n)%val, q_list(iv)%local(n)%val, lmesh1d, elem1d, lmesh1d%VMapP, this%hHaloSize )
171 select case (this%operator_type)
173 call apply_filter1d_x( q_list(iv)%local(n)%val, &
174 tmp1d, this%FilterMat_h1D, elem1d%Np, 1, 1, lmesh1d%Ne, lmesh1d%NeA, elem1d%Np )
176 call apply_reconst1d_x( q_list(iv)%local(n)%val, &
177 tmp1d, this%Minv_Ml_tr, this%Minv_Mc_tr, this%Minv_Mr_tr, this%IntrpMat, elem1d%Np, 1, 1, lmesh1d%Ne, this%Nnode_h1D_reconst, lmesh1d )
179 call apply_reconst1d_x_2( q_list(iv)%local(n)%val, &
180 tmp1d, this%Ml_tr, this%Mc_tr, this%Mr_tr, elem1d%Np, 1, 1, lmesh1d%Ne, this%Nnode_h1D_reconst, lmesh1d )
182 call apply_interface_correction1d_x( q_list(iv)%local(n)%val, &
183 tmp1d, this%IF_gL, this%IF_gR, elem1d%Np, 1, 1, lmesh1d%Ne, lmesh1d )
190 end subroutine meshfieldfilteroperation1d_apply_filter
195 subroutine meshfieldfilteroperation1d_apply_filter_gl_lc( this, &
203 real(RP),
intent(out) :: q_GL(this%Nnode_GL,lmesh%Ne,this%vars_comm%field_num_tot)
204 type(
meshfield1d),
intent(inout),
target :: q_list(this%vars_comm%field_num_tot)
206 real(RP),
allocatable :: tmp1D(:,:,:)
213 do iv=1, this%vars_comm%field_num_tot
214 comm_vars_list(iv)%field1D => q_list(iv)
216 call this%vars_comm%Put(comm_vars_list, 1)
217 call this%vars_comm%Exchange()
218 call this%vars_comm%Get(comm_vars_list, 1)
220 allocate( tmp1d(-this%hHaloSize+1:elem1d%Np+this%hHaloSize,0:2,lmesh%Ne) )
223 do iv=1, this%vars_comm%field_num_tot
224 call extract_tmp1d( tmp1d, &
225 q_list(iv)%local(n)%val, q_list(iv)%local(n)%val, lmesh, elem1d, lmesh%VMapP, this%hHaloSize )
227 select case (this%operator_type)
229 call apply_reconst1d_x_2_gl( q_gl(:,:,iv), &
230 tmp1d, this%Ml_tr, this%Mc_tr, this%Mr_tr, elem1d%Np, this%Nnode_GL, lmesh%Ne, this%Nnode_h1D_reconst, lmesh )
235 end subroutine meshfieldfilteroperation1d_apply_filter_gl_lc
240 subroutine apply_reconst1d_x_2_gl( q, q0, Minv_Ml_tr, Minv_Mc_tr, Minv_Mr_tr, &
241 Npx, NpxGL, Ne, Npx_reconst, lmesh )
244 integer,
intent(in) :: Npx, NpxGL, Ne
245 integer,
intent(in) :: Npx_reconst
246 real(RP),
intent(out) :: q(NpxGL,lmesh%Ne)
247 real(RP),
intent(in) :: q0(-Npx+1:2*Npx,0:2,Ne)
248 real(RP),
intent(in) :: Minv_Ml_tr(Npx,NpxGL)
249 real(RP),
intent(in) :: Minv_Mc_tr(Npx,NpxGL)
250 real(RP),
intent(in) :: Minv_Mr_tr(Npx,NpxGL)
256 real(RP) :: tmp(NpxGL)
266 + minv_ml_tr(j,i) * q0(j-npx,1,ke) &
267 + minv_mc_tr(j,i) * q0( j,1,ke) &
268 + minv_mr_tr(j,i) * q0(j+npx,1,ke)
275 end subroutine apply_reconst1d_x_2_gl
278 subroutine extract_tmp1d( tmp1D, q0, q0_, lmesh1D, elem1D, vmapP, hHaloSize )
282 integer,
intent(in) :: hHaloSize
283 real(RP),
intent(out) :: tmp1D(-hHaloSize+1:elem1D%Np+hHaloSize,0:2,lmesh1D%Ne)
284 real(RP),
intent(in) :: q0(elem1D%Np*lmesh1D%NeA)
285 real(RP),
intent(in) :: q0_(elem1D%Np,lmesh1D%NeA)
286 integer,
intent(in) :: vmapP(elem1D%NfpTot,lmesh1D%Ne)
292 real(RP) :: halo_h(hHaloSize,2)
296 fso = lmesh1d%Ne * elem1d%Np + hhalosize * ( f-1 )
298 halo_h(ph,f) = q0(fso+ph)
305 tmp1d(1:elem1d%Np,1,ke) = q0_(:,ke)
309 if ( ip <= lmesh1d%Ne * elem1d%Np )
then
311 tmp1d(ph+elem1d%Np,1,ke) = q0(ip + (ph-1))
315 tmp1d(ph+elem1d%Np,1,ke) = halo_h(ph,2)
321 if ( ip <= lmesh1d%Ne * elem1d%Np )
then
323 tmp1d(-ph+1,1,ke) = q0(ip - (ph-1))
327 tmp1d(-ph+1,1,ke) = halo_h(ph,1)
334 end subroutine extract_tmp1d
module FElib / Element / Base
module FElib / Element/ ModalFilter
module FElib / Mesh / Local 1D
module FElib / Mesh / Local, Base
module FElib / Data / base
module FElib / Mesh / Base 1D
module FElib / Data / base
module FElib / Data / Filter operation 1D
subroutine meshfieldfilteroperation1d_init(this, filteroptrtype, filtershape, filterwidthfac, nnode_1d_reconst, sfield_num, mesh1d, nnode_1d_gl, if_r)
Initialize an object to represent filter operation for 1D mesh field.
module FElib / Data / Filter operation base
integer, parameter, public filter_optrtype_reconstruct2
subroutine, public meshfieldfilteroperationbase_apply_filter1d_x(q, q0, filter1d, npx, npy, npz, ne, nea, nnode_h1d)
integer, parameter, public filter_optrtype_reconstruct
subroutine, public meshfieldfilteroperationbase_apply_interface_correction1d_x(q, q0, gl, gr, npx, npy, npz, ne, lmesh)
integer, parameter, public filter_optrtype_interface_correction
integer, parameter, public filter_optrtype_reconstruct2_gl
subroutine, public meshfieldfilteroperationbase_apply_reconst1d_x_2(q, q0, minv_ml_tr, minv_mc_tr, minv_mr_tr, npx, npy, npz, ne, npx_reconst, lmesh)
subroutine, public meshfieldfilteroperationbase_init(this, nnode_h1d, filteroptrtype, filtershape, filterwidthfac, nnode_h1d_reconst, nnode_h1d_gl, if_r)
subroutine, public meshfieldfilteroperationbase_apply_reconst1d_x(q, q0, minv_ml_tr, minv_mc_tr, minv_mr_tr, intrpmat, npx, npy, npz, ne, npx_reconst, lmesh)
integer, parameter, public filter_optrtype_convfilter
subroutine, public meshfieldfilteroperationbase_final(this)
module FElib / Data / Communication 1D
module FElib / Data / Communication base
Derived type representing a 1D reference element.
Derived type representing a modal filter.
Derived type representing a local mesh for 1D domain.
Derived type to manage a local computational domain (base type)
Derived type representing a field with local mesh (base type)
Derived type to manage a computational mesh (base type for 1D domain)
Derived type representing a field with 1D mesh.
Derived type to represent filter operation for 1D mesh field.
Base type to represent filter operation.
Base derived type to manage data communication with 1D domain.
Container to save a pointer of MeshField(1D, 2D, 3D) object.