ic Function

elemental function ic(x)

Initial condition. Here we used a limited linear profile.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: x

spatial variable

Return Value real(kind=rk)


Called by

proc~~ic~~CalledByGraph proc~ic ic program~example1_burgers_1d_fv example1_burgers_1d_fv program~example1_burgers_1d_fv->proc~ic

Variables

Type Visibility Attributes Name Initial
real(kind=rk), public, parameter :: xa = -4._rk
real(kind=rk), public, parameter :: xb = 2._rk
real(kind=rk), public, parameter :: va = 1._rk
real(kind=rk), public, parameter :: vb = -0.5_rk

Source Code

   elemental real(rk) function ic(x)
   !! Initial condition. Here we used a limited linear profile.
      real(rk), intent(in) :: x
         !! spatial variable
      real(rk), parameter :: xa = -4._rk, xb = 2._rk, va = 1._rk, vb = -0.5_rk

      ic = va + (vb - va)/(xb - xa)*(x - xa)
      ic = max(min(ic, va), vb)

   end function ic