tem_triangle_module Module

\brief Module to describe triangles. Contains triangle type with vertices of the triangle


Uses

  • module~~tem_triangle_module~~UsesGraph module~tem_triangle_module tem_triangle_module module~tem_cube_module tem_cube_module module~tem_triangle_module->module~tem_cube_module module~tem_transformation_module tem_transformation_module module~tem_triangle_module->module~tem_transformation_module module~aotus_module aotus_module module~tem_triangle_module->module~aotus_module module~aot_out_module aot_out_module module~tem_triangle_module->module~aot_out_module module~aot_table_module aot_table_module module~tem_triangle_module->module~aot_table_module module~env_module env_module module~tem_triangle_module->module~env_module module~tem_aux_module tem_aux_module module~tem_triangle_module->module~tem_aux_module module~tem_math_module tem_math_module module~tem_triangle_module->module~tem_math_module module~tem_logging_module tem_logging_module module~tem_triangle_module->module~tem_logging_module module~tem_cube_module->module~aotus_module module~tem_cube_module->module~aot_table_module module~tem_cube_module->module~env_module module~tem_cube_module->module~tem_aux_module module~tem_cube_module->module~tem_logging_module module~tem_geometry_module tem_geometry_module module~tem_cube_module->module~tem_geometry_module module~treelmesh_module treelmesh_module module~tem_cube_module->module~treelmesh_module module~tem_transformation_module->module~aotus_module module~tem_transformation_module->module~aot_table_module module~tem_transformation_module->module~env_module module~tem_transformation_module->module~tem_aux_module module~tem_transformation_module->module~tem_logging_module module~tem_tools_module tem_tools_module module~tem_transformation_module->module~tem_tools_module module~flu_binding flu_binding module~tem_transformation_module->module~flu_binding module~env_module->module~aotus_module module~env_module->module~flu_binding mpi mpi module~env_module->mpi iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env module~tem_aux_module->module~aotus_module module~tem_aux_module->module~aot_table_module module~tem_aux_module->module~env_module module~tem_aux_module->module~tem_logging_module module~tem_revision_module tem_revision_module module~tem_aux_module->module~tem_revision_module module~tem_aux_module->module~tem_tools_module module~tem_aux_module->module~flu_binding module~tem_lua_requires_module tem_lua_requires_module module~tem_aux_module->module~tem_lua_requires_module module~tem_aux_module->mpi module~tem_comm_env_module tem_comm_env_module module~tem_aux_module->module~tem_comm_env_module module~tem_math_module->module~env_module module~tem_math_module->module~tem_aux_module module~tem_math_module->module~tem_logging_module module~tem_matrix_module tem_matrix_module module~tem_math_module->module~tem_matrix_module module~tem_logging_module->module~aotus_module module~tem_logging_module->module~aot_table_module module~tem_logging_module->module~env_module module~tem_tools_module->module~env_module module~tem_geometry_module->module~env_module module~tem_geometry_module->module~tem_logging_module module~tem_geometry_module->module~tem_tools_module module~tem_geometry_module->module~treelmesh_module module~tem_geometry_module->mpi module~tem_property_module tem_property_module module~tem_geometry_module->module~tem_property_module module~tem_param_module tem_param_module module~tem_geometry_module->module~tem_param_module module~tem_float_module tem_float_module module~tem_geometry_module->module~tem_float_module module~tem_debug_module tem_debug_module module~tem_geometry_module->module~tem_debug_module module~tem_subtree_type_module tem_subTree_type_module module~tem_geometry_module->module~tem_subtree_type_module module~tem_topology_module tem_topology_module module~tem_geometry_module->module~tem_topology_module module~tem_lua_requires_module->module~aotus_module module~tem_lua_requires_module->module~aot_table_module module~tem_lua_requires_module->module~env_module module~tem_lua_requires_module->module~flu_binding iso_c_binding iso_c_binding module~tem_lua_requires_module->iso_c_binding module~treelmesh_module->module~aotus_module module~treelmesh_module->module~aot_table_module module~treelmesh_module->module~env_module module~treelmesh_module->module~tem_aux_module module~treelmesh_module->module~tem_logging_module module~treelmesh_module->module~tem_tools_module module~treelmesh_module->mpi module~tem_global_module tem_global_module module~treelmesh_module->module~tem_global_module module~treelmesh_module->module~tem_property_module module~tem_sparta_module tem_Sparta_module module~treelmesh_module->module~tem_sparta_module module~treelmesh_module->module~tem_topology_module module~tem_matrix_module->module~env_module module~tem_matrix_module->module~tem_aux_module module~tem_matrix_module->module~tem_logging_module module~tem_matrix_module->module~tem_param_module module~tem_dyn_array_module tem_dyn_array_module module~tem_matrix_module->module~tem_dyn_array_module module~tem_matrix_module->module~tem_float_module module~tem_matrix_module->module~tem_debug_module module~tem_grow_array_module tem_grow_array_module module~tem_matrix_module->module~tem_grow_array_module module~tem_comm_env_module->mpi module~tem_global_module->module~aotus_module module~tem_global_module->module~aot_out_module module~tem_global_module->module~aot_table_module module~tem_global_module->module~env_module module~tem_global_module->module~tem_aux_module module~tem_global_module->module~tem_logging_module module~tem_global_module->mpi module~tem_prophead_module tem_prophead_module module~tem_global_module->module~tem_prophead_module module~tem_property_module->module~env_module module~tem_property_module->mpi module~tem_property_module->module~tem_prophead_module module~tem_param_module->module~env_module module~tem_dyn_array_module->module~env_module module~tem_float_module->module~env_module module~tem_sparta_module->module~env_module module~tem_sparta_module->module~tem_aux_module module~tem_sparta_module->module~tem_logging_module module~tem_sparta_module->mpi module~tem_sparta_module->module~tem_float_module module~tem_debug_module->module~aot_table_module module~tem_debug_module->module~env_module module~tem_debug_module->module~tem_logging_module module~tem_debug_module->module~tem_tools_module module~tem_debug_module->module~flu_binding module~tem_subtree_type_module->module~env_module module~tem_subtree_type_module->module~tem_aux_module module~tem_subtree_type_module->module~tem_logging_module module~tem_subtree_type_module->module~treelmesh_module module~tem_subtree_type_module->mpi module~tem_subtree_type_module->module~tem_global_module module~tem_subtree_type_module->module~tem_property_module module~tem_grow_array_module->module~env_module module~tem_topology_module->module~env_module

