Geometrical shape definitions for pre-defined bodies
This module provides data types and definitions for pre-defined geometrical objects such as points, lines, planes, and cubes.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | tem_global_shape | = | 0 |
Parameters for different tracking shapes Global mesh |
integer, | public, | parameter | :: | tem_geometrical_shape | = | 1 |
treelm geometrical object like canoND, sphere, cylinder, eclipse, triangle STL (STLs are converted further into triangles) |
integer, | public, | parameter | :: | tem_property_shape | = | 2 |
elements that has a certain property |
integer, | public, | parameter | :: | tem_local_shape | = | 3 |
elements on the local partition |
integer, | public, | parameter | :: | tem_boundary_shape | = | 4 |
elements of one or more boundaries |
integer, | public, | parameter | :: | tem_level_shape | = | 5 |
elements of certain levels |
Write a shape to lua file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(in) | :: | me |
shape types to write out |
||
type(aot_out_type), | intent(inout) | :: | conf |
Aotus type handling the output to the file in lua format |
Write a array of shapes to lua file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(in) | :: | me(:) |
shape types to write out |
||
type(aot_out_type), | intent(inout) | :: | conf |
Aotus type handling the output to the file in lua format |
Read in an arbitrary shapes from a lua file defined as multiple tables
read a shape like for example inside a tracking table
tracking = {
{variable = { 'velocity' },
shape = { kind = 'canoND',
object = { origin = { 1.0, 1.0, 1.0 },
vec = { 2.0, 2.0, 2.0 },
segments = { 10, 20, 30 } }
}}
} -- tracking table
elements that has a certain property can also be tracked. This feature enables us to track boundary elements.
tracking = {
{ variable = { 'velocity' },
shape = { kind = 'property',
property = {'boundary'} },
}
}
} -- tracking table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(out), | allocatable | :: | me(:) |
array of shape type defined in a lua file |
|
type(flu_State) | :: | conf |
lua config file to load shape from |
|||
integer, | intent(in), | optional | :: | parent |
optional parent handle |
|
character(len=*), | intent(in), | optional | :: | key |
optional key to load from |
|
integer, | intent(out), | optional | :: | iError |
error flag |
|
logical, | intent(in), | optional | :: | reqSegments |
Is true if use_get_point is true in output table |
Read in an arbitrary shape from a lua file defined in a single table
read a shape like for example inside a tracking table
tracking = { variable = { 'velocity' },
shape = { kind = 'canoND',
object = { origin = { 1.0, 1.0, 1.0 },
vec = { 2.0, 2.0, 2.0 },
segments = { 10, 20, 30 } }
}
} -- tracking table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(out) | :: | me |
shape type defined in a lua file |
||
type(flu_State) | :: | conf |
lua state |
|||
character(len=*), | intent(in), | optional | :: | key |
optional key to load from |
|
integer, | intent(in), | optional | :: | parent |
optional parent handle |
|
integer, | intent(in), | optional | :: | sub_table |
shape table handle |
|
integer, | intent(out), | optional | :: | iError |
error flag |
|
logical, | intent(in), | optional | :: | reqSegments |
Is true if use_get_point is true in output table |
Complete shape definitions
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=labelLen), | public | :: | kind |
a kind of the shape defined. |
|||
integer, | public | :: | shapeID | = | 0 |
a identification for the shape |
|
type(tem_canonicalND_type), | public, | allocatable | :: | canoND(:) |
canonical definition |
||
type(tem_triangle_type), | public, | allocatable | :: | triangle(:) |
triangle definition |
||
type(tem_stlData_type), | public | :: | stl_data |
STL definition |
|||
type(tem_sphere_type), | public, | allocatable | :: | sphere(:) |
spheres definition |
||
type(tem_ellipsoid_type), | public, | allocatable | :: | ellipsoid(:) |
ellipsoid definition |
||
type(tem_cylinder_type), | public, | allocatable | :: | cylinder(:) |
cylinder definition |
||
integer(kind=long_k), | public | :: | propBits | = | 0_long_k |
property bits |
|
character(len=labelLen), | public, | allocatable | :: | bcLabels(:) |
boundary labels, used to identify elements belong to these boundaries It is allocated and set in routine: tem_shape_load_bcLabels |
||
real(kind=rk), | public | :: | cutOffQVal |
boundary elements below this threshold are omitted |
|||
integer, | public | :: | minLevel | = | 1 |
level range for level shape type |
|
integer, | public | :: | maxLevel | = | globalMaxLevels | ||
logical, | public | :: | inverted | = | .false. |
If true then subTree is created for inverted shape i.e nonintersected |
Identify elements matching a given shape to build a subTree.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(in) | :: | me |
The shape to identify elements for |
||
integer, | intent(in) | :: | iShape |
Numbering of the shape (only for logging) |
||
type(treelmesh_type), | intent(in) | :: | inTree |
The tree to look in for elements that match the shape definition |
||
logical, | intent(in) | :: | storePnts |
Whether to store point values |
||
type(dyn_intarray_type), | intent(inout) | :: | map2global |
Mapping to global elements in the tree |
||
type(tem_grwPoints_type), | intent(inout) | :: | grwPnts |
Growing list of Points to be observed |
||
integer, | intent(out) | :: | countElems(globalMaxLevels) |
Number of elements on each level matching the shape |
||
integer, | intent(out) | :: | countPnts |
Number of points to be observed |
||
integer, | intent(out), | allocatable | :: | bcIDs(:) |
Field of boundary ids that are to be tracked |
|
type(tem_BC_prop_type), | intent(in), | optional | :: | bc_prop |
Boundary condition property to identify boundary elements |
|
type(tem_stencilHeader_type), | intent(in), | optional | :: | stencil |
Stencil associated with the boundary to find respective neighbors |
Read in an arbitrary shapes from a lua file defined as multiple tables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(out), | allocatable | :: | me(:) |
array of shape type defined in a lua file |
|
type(flu_State) | :: | conf |
lua config file to load shape from |
|||
integer, | intent(in), | optional | :: | parent |
optional parent handle |
|
character(len=*), | intent(in), | optional | :: | key |
optional key to load from |
|
integer, | intent(out), | optional | :: | iError |
error flag |
|
logical, | intent(in), | optional | :: | reqSegments |
Is true if use_get_point is true in output table |
Read in an arbitrary shape from a lua file defined in a single table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(out) | :: | me |
shape type defined in a lua file |
||
type(flu_State) | :: | conf |
lua state |
|||
character(len=*), | intent(in), | optional | :: | key |
optional key to load from |
|
integer, | intent(in), | optional | :: | parent |
optional parent handle |
|
integer, | intent(in), | optional | :: | sub_table |
shape table handle |
|
integer, | intent(out), | optional | :: | iError |
error flag |
|
logical, | intent(in), | optional | :: | reqSegments |
Is true if use_get_point is true in output table |
This routine creates subTree from geometry intersection
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(in) | :: | me |
shape objects on which to work |
||
type(treelmesh_type), | intent(in) | :: | inTree |
Global tree |
||
integer, | intent(inout) | :: | countElems(globalMaxLevels) |
How many elements there will be for each level in the track |
||
integer, | intent(inout) | :: | countPoints |
How many points there will be |
||
type(tem_grwPoints_type), | intent(inout) | :: | grwPnts |
growing array to store tracking points |
||
logical, | intent(in) | :: | storePnts |
to Store points in grwPnts |
||
type(dyn_intarray_type), | intent(inout) | :: | map2global |
growing array for the map2global |
Write a array of shapes to lua file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(in) | :: | me(:) |
shape types to write out |
||
type(aot_out_type), | intent(inout) | :: | conf |
Aotus type handling the output to the file in lua format |
Write a shape to lua file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_shape_type), | intent(in) | :: | me |
shape types to write out |
||
type(aot_out_type), | intent(inout) | :: | conf |
Aotus type handling the output to the file in lua format |
Loading property labels from the config file, set the property bits accordingly
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k) | :: | propBits |
propBits |
|||
type(flu_State) | :: | conf |
lua config handle |
|||
integer, | intent(in) | :: | thandle |
table handle from which to read |
Loading bc labels from the config file, save those labels for further use.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=labelLen), | allocatable | :: | bcLabels(:) |
bc labels |
||
type(flu_State) | :: | conf |
lua config handle |
|||
integer, | intent(in) | :: | thandle |
table handle from which to read |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | minLevel |
level range |
|||
integer | :: | maxLevel |
level range |
|||
type(flu_State) | :: | conf |
lua config handle |
|||
integer, | intent(in) | :: | thandle |
table handle from which to read |
Write out a shape level in lua format
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | minLevel |
Minlevel and maxlevel |
||
integer, | intent(in) | :: | maxLevel |
Minlevel and maxlevel |
||
type(aot_out_type), | intent(inout) | :: | conf |
Aotus type handling the output to the file in lua format |
Write out a shape property label in lua format
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | propBits |
property bits |
||
type(aot_out_type), | intent(inout) | :: | conf |
Aotus type handling the output to the file in lua format |
Write out a shape boundary label in lua format
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=labelLen), | intent(in) | :: | bcLabels(:) |
Boundary labels |
||
type(aot_out_type), | intent(inout) | :: | conf |
Aotus type handling the output to the file in lua format |
This routine identifies elements that belong to certain bounaries. Labels of required boundaries are given by bcLabels. bc_prop contains boudnary_ID of all local elements. Firstly, bcLabels are converted into bcIDs. Then all elements in bc_prop are looped over to check if it matches one of the required bcID. If match, its position is save in map2global. Number of elements found on each level is saved in countElems.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=labelLen), | intent(in) | :: | bcLabels(:) |
bcLabels |
||
real(kind=rk), | intent(in) | :: | cutOffQVal |
Cut off qValue |
||
type(tem_BC_prop_type), | intent(in) | :: | bc_prop |
bc property |
||
logical, | intent(out) | :: | foundAny |
if any element be identified |
||
type(dyn_intarray_type), | intent(inout) | :: | map2global |
dynamic array. Elements positions in bc_prop%property%elemID |
||
type(treelmesh_type), | intent(in) | :: | inTree |
Global tree |
||
integer, | intent(inout) | :: | countPoints |
How many points there will be |
||
type(tem_grwPoints_type), | intent(inout) | :: | grwPnts |
growing array to store tracking points |
||
logical, | intent(in) | :: | storePnts |
to Store points in grwPnts |
||
integer, | intent(out), | allocatable | :: | bcIDs(:) |
id of boundary condition to be tracked |
|
type(tem_stencilHeader_type), | intent(in), | optional | :: | stencil |
stencil required to get useful links |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(treelmesh_type), | intent(in) | :: | inTree |
Global mesh from which the elements are identified and then stored to |
||
integer, | intent(in) | :: | minLevel |
level range of target elements |
||
integer, | intent(in) | :: | maxLevel |
level range of target elements |
||
integer, | intent(out) | :: | countElems(globalMaxLevels) |
How many elements there will be for each level in the track |
||
type(dyn_intarray_type), | intent(inout) | :: | map2global |
growing array. Elements positions in inTree%treeID |
This routine identify all the elements in inTree that has a certain property bit, save their positions in inTree into array: map2global, save the number of these elements into level wise array: countElems (e.g. for shape kind='property').
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=long_k), | intent(in) | :: | propBits |
shape objects on which to work |
||
type(treelmesh_type), | intent(in) | :: | inTree |
Global mesh from which the elements are identified and then stored to |
||
integer, | intent(out) | :: | countElems(globalMaxLevels) |
How many elements there will be for each level in the track |
||
type(dyn_intarray_type), | intent(inout) | :: | map2global |
growing array. Elements positions in inTree%treeID |