field_gpu_type Derived Type

type, public, extends(field_type) :: field_gpu_type


Contents


Components

Type Visibility Attributes Name Initial
real, public, allocatable :: data(:,:,:)
real, public :: dx

Discrete mesh spacing


Constructor

public interface field_gpu_type

  • public function field_gpu_constructor(initial, dx) result(afield)

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in) :: initial(:,:,:)

    Initial state

    real, intent(in) :: dx

    Spatial mesh spacing

    Return Value type(field_gpu_type)


Type-Bound Procedures

procedure, public :: nz

  • public pure function nz(self)

    Returns domain size in direction

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self

    Return Value integer

procedure, public :: ny

  • public pure function ny(self)

    Returns domain size in direction

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self

    Return Value integer

procedure, public :: nx

  • public pure function nx(self)

    Returns domain size in direction

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self

    Return Value integer

procedure, public :: dump

  • public subroutine dump(self, file_path, fmt)

    Write field data to ASCII file

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self
    character, intent(in) :: file_path

    Relative path to file to output file

    character, optional :: fmt

    Format string

procedure, public :: is_equal

  • public pure function is_equal(self, lhs, tol)

    Compare two field_type instance based on their data value

    f1 = field_type(u0, dx)
    f2 = field_type(u0, dx2)
    f1%is_equal(f2) ! true
    

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self

    Right hand side of comparison

    class(field_type), intent(in) :: lhs

    Left hand side of comparison

    real, intent(in) :: tol

    Absolute tolerance when comparing fields values

    Return Value logical

generic, public :: operator(+) => field_add_field, field_add_real

  • public pure function field_add_field(self, afield)

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self
    class(field_type), intent(in) :: afield

    Return Value class(field_type), allocatable

  • public pure function field_add_real(self, a)

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self
    real, intent(in) :: a(:,:,:)

    Return Value class(field_type), allocatable

generic, public :: operator(-) => field_sub_field

generic, public :: operator(*) => field_mul_real

  • public pure function field_mul_real(self, a)

    Multiply a field_cpu_type instance by a real number.

    f1 = field_cpu_type(u0, dx)
    f2 = f1 * 1.3
    f2%is_equal(field_cpu_type(u0 * 1.3, dx)) ! true
    

    Arguments

    Type IntentOptional Attributes Name
    class(field_type), intent(in) :: self

    Left hand side

    real, intent(in) :: a

    Scalar to multiply field instance with

    Return Value class(field_type), allocatable

procedure, public :: rhs

  • public pure function rhs(self)

    Arguments

    Type IntentOptional Attributes Name
    class(field_gpu_type), intent(in) :: self

    Return Value real, allocatable, (:,:,:)