stream_mask_t Derived Type

type, public :: stream_mask_t


Components

Type Visibility Attributes Name Initial
integer, public :: nx

Mask dimensions

integer, public :: ny

Mask dimensions

integer, public, allocatable :: mask(:,:)

Collision mask (0=free, 1=occupied)

integer, public, allocatable :: trajectory(:,:)

Current trajectory points for undo

integer, public :: traj_length = 0

Length of current trajectory

integer, public :: current_x = -1

Current position

integer, public :: current_y = -1

Current position


Type-Bound Procedures

procedure, public :: initialize => mask_initialize

  • private subroutine mask_initialize(self, density)

    Initialize StreamMask with matplotlib-compatible sizing density=1 → 30x30, density=2 → 60x60, etc.

    Arguments

    Type IntentOptional Attributes Name
    class(stream_mask_t), intent(inout) :: self
    real(kind=wp), intent(in) :: density

procedure, public :: is_free => mask_is_free

  • private function mask_is_free(self, x, y) result(is_free)

    Check if mask position is free for streamline placement

    Arguments

    Type IntentOptional Attributes Name
    class(stream_mask_t), intent(in) :: self
    integer, intent(in) :: x
    integer, intent(in) :: y

    Return Value logical

procedure, public :: start_trajectory => mask_start_trajectory

  • private subroutine mask_start_trajectory(self, x, y)

    Start recording new streamline trajectory

    Arguments

    Type IntentOptional Attributes Name
    class(stream_mask_t), intent(inout) :: self
    integer, intent(in) :: x
    integer, intent(in) :: y

procedure, public :: update_trajectory => mask_update_trajectory

  • private subroutine mask_update_trajectory(self, x, y)

    Update trajectory position and mark mask

    Arguments

    Type IntentOptional Attributes Name
    class(stream_mask_t), intent(inout) :: self
    integer, intent(in) :: x
    integer, intent(in) :: y

procedure, public :: try_update_trajectory => mask_try_update_trajectory

  • private function mask_try_update_trajectory(self, x, y) result(success)

    Try to update trajectory, return false if collision occurs

    Arguments

    Type IntentOptional Attributes Name
    class(stream_mask_t), intent(inout) :: self
    integer, intent(in) :: x
    integer, intent(in) :: y

    Return Value logical

procedure, public :: undo_trajectory => mask_undo_trajectory

  • private subroutine mask_undo_trajectory(self)

    Remove current trajectory from mask (for short/bad streamlines)

    Arguments

    Type IntentOptional Attributes Name
    class(stream_mask_t), intent(inout) :: self