Initialize the lift matrix, , used to compute surface integral terms in the Discontinuous Galerkin formulation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=ip), | intent(in) | :: | n | The order of the Jacobi polynomials. |
||
real(kind=wp), | intent(in), | dimension(n+1,n+1) | :: | v | The Vandermonde matrix, . |
The return value is the lift matrix, , where is a array of the form
function Lift1D ( n, v )
!! Initialize the lift matrix, \(L_{ij}\), used to compute surface
!! integral terms in the Discontinuous Galerkin formulation.
integer(ip), intent(in) :: n
!! The order of the Jacobi polynomials.
real(wp), dimension(n+1,n+1), intent(in) :: v
!! The Vandermonde matrix, \(\mathcal{V}_{ij}\).
real(wp), dimension(n+1,2) :: Lift1D
!! The return value is the lift matrix, \(L= \mathcal{V}
!! \mathcal{V}^{\mathrm{T}}\mathcal{E}\), where \(\mathcal{E}\) is
!! a \(n+1\times 2\) array of the form
!! \[
!! \begin{pmatrix}
!! 1 & 0 & \cdots & 0 & 0 \\
!! 0 & 0 & \cdots & 0 & 1
!! \end{pmatrix}
!! \]
real(wp), dimension(n+1,2) :: emat
integer(ip) :: i, j
emat = 0.0_wp
emat(1,1) = 1.0_wp
emat(n+1,2) = 1.0_wp
Lift1D = matmul(v,matmul(transpose(v),emat))
return
end function Lift1D