constructor Function

private function constructor(val, grad) result(this)

Creates a new scalar field with a uniform value across all of space but a non-zero gradient.

Arguments

Type IntentOptional AttributesName
real(kind=r8), intent(in) :: val

The value of the field

real(kind=r8), intent(in), dimension(:):: grad

An array in which the ith 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.

Return Value type(uniform_gradient_field)

A scalar field initated based on teh arguments of this function.


Calls

proc~~constructor~3~~CallsGraph proc~constructor~3 constructor uniform_scalar_field uniform_scalar_field proc~constructor~3->uniform_scalar_field

Called by

proc~~constructor~3~~CalledByGraph proc~constructor~3 constructor interface~uniform_gradient_field uniform_gradient_field interface~uniform_gradient_field->proc~constructor~3

Contents

Source Code


Source Code

  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