UniformPoints Function

public function UniformPoints(a, b, firstInd, lastInd) result(xU)

\addtogroup SELF_SupportRoutines @{ \fn UniformPoints Generates a REAL(prec) array of N points evenly spaced between two points.

Usage :

REAL(prec) :: a
REAL(prec) :: b
REAL(prec) :: xU(0:N)
INTEGER :: N
....
xU = UniformPoints( a, b, N )

Parameters :

in a REAL(prec) Starting point of the interval
in b REAL(prec) Ending point of the interval
in N INTEGER The number of points in the interval \f$[a,b]\f$
in xU(0:N) REAL(prec) Array of evenly spaced points in the interval \f$[a,b]\f$

@}

Arguments

TypeIntentOptionalAttributesName
real(kind=prec) :: a
real(kind=prec) :: b
integer :: firstInd
integer :: lastInd

Return Value real(kind=prec)(firstInd:lastInd)


Called by

proc~~uniformpoints~~CalledByGraph proc~uniformpoints UniformPoints proc~uniformblockmesh_mesh1d UniformBlockMesh_Mesh1D proc~uniformblockmesh_mesh1d->proc~uniformpoints proc~init_lagrange~2 Init_Lagrange proc~init_lagrange~2->proc~uniformpoints proc~init_lagrange_t Init_Lagrange_t proc~init_lagrange_t->proc~uniformpoints proc~init_lagrange Init_Lagrange proc~init_lagrange->proc~uniformpoints

Contents

Source Code


Source Code

  function UniformPoints(a,b,firstInd,lastInd) result(xU)

    implicit none
    real(prec) :: a,b
    integer    :: firstInd,lastInd
    real(prec) :: xU(firstInd:lastInd)
    ! LOCAL
    real(prec)    :: dx
    integer :: i

    dx = (b-a)/real((lastInd-firstInd),prec)

    do i = firstInd,lastInd

      xU(i) = a+dx*real(i-firstInd,prec)

    enddo

  endfunction UniformPoints