Neko
0.8.1
A portable framework for high-order spectral element flow simulations
|
Module containing Signed Distance Functions. More...
Functions/Subroutines | |
subroutine | signed_distance_field (field_data, object, max_distance) |
Signed distance field. More... | |
subroutine | signed_distance_field_tri_mesh (field_data, mesh, max_distance) |
Signed distance field for a triangular mesh. More... | |
real(kind=dp) function | tri_mesh_brute_force (mesh, p, max_distance) |
Signed distance function. More... | |
real(kind=dp) function | tri_mesh_aabb_tree (tree, object_list, p, max_distance) |
Signed distance function using an AABB tree. More... | |
subroutine | element_distance (element, p, distance, weighted_sign) |
Main interface for the signed distance function for an element. More... | |
subroutine | element_distance_triangle (triangle, p, distance, weighted_sign) |
Signed distance function for a triangle. More... | |
pure real(kind=dp) function, dimension(3) | cross (a, b) |
Compute cross product of two vectors. More... | |
Module containing Signed Distance Functions.
pure real(kind=dp) function, dimension(3) signed_distance::cross | ( | real(kind=dp), dimension(3), intent(in) | a, |
real(kind=dp), dimension(3), intent(in) | b | ||
) |
Compute cross product of two vectors.
[in] | a | First vector |
[in] | b | Second vector |
Definition at line 420 of file signed_distance.f90.
subroutine signed_distance::element_distance | ( | class(*), intent(in) | element, |
real(kind=dp), dimension(3), intent(in) | p, | ||
real(kind=dp), intent(out) | distance, | ||
real(kind=dp), intent(out), optional | weighted_sign | ||
) |
Main interface for the signed distance function for an element.
Definition at line 308 of file signed_distance.f90.
subroutine signed_distance::element_distance_triangle | ( | type(tri_t), intent(in) | triangle, |
real(kind=dp), dimension(3), intent(in) | p, | ||
real(kind=dp), intent(out) | distance, | ||
real(kind=dp), intent(out), optional | weighted_sign | ||
) |
Signed distance function for a triangle.
This routine computes the signed distance function for the current triangle. We compute the barycentric coordinate of the point projected onto the triangle. If the projection is inside the triangle, the distance is the distance to the plane. If the projection is outside the triangle, the distance is the distance to the nearest edge or vertex.
In order to improve precision of the sign estimation, we also compute the weighted sign, which is the perpendicular distance to the plane divided by the distance to the nearest point.
@Note The returned distance is signed if the weighted_sign is not present.
this | Triangle |
p | Point |
Definition at line 344 of file signed_distance.f90.
subroutine signed_distance::signed_distance_field | ( | type(field_t), intent(inout) | field_data, |
class(*), intent(in) | object, | ||
real(kind=dp), intent(in), optional | max_distance | ||
) |
Signed distance field.
This routine computes the signed distance field for a given object.
Currently supported objects are:
[in,out] | field_data | Field data |
[in] | object | Object |
[in,optional] | max_distance Maximum distance outside the mesh |
Definition at line 55 of file signed_distance.f90.
subroutine signed_distance::signed_distance_field_tri_mesh | ( | type(field_t), intent(inout) | field_data, |
type(tri_mesh_t), intent(in) | mesh, | ||
real(kind=dp), intent(in) | max_distance | ||
) |
Signed distance field for a triangular mesh.
This routine computes the signed distance field for a given triangular mesh. The algorithm utilizes an AABB tree to accelerate the earch for potential elements. The signed distance is computed using the brute force approach, where we compute the signed distance to each element found through the AABB tree, and return the minimum distance.
[in,out] | field_data | Field data |
[in] | mesh | Triangular mesh |
[in] | max_distance | Maximum distance outside the mesh |
Definition at line 91 of file signed_distance.f90.
real(kind=dp) function signed_distance::tri_mesh_aabb_tree | ( | class(aabb_tree_t), intent(in) | tree, |
class(tri_t), dimension(:), intent(in) | object_list, | ||
real(kind=dp), dimension(3), intent(in) | p, | ||
real(kind=dp), intent(in) | max_distance | ||
) |
Signed distance function using an AABB tree.
This routine computes the signed distance function for the boundary mesh, to a given point (x, y, z). The algorithm utilizes an AABB tree to accelerate the search for potential elements. The signed distance is computed using the brute force approach, where we compute the signed distance to each element found through the AABB tree, and return the minimum distance.
tree | AABB tree |
object_list | List of objects |
p | Point |
max_distance | Maximum distance outside the mesh |
Definition at line 188 of file signed_distance.f90.
real(kind=dp) function signed_distance::tri_mesh_brute_force | ( | type(tri_mesh_t), intent(in) | mesh, |
real(kind=dp), dimension(3), intent(in) | p, | ||
real(kind=dp), intent(in) | max_distance | ||
) |
Signed distance function.
This routine computes the signed distance function for the boundary mesh, to a given point (x, y, z). The algorithm is a brute force approach, where we compute the signed distance to each element in the mesh, and return the minimum distance.
p | Point |
mesh | Boundary mesh |
Definition at line 139 of file signed_distance.f90.