|
MFC
Exascale flow solver
|
Binary STL file reader and processor for immersed boundary geometry. More...
Functions/Subroutines | |
| impure subroutine | s_read_stl_binary (filepath, model) |
| Read a binary STL file. | |
| impure subroutine | s_read_stl_ascii (filepath, model) |
| Read an ASCII STL file. | |
| impure subroutine | s_read_stl (filepath, model) |
| Read an STL file. | |
| impure subroutine | s_read_obj (filepath, model) |
| Read an OBJ file. | |
| impure type(t_model) function, public | f_model_read (filepath) |
| Read a mesh from a file. | |
| impure subroutine | s_write_stl (filepath, model) |
| Write a binary STL file. | |
| impure subroutine | s_write_obj (filepath, model) |
| Write an OBJ file. | |
| impure subroutine, public | s_model_write (filepath, model) |
| Write a mesh to a file. | |
| subroutine, public | s_model_free (model) |
| Free the memory allocated for an STL mesh. | |
| impure logical function | f_read_line (iunit, line) |
| Read the next non-blank, non-comment line from an STL or OBJ model file. | |
| impure subroutine | s_skip_ignored_lines (iunit, buffered_line, is_buffered) |
| Read the next non-comment line from a model file, using a buffered look-ahead mechanism. | |
| real(wp) function | f_model_random_number (seed) |
| Generate a pseudo-random number using a seed-based xorshift, replacing the Fortran intrinsic which is incompatible with GPU routines. | |
| impure real(wp) function, public | f_model_is_inside (model, point, spacing, spc) |
| Determine whether a point is inside a model using stochastic ray casting. | |
| real(wp) function, public | f_model_is_inside_flat (ntrs, pid, point) |
| Determine if a point is inside a surface using the generalized winding number (Jacobson et al., SIGGRAPH 2013). In 3D, sums the solid angle subtended by each triangle (Van Oosterom-Strackee formula). In 2D (p==0), sums the signed angle subtended by each boundary edge. Returns ~1.0 inside, ~0.0 outside. Unlike ray casting, this is robust to small triangles/edges and vertex winding order. | |
| integer function | f_intersects_triangle (ray, triangle) |
| Check if a ray intersects a triangle using the Moller-Trumbore algorithm (barycentric coordinates). Unlike the previous cross-product sign test, this is vertex winding-order independent. | |
| subroutine, public | s_check_boundary (model, boundary_v, boundary_vertex_count, boundary_edge_count) |
| Check and label edges shared by two or more triangle facets of the 2D STL model. | |
| subroutine, public | s_register_edge (temp_boundary_v, edge, edge_index, edge_count) |
| Append the edge end vertices to a temporary buffer. | |
| subroutine, public | s_distance_normals_3d (ntrs, pid, point, normals, distance) |
| Determine the levelset distance and normals of 3D models by computing the exact closest point via projection onto triangle surfaces. | |
| subroutine, public | s_distance_normals_2d (pid, boundary_edge_count, point, normals, distance) |
| Determine the levelset distance and normals of 2D models by computing the exact closest point via projection onto boundary edges. | |
| subroutine, public | s_instantiate_stl_models () |
| Load, transform, and register STL/OBJ immersed-boundary models onto the simulation grid. | |
| subroutine, public | s_pack_model_for_gpu (ma) |
| Pack triangle vertices and normals from a model into flat arrays for GPU transfer. | |
Variables | |
| type(t_model_array), dimension(:), allocatable, target, public | models |
| STL/OBJ models for IB markers and levelset. | |
| integer, dimension(:), allocatable, public | gpu_ntrs |
| GPU-friendly flat arrays for STL model data. | |
| real(wp), dimension(:,:,:,:), allocatable, public | gpu_trs_v |
| real(wp), dimension(:,:,:), allocatable, public | gpu_trs_n |
| real(wp), dimension(:,:,:,:), allocatable, public | gpu_boundary_v |
| integer, dimension(:), allocatable, public | gpu_boundary_edge_count |
| integer, dimension(:), allocatable, public | gpu_total_vertices |
| real(wp), dimension(:,:,:), allocatable, public | stl_bounding_boxes |
Binary STL file reader and processor for immersed boundary geometry.
|
private |
Check if a ray intersects a triangle using the Moller-Trumbore algorithm (barycentric coordinates). Unlike the previous cross-product sign test, this is vertex winding-order independent.
Definition at line 935 of file m_model.fpp.f90.
| impure real(wp) function, public m_model::f_model_is_inside | ( | type(t_model), intent(in) | model, |
| real(wp), dimension(1:3), intent(in) | point, | ||
| real(wp), dimension(1:3), intent(in) | spacing, | ||
| integer, intent(in) | spc ) |
Determine whether a point is inside a model using stochastic ray casting.
| spc | Number of samples per cell. |
Definition at line 802 of file m_model.fpp.f90.
| real(wp) function, public m_model::f_model_is_inside_flat | ( | integer, intent(in) | ntrs, |
| integer, intent(in) | pid, | ||
| real(wp), dimension(1:3), intent(in) | point ) |
Determine if a point is inside a surface using the generalized winding number (Jacobson et al., SIGGRAPH 2013). In 3D, sums the solid angle subtended by each triangle (Van Oosterom-Strackee formula). In 2D (p==0), sums the signed angle subtended by each boundary edge. Returns ~1.0 inside, ~0.0 outside. Unlike ray casting, this is robust to small triangles/edges and vertex winding order.
Definition at line 858 of file m_model.fpp.f90.
|
private |
Generate a pseudo-random number using a seed-based xorshift, replacing the Fortran intrinsic which is incompatible with GPU routines.
Definition at line 785 of file m_model.fpp.f90.
| impure type(t_model) function, public m_model::f_model_read | ( | character(len=*), intent(in) | filepath | ) |
Read a mesh from a file.
Definition at line 612 of file m_model.fpp.f90.
|
private |
Read the next non-blank, non-comment line from an STL or OBJ model file.
Definition at line 735 of file m_model.fpp.f90.
| subroutine, public m_model::s_check_boundary | ( | type(t_model), intent(in) | model, |
| real(wp), dimension(:,:,:), intent(out), allocatable | boundary_v, | ||
| integer, intent(out) | boundary_vertex_count, | ||
| integer, intent(out) | boundary_edge_count ) |
Check and label edges shared by two or more triangle facets of the 2D STL model.
| [out] | boundary_v | Output boundary vertices/normals |
| [out] | boundary_edge_count | Output boundary vertex/edge count |
Definition at line 987 of file m_model.fpp.f90.
| subroutine, public m_model::s_distance_normals_2d | ( | integer, intent(in) | pid, |
| integer, intent(in) | boundary_edge_count, | ||
| real(wp), dimension(1:3), intent(in) | point, | ||
| real(wp), dimension(1:3), intent(out) | normals, | ||
| real(wp), intent(out) | distance ) |
Determine the levelset distance and normals of 2D models by computing the exact closest point via projection onto boundary edges.
Definition at line 1299 of file m_model.fpp.f90.
| subroutine, public m_model::s_distance_normals_3d | ( | integer, intent(in) | ntrs, |
| integer, intent(in) | pid, | ||
| real(wp), dimension(1:3), intent(in) | point, | ||
| real(wp), dimension(1:3), intent(out) | normals, | ||
| real(wp), intent(out) | distance ) |
Determine the levelset distance and normals of 3D models by computing the exact closest point via projection onto triangle surfaces.
Definition at line 1155 of file m_model.fpp.f90.
| subroutine, public m_model::s_instantiate_stl_models |
Load, transform, and register STL/OBJ immersed-boundary models onto the simulation grid.
Definition at line 1382 of file m_model.fpp.f90.
| subroutine, public m_model::s_model_free | ( | type(t_model), intent(inout) | model | ) |
Free the memory allocated for an STL mesh.
Definition at line 726 of file m_model.fpp.f90.
| impure subroutine, public m_model::s_model_write | ( | character(len=*), intent(in) | filepath, |
| type(t_model), intent(in) | model ) |
Write a mesh to a file.
Definition at line 707 of file m_model.fpp.f90.
| subroutine, public m_model::s_pack_model_for_gpu | ( | type(t_model_array), intent(inout) | ma | ) |
Pack triangle vertices and normals from a model into flat arrays for GPU transfer.
Definition at line 1757 of file m_model.fpp.f90.
|
private |
Read an OBJ file.
Definition at line 543 of file m_model.fpp.f90.
|
private |
Read an STL file.
Definition at line 515 of file m_model.fpp.f90.
|
private |
Read an ASCII STL file.
Definition at line 407 of file m_model.fpp.f90.
|
private |
Read a binary STL file.
Definition at line 363 of file m_model.fpp.f90.
| subroutine, public m_model::s_register_edge | ( | real(wp), dimension(1:edge_count,1:2,1:2), intent(inout) | temp_boundary_v, |
| real(wp), dimension(1:2,1:2), intent(in) | edge, | ||
| integer, intent(inout) | edge_index, | ||
| integer, intent(inout) | edge_count ) |
Append the edge end vertices to a temporary buffer.
| [in,out] | edge_index | Edge index iterator |
| [in,out] | edge_count | Total number of edges |
| [in] | edge | Edges end points to be registered |
| [in,out] | temp_boundary_v | Temporary edge end vertex buffer |
Definition at line 1139 of file m_model.fpp.f90.
|
private |
Read the next non-comment line from a model file, using a buffered look-ahead mechanism.
Definition at line 764 of file m_model.fpp.f90.
|
private |
Write an OBJ file.
Definition at line 676 of file m_model.fpp.f90.
|
private |
Write a binary STL file.
Definition at line 631 of file m_model.fpp.f90.
| integer, dimension(:), allocatable, public m_model::gpu_boundary_edge_count |
Definition at line 345 of file m_model.fpp.f90.
| real(wp), dimension(:,:,:,:), allocatable, public m_model::gpu_boundary_v |
Definition at line 344 of file m_model.fpp.f90.
| integer, dimension(:), allocatable, public m_model::gpu_ntrs |
GPU-friendly flat arrays for STL model data.
Definition at line 341 of file m_model.fpp.f90.
| integer, dimension(:), allocatable, public m_model::gpu_total_vertices |
Definition at line 346 of file m_model.fpp.f90.
| real(wp), dimension(:,:,:), allocatable, public m_model::gpu_trs_n |
Definition at line 343 of file m_model.fpp.f90.
| real(wp), dimension(:,:,:,:), allocatable, public m_model::gpu_trs_v |
Definition at line 342 of file m_model.fpp.f90.
| type(t_model_array), dimension(:), allocatable, target, public m_model::models |
STL/OBJ models for IB markers and levelset.
Definition at line 340 of file m_model.fpp.f90.
| real(wp), dimension(:,:,:), allocatable, public m_model::stl_bounding_boxes |
Definition at line 347 of file m_model.fpp.f90.