Dmatrix1D Function

function Dmatrix1D(n, x, v)

Initialize the differentiation matrix for a reference element of order .

Arguments

Type IntentOptional AttributesName
integer(kind=ip), intent(in) :: n

The order of the Jacobi polynomials.

real(kind=wp), intent(in), dimension(n+1):: x

The nodal points where the differentiation matrix will provide approximations to the derivative.

real(kind=wp), intent(in), dimension(n+1,n+1):: v

The Vandermonde matrix, .

Return Value real(kind=wp), dimension(n+1,n+1)

The return value is the differentiation matrix, .


Calls

proc~~dmatrix1d~~CallsGraph proc~dmatrix1d Dmatrix1D proc~gradvandermonde1d GradVandermonde1D proc~dmatrix1d->proc~gradvandermonde1d qgesv qgesv proc~dmatrix1d->qgesv dgesv dgesv proc~dmatrix1d->dgesv proc~gradjacobip GradJacobiP proc~gradvandermonde1d->proc~gradjacobip proc~jacobip JacobiP proc~gradjacobip->proc~jacobip

Called by

proc~~dmatrix1d~~CalledByGraph proc~dmatrix1d Dmatrix1D proc~init_ref_element init_ref_element proc~init_ref_element->proc~dmatrix1d interface~init_ref_element init_ref_element interface~init_ref_element->proc~init_ref_element interface~ref_element ref_element interface~ref_element->interface~init_ref_element proc~scal_schw_init scal_schw_init proc~scal_schw_init->interface~ref_element program~test test program~test->interface~ref_element interface~scal_schw_init scal_schw_init interface~scal_schw_init->proc~scal_schw_init

Contents

Source Code


Source Code

    function Dmatrix1D ( n, x, v )
    !! Initialize the differentiation matrix for a reference element of
    !! order \(n\).
      integer(ip), intent(in) :: n
      !! The order of the Jacobi polynomials.
      real(wp), dimension(n+1), intent(in) :: x
      !! The nodal points \(x\in[-1:1]\) where the differentiation matrix
      !! will provide approximations to the derivative.
      real(wp), dimension(n+1,n+1), intent(in) :: v
      !! The Vandermonde matrix, \(\mathcal{V}_{ij}\).
      real(wp), dimension(n+1,n+1) :: Dmatrix1D
      !! The return value is the differentiation matrix, \(\mathcal{D}_r=
      !! \mathcal{V}_r \mathcal{V}^{-1}\).

      real(wp), dimension(n+1,n+1) :: vr, vrt, vt, drt
      integer(ip), dimension(n+1) :: ipiv
      integer(ip) :: i, j, info

      vt = transpose(v)
      vr = GradVandermonde1D ( n, x )
      vrt = transpose(vr)

      if ( wp == dp ) then
        call dgesv ( n+1, n+1, vt, n+1, ipiv, vrt, n+1, info )
      else if ( wp == qp ) then
        call qgesv ( n+1, n+1, vt, n+1, ipiv, vrt, n+1, info )
      endif

      if (info <0) then
        print*,'Parameter ', i, ' in call to dgesv has illegal value'
        stop
      end if
      if (info >0) then
        print*, 'Matrix in call to dgesv is singular'
        stop
      end if

      Dmatrix1D = transpose(vrt)
    end function Dmatrix1D