35 procedure :: final => quadrilateralelement_final
36 procedure :: genintgausslegendreintrpmat => quadrilateralelement_gen_intgausslegendreintrpmat
43 private :: construct_element
60 integer,
intent(in) :: elemOrder
61 logical,
intent(in) :: LumpedMassMatFlag
65 elem%PolyOrder = elemorder
67 elem%Np = (elemorder + 1)**2
68 elem%Nfp = elemorder + 1
70 elem%NfpTot = elem%Nfp*elem%Nfaces
73 call construct_element(elem)
82 subroutine quadrilateralelement_final(elem)
91 end subroutine quadrilateralelement_final
94 subroutine construct_element(elem)
109 integer :: nodes_ij(elem%Nfp, elem%Nfp)
111 real(RP) :: lglPts1D(elem%Nfp)
112 real(DP) :: intWeight_lgl1DPts(elem%Nfp)
114 real(RP) :: P1D_ori(elem%Nfp, elem%Nfp)
115 real(RP) :: DP1D_ori(elem%Nfp, elem%Nfp)
116 real(RP) :: DLagr1D(elem%Nfp, elem%Nfp)
117 real(RP) :: V1D(elem%Nfp, elem%Nfp)
118 real(RP) :: Emat(elem%Np, elem%NfpTot)
119 real(RP) :: MassEdge(elem%Nfp, elem%Nfp)
121 real(RP) :: eta, etac
122 real(RP) :: filter1D(elem%Nfp), filter2D(elem%Np)
139 nodes_ij(i,j) = i + (j-1)*elem%Nfp
145 elem%Fmask(:,1) = nodes_ij(:,1)
146 elem%Fmask(:,2) = nodes_ij(elem%Nfp,:)
147 elem%Fmask(:,3) = nodes_ij(:,elem%Nfp)
148 elem%Fmask(:,4) = nodes_ij(1,:)
152 elem%Dx1(:,:) = 0.0_rp
153 elem%Dx2(:,:) = 0.0_rp
157 n = i + (j-1)*elem%Nfp
160 elem%x1(n) = lglpts1d(i)
161 elem%x2(n) = lglpts1d(j)
166 l = p1 + (p2-1)*elem%Nfp
167 elem%V(n,l) = (p1d_ori(i,p1)*p1d_ori(j,p2)) &
168 * sqrt((dble(p1-1) + 0.5_dp)*(dble(p2-1) + 0.5_dp))
170 if(p2==j) elem%Dx1(n,l) = dlagr1d(p1,i)
171 if(p1==i) elem%Dx2(n,l) = dlagr1d(p2,j)
184 l = i + (j - 1)*elem%Nfp
185 elem%IntWeight_lgl(l) = &
186 intweight_lgl1dpts(i) * intweight_lgl1dpts(j)
192 if (elem%IsLumpedMatrix())
then
193 elem%invM(:,:) = 0.0_rp
197 l = i + (j - 1)*elem%Nfp
198 elem%M(l,l) = elem%IntWeight_lgl(l)
199 elem%invM(l,l) = 1.0_rp/elem%IntWeight_lgl(l)
217 v1d(:,p1) = p1d_ori(:,p1)*sqrt(dble(p1-1) + 0.5_dp)
223 if (elem%IsLumpedMatrix())
then
226 massedge(l,l) = intweight_lgl1dpts(l)
233 emat(elem%Fmask(:,f), (f-1)*elem%Nfp+1:f*elem%Nfp) = massedge
241 end subroutine construct_element
244 function quadrilateralelement_gen_intgausslegendreintrpmat( this, IntrpPolyOrder, &
245 intw_intrp, x_intrp, y_intrp )
result(IntrpMat)
255 integer,
intent(in) :: IntrpPolyOrder
256 real(RP),
intent(out),
optional :: intw_intrp(IntrpPolyOrder**2)
257 real(RP),
intent(out),
optional :: x_intrp(IntrpPolyOrder**2)
258 real(RP),
intent(out),
optional :: y_intrp(IntrpPolyOrder**2)
259 real(RP) :: IntrpMat(IntrpPolyOrder**2,this%Np)
261 real(RP) :: r_int1D_i(IntrpPolyOrder)
262 real(RP) :: r_int1Dw_i(IntrpPolyOrder)
263 real(RP) :: P_int1D_ori(IntrpPolyOrder,this%PolyOrder+1)
264 real(RP) :: Vint(IntrpPolyOrder**2,(this%PolyOrder+1)**2)
266 integer :: p1, p2, p1_, p2_
274 do p2_=1, intrppolyorder
275 do p1_=1, intrppolyorder
276 n_= p1_ + (p2_-1)*intrppolyorder
277 if (
present(intw_intrp)) intw_intrp(n_) = r_int1dw_i(p1_) * r_int1dw_i(p2_)
278 if (
present(x_intrp)) x_intrp(n_) = r_int1d_i(p1_)
279 if (
present(y_intrp)) y_intrp(n_) = r_int1d_i(p2_)
283 l_ = p1 + (p2-1)*this%Nfp
284 vint(n_,l_) = p_int1d_ori(p1_,p1) * sqrt(dble(p1-1) + 0.5_dp) &
285 * p_int1d_ori(p2_,p2) * sqrt(dble(p2-1) + 0.5_dp)
290 intrpmat(:,:) = matmul(vint, this%invV)
293 end function quadrilateralelement_gen_intgausslegendreintrpmat
module FElib / Element / Base
subroutine, public elementbase2d_final(elem)
Finalize an object to manage a 2D reference element.
subroutine, public elementbase2d_init(elem, lumpedmat_flag)
Initialize an object to manage a 2D reference element.
subroutine, public elementbase_construct_massmat(v, np, massmat, invmassmat)
Construct mass matrix M^-1 = V V^T M = ( M^-1 )^-1.
subroutine, public elementbase_construct_stiffmat(massmat, invmassmat, dmat, np, stiffmat)
Construct stiffness matrix StiffMat_i = M^-1 ( M D_xi )^T.
subroutine, public elementbase_construct_liftmat(invm, emat, np, nfptot, liftmat)
Construct stiffness matrix StiffMat_i = M^-1 ( M D_xi )^T.
module FElib / Element / Quadrilateral
subroutine quadrilateralelement_init(elem, elemorder, lumpedmassmatflag)
Initialize an object to manage a hexahedral element.
Module common / Linear algebra.
real(rp) function, dimension(size(a, 1), size(a, 2)), public linalgebra_inv(a)
Calculate a inversion of matrix A.
Module common / Polynominal.
real(rp) function, dimension(nord), public polynominal_gengausslegendreptintweight(nord)
A function to calculate the Gauss-Legendre (GL) weights.
real(rp) function, dimension(nord), public polynominal_gengausslegendrept(nord)
A function to calculate the Gauss-Legendre (GL) points.
real(rp) function, dimension(size(x), nord+1), public polynominal_genlagrangepoly(nord, x_lgl, x)
A function to obtain the Lagrange basis functions related to the Gauss-Legendre-Lobatto (GLL) points.
real(rp) function, dimension(nord+1), public polynominal_gengausslobattopt(nord)
A function to calculate the Legendre-Gauss-Lobatto (LGL) points.
real(rp) function, dimension(size(x), nord+1), public polynominal_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 polynominal_gendlegendrepoly(nord, x, p)
A function to obtain differential values of Legendre polynomials which are evaluated at arbitrary poi...
real(rp) function, dimension(nord+1), public polynominal_gengausslobattoptintweight(nord)
A function to calculate the Gauss-Lobbato weights.
real(rp) function, dimension(nord+1, nord+1), public polynominal_gendlagrangepoly_lglpt(nord, x_lgl)
A function to obtain the differential values of Lagrange basis functions at the GLL points.
Derived type representing a 2D reference element.
Derived type representing a quadrilateral element.