\brief Module to describe triangles. Contains triangle type with vertices of the triangle
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | tem_triangle_close_invalid | = | 0 |
Indicating that the proximity evaluation for this triangle is invalid |
integer, | public, | parameter | :: | tem_triangle_close_face | = | 1 |
Indicating that the closest point in the proximity test resides within the triangle |
integer, | public, | parameter | :: | tem_triangle_close_edge | = | 2 |
Indicating that the closest point in the proximity test resides on an edge of the triangle |
integer, | public, | parameter | :: | tem_triangle_close_vertex | = | 3 |
Indicating that the closest point in the proximity test resides on a vertex of the triangle |
initialize the dynamic array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type), | intent(out) | :: | me | |||
integer, | intent(in), | optional | :: | length |
truncate the array, meaning cut off the trailing empty entries
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me |
empty the entries without changing arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me |
destroy the dynamic array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type), | intent(inout) | :: | me |
insert an element at a given position
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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
append a value to the dynamic array and return its position.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me | ||||
type(tem_triangle_type), | intent(in) | :: | val | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me | ||||
type(tem_triangle_type), | intent(in) | :: | val(:) | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
interface to write out triangles in lua format to a file
Write out a triangle shape in lua format
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Write out an array of triangles in lua format Only if nTriangles <= 10
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
increase the size of the container for the array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me | ||||
integer, | intent(in), | optional | :: | pos | ||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
interface to load triangles
interface to load triangles
Load single triangle from config file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
This type contains three vertices of the triangle
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rk), | public | :: | nodes(3,3) |
1st index contains x,y,z coordinates and 2nd index the vertex number. |
|||
real(kind=rk), | public | :: | normal(3) |
growing array type for type(tem_triangle_type)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nvals | = | 0 | ||
integer, | public | :: | containersize | = | 0 | ||
type(tem_triangle_type), | public, | allocatable | :: | val(:) |
Compute, if the triangle intersects the cube.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_triangle_type), | intent(in) | :: | triangle | |||
type(tem_cube_type), | intent(in) | :: | cube |
This routine checks for triangle box overlap
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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) |
This routine checks for plane box overlap this routine is conversion of c-code tribox3.c planeBoxOverlap function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Load triangle information from config file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Compute, the outward normal of a triangle. To work nodes must be in counter-clockwise order. For STL this is the standard. It follows pg 136 of Jiri Blaze, CFD Principles and Applications
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_triangle_type), | intent(inout) | :: | triangle |
Compute the point of the triangle closest to the given point
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_triangle_type), | intent(in) | :: | me | |||
real(kind=rk), | intent(in) | :: | point(3) | |||
real(kind=rk), | intent(out) | :: | closest(3) | |||
integer, | intent(out) | :: | closekind | |||
real(kind=rk), | intent(out) | :: | distance | |||
real(kind=rk), | intent(out) | :: | normal(3) |
Load single triangle from config file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Write out an array of triangles in lua format Only if nTriangles <= 10
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Write out a triangle shape in lua format
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type), | intent(out) | :: | me | |||
integer, | intent(in), | optional | :: | length |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type), | intent(inout) | :: | me |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me |
adds the value to a given position inside the growing array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
adds the values starting from a given position inside the growing array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me | ||||
type(tem_triangle_type), | intent(in) | :: | val | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me | ||||
type(tem_triangle_type), | intent(in) | :: | val(:) | |||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grw_trianglearray_type) | :: | me | ||||
integer, | intent(in), | optional | :: | pos | ||
integer, | intent(in), | optional | :: | length |
optional length to expand the array |