getx Module Function

function getx(N) result(x)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: N

Return Value real(kind=wp), dimension(N)


Calls

proc~~getx~~CallsGraph proc~getx getx linspace linspace proc~getx->linspace

Contents

Source Code


Source Code

  module function getx(N) result(x)
    integer,  intent(in)      :: N
    real(wp), dimension(N)    :: x

    call linspace(-1.d0, 1.d0, x)

    ! Gmsh orders all their lines as endpoint1, endpoint2, internal...
    ! Therefore, need to reorder if numpts is more than 2
    if ( N>2 ) x = [x(1), x(N), x(2:N-1)]

    return
  end function getx