tem_geometry_module Module

Geometric methods for the TreElM module to act on a octree based mesh. Make sure to read the introduction to the distributed octree in the Documentation.

This module contains methods that work with the actual sparse mesh, and therefore depends on the treelmesh_module.


Uses

  • module~~tem_geometry_module~~UsesGraph module~tem_geometry_module tem_geometry_module module~tem_float_module tem_float_module module~tem_geometry_module->module~tem_float_module module~tem_topology_module tem_topology_module module~tem_geometry_module->module~tem_topology_module module~tem_property_module tem_property_module module~tem_geometry_module->module~tem_property_module module~treelmesh_module treelmesh_module module~tem_geometry_module->module~treelmesh_module module~env_module env_module module~tem_geometry_module->module~env_module module~tem_logging_module tem_logging_module module~tem_geometry_module->module~tem_logging_module module~tem_subtree_type_module tem_subTree_type_module module~tem_geometry_module->module~tem_subtree_type_module module~tem_tools_module tem_tools_module module~tem_geometry_module->module~tem_tools_module module~tem_debug_module tem_debug_module module~tem_geometry_module->module~tem_debug_module module~tem_param_module tem_param_module module~tem_geometry_module->module~tem_param_module mpi mpi module~tem_geometry_module->mpi module~tem_float_module->module~env_module module~tem_topology_module->module~env_module module~tem_property_module->module~env_module module~tem_property_module->mpi module~tem_prophead_module tem_prophead_module module~tem_property_module->module~tem_prophead_module module~treelmesh_module->module~tem_topology_module module~treelmesh_module->module~tem_property_module module~treelmesh_module->module~env_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~tem_sparta_module tem_Sparta_module module~treelmesh_module->module~tem_sparta_module module~tem_aux_module tem_aux_module module~treelmesh_module->module~tem_aux_module module~aot_table_module aot_table_module module~treelmesh_module->module~aot_table_module module~aotus_module aotus_module module~treelmesh_module->module~aotus_module module~env_module->mpi module~flu_binding flu_binding module~env_module->module~flu_binding iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env module~env_module->module~aotus_module module~tem_logging_module->module~env_module module~tem_logging_module->module~aot_table_module module~tem_logging_module->module~aotus_module module~tem_subtree_type_module->module~tem_property_module module~tem_subtree_type_module->module~treelmesh_module module~tem_subtree_type_module->module~env_module module~tem_subtree_type_module->module~tem_logging_module module~tem_subtree_type_module->mpi module~tem_subtree_type_module->module~tem_global_module module~tem_subtree_type_module->module~tem_aux_module module~tem_tools_module->module~env_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_debug_module->module~aot_table_module module~tem_param_module->module~env_module module~tem_global_module->module~env_module module~tem_global_module->module~tem_logging_module module~tem_global_module->mpi module~tem_global_module->module~tem_aux_module module~tem_global_module->module~aot_table_module module~tem_global_module->module~aotus_module module~tem_global_module->module~tem_prophead_module module~aot_out_module aot_out_module module~tem_global_module->module~aot_out_module module~tem_sparta_module->module~tem_float_module module~tem_sparta_module->module~env_module module~tem_sparta_module->module~tem_logging_module module~tem_sparta_module->mpi module~tem_sparta_module->module~tem_aux_module module~tem_aux_module->module~env_module module~tem_aux_module->module~tem_logging_module module~tem_aux_module->module~tem_tools_module module~tem_aux_module->mpi module~tem_aux_module->module~flu_binding module~tem_aux_module->module~aot_table_module module~tem_aux_module->module~aotus_module module~tem_revision_module tem_revision_module module~tem_aux_module->module~tem_revision_module module~tem_lua_requires_module tem_lua_requires_module module~tem_aux_module->module~tem_lua_requires_module module~tem_comm_env_module tem_comm_env_module module~tem_aux_module->module~tem_comm_env_module module~tem_prophead_module->module~env_module module~tem_prophead_module->mpi module~tem_prophead_module->module~aot_table_module module~tem_prophead_module->module~aotus_module module~tem_prophead_module->module~aot_out_module module~tem_lua_requires_module->module~env_module module~tem_lua_requires_module->module~flu_binding module~tem_lua_requires_module->module~aot_table_module module~tem_lua_requires_module->module~aotus_module iso_c_binding iso_c_binding module~tem_lua_requires_module->iso_c_binding module~tem_comm_env_module->mpi

