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.
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)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
interpolated value
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)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
interpolated values
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)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
interpolated value
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)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
interpolated value
Calculate the real bounding box around the fluid domain
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(inout) | :: | tree | Mesh |
Calculate the real bounding box around the fluid domain
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_subTree_type) | :: | subTree | subTree to get effective bounding cube from |
|||
type(treelmesh_type), | intent(in) | :: | globalTree | corresponding global tree |
Run through all the elements, check the vertices and return the fluid bounding cube
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | global mesh information |
xyz coordinate for min and max of bounding cube
Run through all the elements, check the vertices and return the fluid bounding cube
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_subTree_type), | intent(in) | :: | subTree | subTree to locate point in |
||
type(treelmesh_type), | intent(in) | :: | globalTree | corresponding global tree |
xyz coordinate for min and max of bounding cube
derived type for each direction
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
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 neighbor_type includes the direct neighbors of each tree ID
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
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(:) |
This function returns a coordinate in the given treelmesh for a physical point location on the finest possible level.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | mesh | |||
real(kind=rk), | intent(in) | :: | point(3) | |||
integer, | intent(in), | optional | :: | level | coordinate on |
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
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | Mesh to locate the point in |
||
integer, | intent(in) | :: | level | given level to get the size for |
size of Element
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
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | Mesh to locate point in |
||
integer(kind=long_k), | intent(in) | :: | treeID | input elements |
size of element
The following function provides the coordinates of the barycenter for a given treeID in the complete mesh.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | mesh information |
||
integer(kind=long_k), | intent(in) | :: | TreeID | input Element ID |
barycenter return value
The following function provides the coordinates of the origin for a given ID in the complete mesh.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | mesh information |
||
integer(kind=long_k), | intent(in) | :: | TreeID | input element ID |
origin return value
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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | mesh information |
||
integer(kind=long_k), | intent(in) | :: | TreeID | input element ID |
origin return value
This function provides the coordinates of the element barycenters for a set of given element coordinates on the same refinement level.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Calculate all eight vertex coordinates of a given tree ID
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | complete tree for info about dimensions |
||
integer(kind=long_k), | intent(in) | :: | treeID | input element ID |
all vertices coordinates function return value
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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
position of sTreeID in the list of elements
Find the position of a specific path in the list of all paths.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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) |
Position where sPath is found in Pathlist
Run through all the elements, check the vertices and return the fluid bounding cube
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree | global mesh information |
xyz coordinate for min and max of bounding cube
Run through all the elements, check the vertices and return the fluid bounding cube
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_subTree_type), | intent(in) | :: | subTree | subTree to locate point in |
||
type(treelmesh_type), | intent(in) | :: | globalTree | corresponding global tree |
xyz coordinate for min and max of bounding cube
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)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
interpolated value
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)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
interpolated values
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)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
interpolated value
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)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
interpolated value
Calculate the real bounding box around the fluid domain and return only to root (efficiency reasons)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | tree |
Prints information about a treeID to a file unit.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
Identify all possible children local ids for each of the 27 direct neighbors results are saved in the ElemList
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Recursive routine to find all actual (eligible) leave nodes in the local partition for a given treeID.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Compare the incoming discrete vector against a set of prevailing vectors and return the found closest prevailing integer vector
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
This routine builds mapping from tree%treeID to given property data array like boundary_ID or qVal
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Calculate the real bounding box around the fluid domain
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(inout) | :: | tree | Mesh |
Calculate the real bounding box around the fluid domain
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_subTree_type) | :: | subTree | subTree to get effective bounding cube from |
|||
type(treelmesh_type), | intent(in) | :: | globalTree | corresponding global tree |