Used by

  • module~~tem_triangle_module~~UsedByGraph module~tem_triangle_module tem_triangle_module module~tem_stl_module tem_stl_module module~tem_stl_module->module~tem_triangle_module module~tem_line_module tem_line_module module~tem_line_module->module~tem_triangle_module module~tem_shape_module tem_shape_module module~tem_shape_module->module~tem_triangle_module module~tem_shape_module->module~tem_stl_module module~tem_plane_module tem_plane_module module~tem_plane_module->module~tem_triangle_module module~tem_subtree_module tem_subTree_module module~tem_subtree_module->module~tem_shape_module module~hvs_ascii_module hvs_ascii_module module~hvs_ascii_module->module~tem_shape_module module~tem_spacetime_fun_module tem_spacetime_fun_module module~tem_spacetime_fun_module->module~tem_shape_module module~tem_spatial_module tem_spatial_module module~tem_spatial_module->module~tem_shape_module module~tem_cylinder_module tem_cylinder_module module~tem_cylinder_module->module~tem_line_module module~tem_box_module tem_box_module module~tem_box_module->module~tem_plane_module module~tem_tracking_module tem_tracking_module module~tem_tracking_module->module~tem_shape_module module~hvs_output_module hvs_output_module module~hvs_output_module->module~tem_shape_module module~tem_canonicalnd_module tem_canonicalND_module module~tem_canonicalnd_module->module~tem_line_module module~tem_canonicalnd_module->module~tem_plane_module module~tem_convergence_module tem_convergence_module module~tem_convergence_module->module~tem_shape_module

Contents


Interfaces

public interface init

initialize the dynamic array

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_triangle(me, val, pos, length)

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

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(grw_trianglearray_type) :: me
    type(tem_triangle_type), intent(in) :: val
    integer, intent(in) :: pos
    integer, intent(in), optional :: length

    optional length to expand the array

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

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

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(grw_trianglearray_type) :: me
    type(tem_triangle_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.

public interface tem_triangle_out

interface to write out triangles in lua format to a file

  • private subroutine tem_triangle_out_scal(me, conf)

    Write out a triangle shape in lua format

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_triangle_type), intent(in) :: me

    triangle types to write out

    type(aot_out_type), intent(inout) :: conf

    Aotus type handling the output to the file in lua format

  • private subroutine tem_triangle_out_vec(me, conf)

    Write out an array of triangles in lua format Only if nTriangles <= 10

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_triangle_type), intent(in) :: me(:)

    triangle types to write out

    type(aot_out_type), intent(inout) :: conf

    Aotus type handling the output to the file in lua format

private interface expand

increase the size of the container for the array.

  • private subroutine expand_ga_triangle(me, pos, length)

    Arguments

    TypeIntentOptionalAttributesName
    type(grw_trianglearray_type) :: me
    integer, intent(in), optional :: pos
    integer, intent(in), optional :: length

    optional length to expand the array

private interface tem_load_triangle

interface to load triangles

  • private interface tem_load_triangle()

    interface to load triangles

    Arguments

    None
  • private subroutine tem_load_triangle_single(me, transform, conf, thandle)

    Load single triangle from config file

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_triangle_type), intent(out) :: me

    single triangle

    type(tem_transformation_type), intent(in) :: transform

    transformation for spatial object

    type(flu_state) :: conf

    lua state

    integer, intent(in) :: thandle