Used by

  • module~~tem_geometry_module~~UsedByGraph module~tem_geometry_module tem_geometry_module module~tem_spacetime_var_module tem_spacetime_var_module module~tem_spacetime_var_module->module~tem_geometry_module module~tem_shape_module tem_shape_module module~tem_shape_module->module~tem_geometry_module module~tem_intersection_module tem_intersection_module module~tem_intersection_module->module~tem_geometry_module module~tem_reduction_spatial_module tem_reduction_spatial_module module~tem_reduction_spatial_module->module~tem_geometry_module module~tem_vrtx_module tem_vrtx_module module~tem_vrtx_module->module~tem_geometry_module module~tem_construction_module tem_construction_module module~tem_construction_module->module~tem_geometry_module module~hvs_ascii_module hvs_ascii_module module~hvs_ascii_module->module~tem_geometry_module module~tem_surfacedata_module tem_surfaceData_module module~tem_surfacedata_module->module~tem_geometry_module program~tem_logical_opertor_test tem_logical_opertor_test program~tem_logical_opertor_test->module~tem_geometry_module module~hvs_output_module hvs_output_module module~hvs_output_module->module~tem_geometry_module module~tem_cube_module tem_cube_module module~tem_cube_module->module~tem_geometry_module module~tem_convergence_module tem_convergence_module module~tem_convergence_module->module~tem_geometry_module module~tem_refining_module tem_refining_module module~tem_refining_module->module~tem_geometry_module module~tem_meshinfo_module tem_meshInfo_module module~tem_meshinfo_module->module~tem_geometry_module module~tem_spatial_module tem_spatial_module module~tem_spatial_module->module~tem_geometry_module module~tem_spacetime_fun_module tem_spacetime_fun_module module~tem_spacetime_fun_module->module~tem_geometry_module module~tem_spongelayer_module tem_spongeLayer_module module~tem_spongelayer_module->module~tem_geometry_module module~tem_stencil_module tem_stencil_module module~tem_stencil_module->module~tem_geometry_module program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test program~tem_varsys_stfunvar_test->module~tem_geometry_module module~tem_pointdata_module tem_pointData_module module~tem_pointdata_module->module~tem_geometry_module module~tem_canonicalnd_module tem_canonicalND_module module~tem_canonicalnd_module->module~tem_geometry_module module~tem_face_module tem_face_module module~tem_face_module->module~tem_geometry_module module~tem_subtree_module tem_subTree_module module~tem_subtree_module->module~tem_geometry_module program~tem_varsys_opvar_test tem_varSys_opVar_test program~tem_varsys_opvar_test->module~tem_geometry_module

Contents


Interfaces

public interface tem_intp_bilinear

  • private function tem_intp_bilinear_scalar(srcVal, targetCoord) result(phi)

    This function returns the bi-linearly interpolated values from the four source points to the target position located at targetCoord. The source points are arranged in a square from (0,0)x(1,1) The order of the source points are according to the morton curve 1 2 3 4 (0,0); (1,0); (0,1); (1,1)

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: srcVal(4)

    source values of the square corners

    real(kind=rk), intent(in) :: targetCoord(2)

    interpolation location within the square

    Return Value real(kind=rk)

    interpolated value

  • private function tem_intp_bilinear_vec(srcVal, targetCoord, nVals) result(phi)

    This function returns the bi-linearly interpolated values from the four source points to the target position located at targetCoord. The source points are arranged in a square from (0,0)x(1,1) The order of the source points are according to the morton curve 1 2 3 4 (0,0); (1,0); (0,1); (1,1)

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: srcVal(nVals,4)

    source values of the square corners

    real(kind=rk), intent(in) :: targetCoord(2)

    interpolation location within the square

    integer, intent(in) :: nVals

    number of values

    Return Value real(kind=rk)(nVals)

    interpolated values

public interface tem_intp_trilinear

  • private function tem_intp_trilinear_scalar(srcVal, targetCoord) result(phi)

    This function returns the tri-linearly interpolated values from the eight source points to the target position located at targetCoord. The source points are arranged in a square from (0,0,0)x(1,1,1) The order of the source points are according to the morton curve 1 2 3 4 (0,0,0); (1,0,0); (0,1,0); (1,1,0) 5 6 7 8 (0,0,1); (1,0,1); (0,1,1); (1,1,1)

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: srcVal(8)

    source values of the square corners

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

    interpolation location within the square

    Return Value real(kind=rk)

    interpolated value

  • private function tem_intp_trilinear_vec(srcVal, targetCoord, nVals) result(phi)

    This function returns the tri-linearly interpolated values from the eight source points to the target position located at targetCoord. The source points are arranged in a square from (0,0,0)x(1,1,1) The order of the source points are according to the morton curve 1 2 3 4 (0,0,0); (1,0,0); (0,1,0); (1,1,0) 5 6 7 8 (0,0,1); (1,0,1); (0,1,1); (1,1,1)

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: srcVal(nVals,8)

    source values of the square corners

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

    interpolation location within the square

    integer, intent(in) :: nVals

    number of values

    Return Value real(kind=rk)(nVals)

    interpolated value

