MappedDivergence_MappedTwoPointVector2D_t Subroutine

public subroutine MappedDivergence_MappedTwoPointVector2D_t(this, df)

Computes the physical-space divergence of a 2-D split-form vector field on a curvilinear mesh.

Convention (following Trixi.jl for curved meshes): interior(n,i,j,iEl,iVar,r) holds the pre-projected SCALAR contravariant two-point flux for the r-th computational direction:

interior(n,i,j,iEl,iVar,1) = avg(Ja^1) . F_EC(s(i,j), s(n,j)) interior(n,i,j,iEl,iVar,2) = avg(Ja^2) . F_EC(s(i,j), s(i,n))

The metric averaging and direction-correct pairing are the caller's responsibility (e.g. TwoPointFluxMethod in ECDGModel). MappedDivergence applies the reference-element split-form sum and divides by J.

Arguments

TypeIntentOptionalAttributesName
class(MappedTwoPointVector2D_t), intent(in) :: this
real(kind=prec), intent(out) :: df(1:this%N+1,1:this%N+1,1:this%nElem,1:this%nVar)

Contents


Source Code

  subroutine MappedDivergence_MappedTwoPointVector2D_t(this,df)
    !! Computes the physical-space divergence of a 2-D split-form vector field
    !! on a curvilinear mesh.
    !!
    !! Convention (following Trixi.jl for curved meshes):
    !! interior(n,i,j,iEl,iVar,r) holds the pre-projected SCALAR contravariant
    !! two-point flux for the r-th computational direction:
    !!
    !!   interior(n,i,j,iEl,iVar,1) = avg(Ja^1) . F_EC(s(i,j), s(n,j))
    !!   interior(n,i,j,iEl,iVar,2) = avg(Ja^2) . F_EC(s(i,j), s(i,n))
    !!
    !! The metric averaging and direction-correct pairing are the caller's
    !! responsibility (e.g. TwoPointFluxMethod in ECDGModel).
    !! MappedDivergence applies the reference-element split-form sum and
    !! divides by J.
    implicit none
    class(MappedTwoPointVector2D_t),intent(in) :: this
    real(prec),intent(out) :: df(1:this%N+1,1:this%N+1,1:this%nElem,1:this%nVar)
    ! Local
    integer :: i,j,iEl,iVar

    call this%Divergence(df)

    do concurrent(i=1:this%N+1,j=1:this%N+1,iEl=1:this%nElem,iVar=1:this%nVar)
      df(i,j,iEl,iVar) = df(i,j,iEl,iVar)/this%geometry%J%interior(i,j,iEl,1)
    enddo

  endsubroutine MappedDivergence_MappedTwoPointVector2D_t