11#include "scaleFElib.h"
43 real(rp),
allocatable :: intrpmat_vpordm1(:,:)
48 procedure,
public :: init => element_operation_general_init
49 procedure,
public :: final => element_operation_general_final
50 procedure,
public :: dx => element_operation_general_dx
51 procedure,
public :: dy => element_operation_general_dy
52 procedure,
public :: dz => element_operation_general_dz
53 procedure,
public :: lift => element_operation_general_lift
54 procedure,
public :: dxdydzlift => element_operation_general_dxdydzlift
55 procedure,
public :: div => element_operation_general_div
56 procedure,
public :: div_var5 => element_operation_general_div_var5
57 procedure,
public :: vfilterpm1 => element_operation_general_vfilterpm1
59 procedure,
public :: setup_modalfilter => element_operation_general_setup_modalfilter
60 procedure,
public :: setup_modalfilter_tracer => element_operation_general_setup_modalfilter_tracer
61 procedure,
public :: modalfilter_tracer => element_operation_general_modalfilter_tracer
62 procedure,
public :: modalfilter_var5 => element_operation_general_modalfilter_var5
66 module procedure element_operation_general_generate_vpordm1
75 subroutine element_operation_general_init( this, elem3D, &
78 class(ElementOperationGeneral),
intent(inout) :: this
79 class(ElementBase3D),
intent(in),
target :: elem3D
80 type(SparseMat),
intent(in),
target :: Dx
81 type(SparseMat),
intent(in),
target :: Dy
82 type(SparseMat),
intent(in),
target :: Dz
83 type(SparseMat),
intent(in),
target :: Lift
93 allocate( this%IntrpMat_VPOrdM1(elem3d%Np,elem3d%Np) )
94 call element_operation_general_generate_vpordm1( this%IntrpMat_VPOrdM1, &
98 end subroutine element_operation_general_init
103 subroutine element_operation_general_generate_vpordm1( IntrpMat_VPOrdM1, &
107 real(RP),
intent(out) :: IntrpMat_VPOrdM1(elem3D%Np,elem3D%Np)
109 integer :: p1, p2, p_
110 real(RP) :: invV_VPOrdM1(elem3D%Np,elem3D%Np)
113 invv_vpordm1(:,:) = elem3d%invV(:,:)
114 do p2=1, elem3d%Nnode_h1D
115 do p1=1, elem3d%Nnode_h1D
116 p_ = p1 + (p2-1)*elem3d%Nnode_h1D + (elem3d%Nnode_v-1)*elem3d%Nnode_h1D**2
117 invv_vpordm1(p_,:) = 0.0_rp
120 intrpmat_vpordm1(:,:) = matmul(elem3d%V, invv_vpordm1)
123 end subroutine element_operation_general_generate_vpordm1
128 subroutine element_operation_general_setup_modalfilter( this, &
129 MF_ETAC_h, MF_ALPHA_h, MF_ORDER_h, &
130 MF_ETAC_v, MF_ALPHA_v, MF_ORDER_v )
134 real(RP),
intent(in) :: MF_ETAC_h
135 real(RP),
intent(in) :: MF_ALPHA_h
136 integer,
intent(in) :: MF_ORDER_h
137 real(RP),
intent(in) :: MF_ETAC_v
138 real(RP),
intent(in) :: MF_ALPHA_v
139 integer,
intent(in) :: MF_ORDER_v
142 call setup_modalfilter( this%MFilter, &
143 mf_etac_h, mf_alpha_h, mf_order_h, &
144 mf_etac_v, mf_alpha_v, mf_order_v, &
145 this%elem3D%PolyOrder_h, this%elem3D%PolyOrder_v )
148 end subroutine element_operation_general_setup_modalfilter
153 subroutine element_operation_general_setup_modalfilter_tracer( this, &
154 MF_ETAC_h, MF_ALPHA_h, MF_ORDER_h, &
155 MF_ETAC_v, MF_ALPHA_v, MF_ORDER_v )
158 real(RP),
intent(in) :: MF_ETAC_h
159 real(RP),
intent(in) :: MF_ALPHA_h
160 integer,
intent(in) :: MF_ORDER_h
161 real(RP),
intent(in) :: MF_ETAC_v
162 real(RP),
intent(in) :: MF_ALPHA_v
163 integer,
intent(in) :: MF_ORDER_v
166 call setup_modalfilter( this%MFilter_tracer, &
167 mf_etac_h, mf_alpha_h, mf_order_h, &
168 mf_etac_v, mf_alpha_v, mf_order_v, &
169 this%elem3D%PolyOrder_h, this%elem3D%PolyOrder_v )
172 end subroutine element_operation_general_setup_modalfilter_tracer
178 subroutine element_operation_general_final( this )
183 nullify( this%elem3D )
184 nullify( this%Dx_sm, this%Dy_sm, this%Dz_sm, this%Lift_sm )
186 deallocate( this%IntrpMat_VPOrdM1 )
189 end subroutine element_operation_general_final
194 subroutine element_operation_general_dx( this, vec_in, vec_out )
197 real(RP),
intent(in) :: vec_in(this%elem3D%Np)
198 real(RP),
intent(out) :: vec_out(this%elem3D%Np)
202 end subroutine element_operation_general_dx
207 subroutine element_operation_general_dy( this, vec_in, vec_out )
210 real(RP),
intent(in) :: vec_in(this%elem3D%Np)
211 real(RP),
intent(out) :: vec_out(this%elem3D%Np)
215 end subroutine element_operation_general_dy
220 subroutine element_operation_general_dz( this, vec_in, vec_out )
223 real(RP),
intent(in) :: vec_in(this%elem3D%Np)
224 real(RP),
intent(out) :: vec_out(this%elem3D%Np)
228 end subroutine element_operation_general_dz
233 subroutine element_operation_general_lift( this, vec_in, vec_out )
236 real(RP),
intent(in) :: vec_in(this%elem3D%NfpTot)
237 real(RP),
intent(out) :: vec_out(this%elem3D%Np)
241 end subroutine element_operation_general_lift
246 subroutine element_operation_general_dxdydzlift( this, vec_in, vec_in_lift, vec_out_dx, vec_out_dy, vec_out_dz, vec_out_lift )
249 real(RP),
intent(in) :: vec_in(this%elem3D%Np)
250 real(RP),
intent(in) :: vec_in_lift(this%elem3D%NfpTot)
251 real(RP),
intent(out) :: vec_out_dx(this%elem3D%Np)
252 real(RP),
intent(out) :: vec_out_dy(this%elem3D%Np)
253 real(RP),
intent(out) :: vec_out_dz(this%elem3D%Np)
254 real(RP),
intent(out) :: vec_out_lift(this%elem3D%Np)
262 end subroutine element_operation_general_dxdydzlift
267 subroutine element_operation_general_div( this, vec_in_x, vec_in_y, vec_in_z, vec_in_lift, &
268 vec_out_dx, vec_out_dy, vec_out_dz, vec_out_lift )
271 real(RP),
intent(in) :: vec_in_x(this%elem3D%Np)
272 real(RP),
intent(in) :: vec_in_y(this%elem3D%Np)
273 real(RP),
intent(in) :: vec_in_z(this%elem3D%Np)
274 real(RP),
intent(in) :: vec_in_lift(this%elem3D%NfpTot)
275 real(RP),
intent(out) :: vec_out_dx(this%elem3D%Np)
276 real(RP),
intent(out) :: vec_out_dy(this%elem3D%Np)
277 real(RP),
intent(out) :: vec_out_dz(this%elem3D%Np)
278 real(RP),
intent(out) :: vec_out_lift(this%elem3D%Np)
286 end subroutine element_operation_general_div
292 subroutine element_operation_general_div_var5( this, vec_in, vec_in_lift, &
296 real(RP),
intent(in) :: vec_in(this%elem3D%Np,3,5)
297 real(RP),
intent(in) :: vec_in_lift(this%elem3D%NfpTot,5)
298 real(RP),
intent(out) :: vec_out_d(this%elem3D%Np,4,5)
312 end subroutine element_operation_general_div_var5
315 subroutine element_operation_general_vfilterpm1( this, vec_in, vec_out )
318 real(RP),
intent(in) :: vec_in(this%elem3D%Np)
319 real(RP),
intent(out) :: vec_out(this%elem3D%Np)
322 call matmul_( this%IntrpMat_VPOrdM1, vec_in, this%elem3D%Np, &
325 end subroutine element_operation_general_vfilterpm1
328 subroutine matmul_( IntrpMat_VPOrdM1, vec_in_, Np, vec_out_ )
330 integer,
intent(in) :: Np
331 real(RP),
intent(in) :: IntrpMat_VPOrdM1(Np,Np)
332 real(RP),
intent(in) :: vec_in_(Np)
333 real(RP),
intent(out) :: vec_out_(Np)
335 vec_out_(:) = matmul( intrpmat_vpordm1(:,:), vec_in_(:) )
337 end subroutine matmul_
340 subroutine element_operation_general_modalfilter_tracer( this, vec_in, vec_work, vec_out )
343 real(RP),
intent(in) :: vec_in(this%elem3D%Np)
344 real(RP),
intent(out) :: vec_work(this%elem3D%Np)
345 real(RP),
intent(out) :: vec_out(this%elem3D%Np)
347 integer :: ii, kk, Np
356 mik = this%MFilter_tracer%FilterMat(ii,kk)
357 vec_out(ii) = vec_out(ii) + mik * vec_in(kk)
362 end subroutine element_operation_general_modalfilter_tracer
365 subroutine element_operation_general_modalfilter_var5( this, vec_in, vec_work, vec_out )
368 real(RP),
intent(in) :: vec_in(this%elem3D%Np,5)
369 real(RP),
intent(out) :: vec_work(this%elem3D%Np)
370 real(RP),
intent(out) :: vec_out(this%elem3D%Np,5)
372 integer :: ii, kk, Np
377 vec_out(:,:) = 0.0_rp
381 mik = this%MFilter%FilterMat(ii,kk)
383 vec_out(ii,1) = vec_out(ii,1) + mik * vec_in(kk,1)
384 vec_out(ii,2) = vec_out(ii,2) + mik * vec_in(kk,2)
385 vec_out(ii,3) = vec_out(ii,3) + mik * vec_in(kk,3)
386 vec_out(ii,4) = vec_out(ii,4) + mik * vec_in(kk,4)
387 vec_out(ii,5) = vec_out(ii,5) + mik * vec_in(kk,5)
392 end subroutine element_operation_general_modalfilter_var5
397 subroutine setup_modalfilter( MFilter, &
398 MF_ETAC_h, MF_ALPHA_h, MF_ORDER_h, &
399 MF_ETAC_v, MF_ALPHA_v, MF_ORDER_v, &
400 PolyOrder_h, PolyOrder_v )
406 real(RP),
intent(in) :: MF_ETAC_h
407 real(RP),
intent(in) :: MF_ALPHA_h
408 integer,
intent(in) :: MF_ORDER_h
409 real(RP),
intent(in) :: MF_ETAC_v
410 real(RP),
intent(in) :: MF_ALPHA_v
411 integer,
intent(in) :: MF_ORDER_v
412 integer,
intent(in) :: PolyOrder_h
413 integer,
intent(in) :: PolyOrder_v
418 call elem3d%Init( polyorder_h, polyorder_v, .false. )
422 mf_etac_h, mf_alpha_h, mf_order_h, &
423 mf_etac_v, mf_alpha_v, mf_order_v )
427 end subroutine setup_modalfilter
429end module scale_element_operation_general
module FElib / Element / Base
subroutine, public elementbase3d_init(elem, lumpedmat_flag)
subroutine, public elementbase3d_final(elem)
module FElib / Element / hexahedron
module FElib / element/ ModalFilter
module FElib / Element / Operation / Base
module FElib / Element / Operation with arbitary elements
module common / sparsemat