public interface tem_setEffBoundingBox

public interface tem_GetLocalBoundingCube

  • private function tem_GetLocalBoundingCube_fromTree(tree) result(BoundingCube)

    Run through all the elements, check the vertices and return the fluid bounding cube

    Arguments

    TypeIntentOptionalAttributesName
    type(treelmesh_type), intent(in) :: tree

    global mesh information

    Return Value real(kind=rk)(3,2)

    xyz coordinate for min and max of bounding cube

  • private function tem_GetLocalBoundingCube_fromSubTree(subTree, globalTree) result(BoundingCube)

    Run through all the elements, check the vertices and return the fluid bounding cube

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_subTree_type), intent(in) :: subTree

    subTree to locate point in

    type(treelmesh_type), intent(in) :: globalTree

    corresponding global tree

    Return Value real(kind=rk)(3,2)

    xyz coordinate for min and max of bounding cube


Derived Types

type, public :: tem_direction_type

derived type for each direction

Components

TypeVisibilityAttributesNameInitial
type(tem_longList), private, pointer:: first=> null()

first entry of the element list

integer, private :: nElems

number of entries in element list

integer, private :: list

which list JZ:(whether it is fluid, ghost or halo, see tem_levelDesc_type)

integer, private :: pos

position in list

logical, private :: otherLevel =.false.

the current neighbors are of a different level

type, public :: tem_neighbor_type

type neighbor_type includes the direct neighbors of each tree ID

Components

TypeVisibilityAttributesNameInitial
integer, private :: nNeighborDirections

number of directions in which the neighbors are located e.g. for cubes and surface neighbors this will be 6 and for cubes with surface, edge and vertex neighbors this will be 22 because stencils will be mapped by this type as well, we are not able to use it as a constant directions for this neighbor JZ: in case of reconstructed DG this has to be extended to all JZ: cells inside the stencil

type(tem_direction_type), private, allocatable:: dir(:)

Functions

public pure function tem_CoordOfReal(mesh, point, level) result(coord)

This function returns a coordinate in the given treelmesh for a physical point location on the finest possible level.

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: mesh
real(kind=rk), intent(in) :: point(3)
integer, intent(in), optional :: level

coordinate on

Return Value integer(4)

public pure function tem_ElemSizeLevel(tree, level) result(dx)

Return the size of elements on a given levle in the mesh by taking into account the size of the bounding cube given in the global info of the tree

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

Mesh to locate the point in

integer, intent(in) :: level

given level to get the size for

Return Value real(kind=rk)

size of Element

public pure function tem_ElemSize(tree, treeID) result(dx)

Return the size of a given treeID in the mesh by taking into account the size of the bounding cube given in the global info of the tree

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

Mesh to locate point in

integer(kind=long_k), intent(in) :: treeID

input elements

Return Value real(kind=rk)

size of element

public pure function tem_BaryOfId(tree, TreeID) result(bary)

The following function provides the coordinates of the barycenter for a given treeID in the complete mesh.

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

mesh information

integer(kind=long_k), intent(in) :: TreeID

input Element ID

Return Value real(kind=rk)(3)

barycenter return value

public pure function tem_originOfId(tree, TreeID) result(origin)

The following function provides the coordinates of the origin for a given ID in the complete mesh.

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

mesh information

integer(kind=long_k), intent(in) :: TreeID

input element ID

Return Value real(kind=rk)(3)

origin return value

public pure function tem_endOfId(tree, TreeID) result(origin)

The following function provides the coordinates of the end for a given ID in the complete mesh. The described element lies between the origin and this end point.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

mesh information

integer(kind=long_k), intent(in) :: TreeID

input element ID

Return Value real(kind=rk)(3)

origin return value

public pure function tem_BaryOfCoord(coord, nPoints, origin, dx) result(bary)

This function provides the coordinates of the element barycenters for a set of given element coordinates on the same refinement level.

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: coord(nPoints,3)
integer, intent(in) :: nPoints
real(kind=rk), intent(in) :: origin(3)

spatial index triple for a given ID

real(kind=rk), intent(in) :: dx

