Creates a new scalar field with a uniform value across all of space but a non-zero gradient.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r8), | intent(in) | :: | val | The value of the field |
||
real(kind=r8), | intent(in), | dimension(:) | :: | grad | An array in which the |
A scalar field initated based on teh arguments of this function.
function constructor(val, grad) result(this)
!* Author: Chris MacMackin
! Date: July 2017
!
! Creates a new scalar field with a uniform value across all of
! space but a non-zero gradient.
!
real(r8), intent(in) :: val
!! The value of the field
real(r8), dimension(:), intent(in) :: grad
!! An array in which the `i`th element contains the gradient in
!! the _i_th direction. Directions corresponding to values of
!! `i` greater than the size of the array are taken to have a
!! gradient of zero.
type(uniform_gradient_field) :: this
!! A scalar field initated based on teh arguments of this
!! function.
this%uniform_scalar_field = uniform_scalar_field(val)
this%grad = grad
end function constructor