Derived Types

type, public :: tem_triangle_type

This type contains three vertices of the triangle

Components

TypeVisibilityAttributesNameInitial
real(kind=rk), private :: nodes(3,3)

1st index contains x,y,z coordinates and 2nd index the vertex number.

type, public :: grw_trianglearray_type

growing array type for type(tem_triangle_type)

Components

TypeVisibilityAttributesNameInitial
integer, private :: nvals =0
integer, private :: containersize =0
type(tem_triangle_type), private, allocatable:: val(:)

Functions

public function tem_triangleCubeOverlap(triangle, cube) result(overlaps)

Compute, if the triangle intersects the cube.

Arguments

TypeIntentOptionalAttributesName
type(tem_triangle_type), intent(in) :: triangle
type(tem_cube_type), intent(in) :: cube

Return Value logical

private function triBoxOverlap_loc(boxCenter, boxHalfwidth, triNodes) result(overlaps)

This routine checks for triangle box overlap

Read more…

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: boxCenter(3)

box center

real(kind=rk), intent(in) :: boxHalfwidth(3)

halfwidth of the box

real(kind=rk), intent(in) :: triNodes(3,3)

nodes of the triangle 1st index denote x,y,z coordinates and 2nd index denote nodes

Return Value logical

private function Axistest(dirVec, edge, nodes, boxhalfwidth) result(success)

This function check whether there is separating axis between triangle and box. This function can be optimized by explicitly providing cross_product result see example: http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/code/tribox3.txt

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: dirVec(3)
real(kind=rk), intent(in) :: edge(3)
real(kind=rk), intent(in) :: nodes(3,3)
real(kind=rk), intent(in) :: boxhalfwidth(3)

Return Value logical

private function planeBoxOverlap(normal, origin, boxhalfwidth) result(overlaps)

This routine checks for plane box overlap this routine is conversion of c-code tribox3.c planeBoxOverlap function

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: normal(3)

normal direction of the plane

real(kind=rk), intent(in) :: origin(3)

origin of the plane

real(kind=rk), intent(in) :: boxhalfwidth(3)

halfwidth of the box

Return Value logical


Subroutines

public subroutine tem_load_triangle(me, transform, conf, thandle)

Load triangle information from config file.

Arguments

TypeIntentOptionalAttributesName
type(tem_triangle_type), intent(out), allocatable:: me(:)

array of triangles

type(tem_transformation_type), intent(in) :: transform

transformation for spatial object

type(flu_state) :: conf

lua state

integer, intent(in) :: thandle

private subroutine tem_load_triangle_single(me, transform, conf, thandle)

Load single triangle from config file

Arguments

TypeIntentOptionalAttributesName
type(tem_triangle_type), intent(out) :: me

single triangle

type(tem_transformation_type), intent(in) :: transform

transformation for spatial object

type(flu_state) :: conf

lua state

integer, intent(in) :: thandle

private subroutine tem_triangle_out_vec(me, conf)

Write out an array of triangles in lua format Only if nTriangles <= 10

Arguments

TypeIntentOptionalAttributesName
type(tem_triangle_type), intent(in) :: me(:)

triangle types to write out

type(aot_out_type), intent(inout) :: conf

Aotus type handling the output to the file in lua format

private subroutine tem_triangle_out_scal(me, conf)

Write out a triangle shape in lua format

Arguments

TypeIntentOptionalAttributesName
type(tem_triangle_type), intent(in) :: me

triangle types to write out

type(aot_out_type), intent(inout) :: conf

Aotus type handling the output to the file in lua format

private subroutine init_ga_triangle(me, length)

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type), intent(out) :: me
integer, intent(in), optional :: length

private subroutine destroy_ga_triangle(me)

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type), intent(inout) :: me

private subroutine truncate_ga_triangle(me)

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type) :: me

private subroutine empty_ga_triangle(me)

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type) :: me

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

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

Read more…

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type) :: me
type(tem_triangle_type), intent(in) :: val
integer, intent(in) :: pos
integer, intent(in), optional :: length

optional length to expand the array

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

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

Read more…

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type) :: me
type(tem_triangle_type), intent(in) :: val(:)
integer, intent(in) :: pos
integer, intent(in), optional :: length

optional length to expand the array

private subroutine append_ga_triangle(me, val, length)

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type) :: me
type(tem_triangle_type), intent(in) :: val
integer, intent(in), optional :: length

optional length to expand the array

private subroutine append_ga_triangle_vec(me, val, length)

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type) :: me
type(tem_triangle_type), intent(in) :: val(:)
integer, intent(in), optional :: length

optional length to expand the array

private subroutine expand_ga_triangle(me, pos, length)

Arguments

TypeIntentOptionalAttributesName
type(grw_trianglearray_type) :: me
integer, intent(in), optional :: pos
integer, intent(in), optional :: length

optional length to expand the array