Return Value real(kind=rk)(nPoints,3)

public pure function tem_vrtxCoordOfId(tree, treeID) result(coord)

Calculate all eight vertex coordinates of a given tree ID

Read more…

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

complete tree for info about dimensions

integer(kind=long_k), intent(in) :: treeID

input element ID

Return Value real(kind=rk)(3,8)

all vertices coordinates function return value

public pure function tem_PosOfId(sTreeID, treeIDlist, lower, upper) result(IdPos)

This subroutine does a binary search on a given (sparse) list of elements. The result is the position of the given tree ID in the list, 0 if no corresponding node is found, or the negative of the found ID, if it is a virtual node.

Read more…

Arguments

TypeIntentOptionalAttributesName
integer(kind=long_k), intent(in) :: sTreeID

tree ID to search for

integer(kind=long_k), intent(in) :: treeIDlist(:)

List to search in

integer, intent(in), optional :: lower

lowerbound of search interval

integer, intent(in), optional :: upper

upperbound of search interval

Return Value integer

position of sTreeID in the list of elements

public pure function tem_PosOfPath(sPath, Pathlist, lower, upper) result(IdPos)

Find the position of a specific path in the list of all paths.

Arguments

TypeIntentOptionalAttributesName
type(tem_path_type), intent(in) :: sPath

Specific path to search.

type(tem_path_type), intent(in) :: Pathlist(:)

List of paths for all elements to search in.

integer, intent(in), optional :: lower

Possibly only search on a subinterval, starting at PathList(lower:)

integer, intent(in), optional :: upper

Possibly only search on a subinterval, ending at PathList(:upper)

Return Value integer

Position where sPath is found in Pathlist

private function tem_GetLocalBoundingCube_fromTree(tree) result(BoundingCube)

Run through all the elements, check the vertices and return the fluid bounding cube

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

global mesh information

Return Value real(kind=rk)(3,2)

xyz coordinate for min and max of bounding cube

private function tem_GetLocalBoundingCube_fromSubTree(subTree, globalTree) result(BoundingCube)

Run through all the elements, check the vertices and return the fluid bounding cube

Arguments

TypeIntentOptionalAttributesName
type(tem_subTree_type), intent(in) :: subTree

subTree to locate point in

type(treelmesh_type), intent(in) :: globalTree

corresponding global tree

Return Value real(kind=rk)(3,2)

xyz coordinate for min and max of bounding cube

private function tem_intp_bilinear_scalar(srcVal, targetCoord) result(phi)

This function returns the bi-linearly interpolated values from the four source points to the target position located at targetCoord. The source points are arranged in a square from (0,0)x(1,1) The order of the source points are according to the morton curve 1 2 3 4 (0,0); (1,0); (0,1); (1,1)

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: srcVal(4)

source values of the square corners

real(kind=rk), intent(in) :: targetCoord(2)

interpolation location within the square

Return Value real(kind=rk)

interpolated value

private function tem_intp_bilinear_vec(srcVal, targetCoord, nVals) result(phi)

This function returns the bi-linearly interpolated values from the four source points to the target position located at targetCoord. The source points are arranged in a square from (0,0)x(1,1) The order of the source points are according to the morton curve 1 2 3 4 (0,0); (1,0); (0,1); (1,1)

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: srcVal(nVals,4)

source values of the square corners

real(kind=rk), intent(in) :: targetCoord(2)

interpolation location within the square

integer, intent(in) :: nVals

number of values

Return Value real(kind=rk)(nVals)

interpolated values

private function tem_intp_trilinear_scalar(srcVal, targetCoord) result(phi)

This function returns the tri-linearly interpolated values from the eight source points to the target position located at targetCoord. The source points are arranged in a square from (0,0,0)x(1,1,1) The order of the source points are according to the morton curve 1 2 3 4 (0,0,0); (1,0,0); (0,1,0); (1,1,0) 5 6 7 8 (0,0,1); (1,0,1); (0,1,1); (1,1,1)

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: srcVal(8)

source values of the square corners

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

interpolation location within the square

Return Value real(kind=rk)

interpolated value

private function tem_intp_trilinear_vec(srcVal, targetCoord, nVals) result(phi)

This function returns the tri-linearly interpolated values from the eight source points to the target position located at targetCoord. The source points are arranged in a square from (0,0,0)x(1,1,1) The order of the source points are according to the morton curve 1 2 3 4 (0,0,0); (1,0,0); (0,1,0); (1,1,0) 5 6 7 8 (0,0,1); (1,0,1); (0,1,1); (1,1,1)

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: srcVal(nVals,8)

