tem_line_module Module

for lines



Interfaces

public interface init

initialize the dynamic array

  • private subroutine init_ga_line(me, length)

    Arguments

    Type IntentOptional Attributes Name
    type(grw_linearray_type), intent(out) :: me
    integer, intent(in), optional :: length

public interface truncate

truncate the array, meaning cut off the trailing empty entries

public interface empty

empty the entries without changing arrays

public interface destroy

destroy the dynamic array

public interface placeat

insert an element at a given position

  • private subroutine placeat_ga_line(me, val, pos, length)

    adds the value to a given position inside the growing array.

    if the requested position is outside the current array bounds, the array will be resized accordingly. if it is inside the current array bounds, the element at the requested position will be replaced.

    Arguments

    Type IntentOptional Attributes Name
    type(grw_linearray_type) :: me
    type(tem_line_type), intent(in) :: val
    integer, intent(in) :: pos
    integer, intent(in), optional :: length

    optional length to expand the array

  • private subroutine placeat_ga_line_vec(me, val, pos, length)

    adds the values starting from a given position inside the growing array.

    if the requested position is outside the current array bounds, the array will be resized accordingly. if it is inside the current array bounds, the elements starting from the requested position will be replaced up to the element at position pos + size(val) - 1.

    Arguments

    Type IntentOptional Attributes Name
    type(grw_linearray_type) :: me
    type(tem_line_type), intent(in) :: val(:)
    integer, intent(in) :: pos
    integer, intent(in), optional :: length

    optional length to expand the array

public interface append

append a value to the dynamic array and return its position.

  • private subroutine append_ga_line(me, val, length)

    Arguments

    Type IntentOptional Attributes Name
    type(grw_linearray_type) :: me
    type(tem_line_type), intent(in) :: val
    integer, intent(in), optional :: length

    optional length to expand the array

  • private subroutine append_ga_line_vec(me, val, length)

    Arguments

    Type IntentOptional Attributes Name
    type(grw_linearray_type) :: me
    type(tem_line_type), intent(in) :: val(:)
    integer, intent(in), optional :: length

    optional length to expand the array

private interface expand

increase the size of the container for the array.

  • private subroutine expand_ga_line(me, pos, length)

    Arguments

    Type IntentOptional Attributes Name
    type(grw_linearray_type) :: me
    integer, intent(in), optional :: pos
    integer, intent(in), optional :: length

    optional length to expand the array


Derived Types

type, public ::  tem_line_type

This type contains line definition i.e origin and vector which defines the direction of the line

Components

Type Visibility Attributes Name Initial
real(kind=rk), public :: origin(3)
real(kind=rk), public :: vec(3)

type, public ::  grw_linearray_type

growing array type for type(tem_line_type)

Components

Type Visibility Attributes Name Initial
integer, public :: nvals = 0
integer, public :: containersize = 0
type(tem_line_type), public, allocatable :: val(:)

Functions

public function tem_lineCubeOverlap(line, cube, pntIntersect) result(overlap)

Function computes intersection of line with cube

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_line_type), intent(in) :: line

line segment to check for intersection

type(tem_cube_type), intent(in) :: cube

cube to intersect with

real(kind=rk), intent(out), optional :: pntIntersect(3)

intersection point if there is intersection

Return Value logical

public function intersect_RayTriangle(line, triangle, intersect_p) result(isIntersect)

Function computes intersection of ray with triangle

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_line_type), intent(in) :: line

line segment to check for interection

type(tem_triangle_type), intent(in) :: triangle

cube to check intersection of line

type(tem_point_type), intent(out), optional :: intersect_p

intersection point if there is intersection

Return Value logical

public function fraction_PointLine(point, line) result(frac)

This evaluates relative distance of given point on line

Arguments

Type IntentOptional Attributes Name
type(tem_point_type), intent(in) :: point
type(tem_line_type), intent(in) :: line

Return Value real(kind=rk)

private function rayCubeOverlap(line, cube, pntIntersect) result(overlap)

Function computes intersection of ray with cube

Read more…

Arguments

Type IntentOptional Attributes Name
type(tem_line_type), intent(in) :: line

line segment to check for interection

type(tem_cube_type), intent(in) :: cube

cube to check intersection of line

real(kind=rk), intent(out), optional :: pntIntersect(3)

intersection point if there is intersection

Return Value logical


Subroutines

private subroutine init_ga_line(me, length)

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type), intent(out) :: me
integer, intent(in), optional :: length

private subroutine destroy_ga_line(me)

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type), intent(inout) :: me

private subroutine truncate_ga_line(me)

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type) :: me

private subroutine empty_ga_line(me)

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type) :: me

private subroutine placeat_ga_line(me, val, pos, length)

adds the value to a given position inside the growing array.

Read more…

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type) :: me
type(tem_line_type), intent(in) :: val
integer, intent(in) :: pos
integer, intent(in), optional :: length

optional length to expand the array

private subroutine placeat_ga_line_vec(me, val, pos, length)

adds the values starting from a given position inside the growing array.

Read more…

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type) :: me
type(tem_line_type), intent(in) :: val(:)
integer, intent(in) :: pos
integer, intent(in), optional :: length

optional length to expand the array

private subroutine append_ga_line(me, val, length)

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type) :: me
type(tem_line_type), intent(in) :: val
integer, intent(in), optional :: length

optional length to expand the array

private subroutine append_ga_line_vec(me, val, length)

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type) :: me
type(tem_line_type), intent(in) :: val(:)
integer, intent(in), optional :: length

optional length to expand the array

private subroutine expand_ga_line(me, pos, length)

Arguments

Type IntentOptional Attributes Name
type(grw_linearray_type) :: me
integer, intent(in), optional :: pos
integer, intent(in), optional :: length

optional length to expand the array