source values of the square corners

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

interpolation location within the square

integer, intent(in) :: nVals

number of values

Return Value real(kind=rk)(nVals)

interpolated value

private function tem_GetRealBoundingCube(tree) result(boundingCube)

Calculate the real bounding box around the fluid domain and return only to root (efficiency reasons)

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(in) :: tree

Return Value real(kind=rk)(3,2)


Subroutines

public subroutine tem_tIDinfo(me, tree, nUnit)

Prints information about a treeID to a file unit.

Arguments

TypeIntentOptionalAttributesName
integer(kind=long_k), intent(in) :: me

given level to get the size for

type(treelmesh_type), intent(in) :: tree

Mesh to locate the point in

integer, intent(in), optional :: nUnit

the file unit to use for printing the information.

public pure subroutine tem_eligibleChildren(eligible_child, direction)

Identify all possible children local ids for each of the 27 direct neighbors results are saved in the ElemList

Read more…

Arguments

TypeIntentOptionalAttributesName
integer, intent(out), allocatable:: eligible_child(:)

Candidate children, which might be considered as neighbors

integer, intent(in) :: direction

In which direction to search for neighbors

public recursive subroutine tem_findElement(TreeID, eligible_child, ElemList, treeIDlist, nElems, Part_First, Part_Last, otherLevel)

Recursive routine to find all actual (eligible) leave nodes in the local partition for a given treeID. Alternatively use tem_findPath, which uses precomputed paths in the tree and should speed up the search (at the expense of storing the paths beforehand).

Arguments

TypeIntentOptionalAttributesName
integer(kind=long_k) :: TreeID

TreeID to find in the array of Elements

integer :: eligible_child(:)

Candidate childs, which might be considered as neighbors

type(tem_longList), pointer:: ElemList

linked list of resulting elements building the neighbor

integer(kind=long_k), intent(in) :: treeIDlist(nElems)

array of treeIDs

integer, intent(in) :: nElems

number of elements in list

integer(kind=long_k), intent(in) :: Part_First(:)

parts first entry

integer(kind=long_k), intent(in) :: Part_Last(:)

parts last entry

logical, intent(inout), optional :: otherLevel

entry is on another level

public recursive subroutine tem_findPath(Path, eligible_child, ElemList, pathlist, nElems, otherLevel)

Recursive routine to find all actual (eligible) leave nodes in the local partition for a given treeID.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(tem_path_type), intent(in) :: Path

Path to the leaf to find in the array of Elements

integer, intent(in) :: eligible_child(:)

Candidate childs, which might be considered as neighbors

type(tem_longList), pointer:: ElemList

linked list of resulting elements building the neighbor

type(tem_path_type), intent(in) :: pathlist(nElems)

array of paths

integer, intent(in) :: nElems

number of elements in list

logical, intent(inout), optional :: otherLevel

entry is on another level

public subroutine tem_determine_discreteVector(vector, compareVector, angle)

Compare the incoming discrete vector against a set of prevailing vectors and return the found closest prevailing integer vector

Read more…

Arguments

TypeIntentOptionalAttributesName
integer, intent(inout) :: vector(:)

The given vector, will be set to the vector in compareVector that is best aligned to it.

real(kind=rk), intent(in) :: compareVector(:,:)

Set of unit vectors to select from against. size is (3, nVectors)

real(kind=rk), intent(out), optional :: angle

angle between vectors

public subroutine tem_build_treeToProp_pointer(treeToProp, nElems, ElemPropertyBits, prp_bit)

This routine builds mapping from tree%treeID to given property data array like boundary_ID or qVal

Arguments

TypeIntentOptionalAttributesName
integer, intent(out) :: treeToProp(nElems)

Pointer from tree to property data to be filled by this routine

integer :: nElems

mesh elements

integer(kind=long_k), intent(in) :: ElemPropertyBits(nElems)

Elements Property Bits

integer, intent(in) :: prp_bit

property bit

private subroutine tem_setEffBoundingBox_fromTree(tree)

Calculate the real bounding box around the fluid domain

Arguments

TypeIntentOptionalAttributesName
type(treelmesh_type), intent(inout) :: tree

Mesh

private subroutine tem_setEffBoundingBox_fromSubTree(subTree, globalTree)

Calculate the real bounding box around the fluid domain

Arguments

TypeIntentOptionalAttributesName
type(tem_subTree_type) :: subTree

subTree to get effective bounding cube from

type(treelmesh_type), intent(in) :: globalTree

corresponding global tree