MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_model Module Reference

Binary STL file reader and processor for immersed boundary geometry. More...

Functions/Subroutines

impure subroutine s_read_stl_binary (filepath, model)
 This procedure reads a binary STL file.
impure subroutine s_read_stl_ascii (filepath, model)
 This procedure reads an ASCII STL file.
impure subroutine s_read_stl (filepath, model)
 This procedure reads an STL file.
impure subroutine s_read_obj (filepath, model)
 This procedure reads an OBJ file.
impure type(t_model) function, public f_model_read (filepath)
 This procedure reads a mesh from a file.
impure subroutine s_write_stl (filepath, model)
 This procedure writes a binary STL file.
impure subroutine s_write_obj (filepath, model)
 This procedure writes an OBJ file.
impure subroutine, public s_model_write (filepath, model)
 This procedure writes a binary STL file.
subroutine, public s_model_free (model)
 This procedure frees the memory allocated for an STL mesh.
impure logical function f_read_line (iunit, line)
impure subroutine s_skip_ignored_lines (iunit, buffered_line, is_buffered)
 Reads the next non-comment line from a model file, using a buffered look-ahead mechanism.
real(wp) function f_model_random_number (seed)
 This function is used to replace the fortran random number generator because the native generator is not compatible being called from GPU routines/functions.
impure real(wp) function, public f_model_is_inside (model, point, spacing, spc)
 This procedure, recursively, finds whether a point is inside an octree.
real(wp) function, public f_model_is_inside_flat (ntrs, pid, point)
 This procedure, given a cell center will determine if a point exists instide a surface.
integer function f_intersects_triangle (ray, triangle)
 This procedure checks if a ray intersects a triangle.
subroutine, public s_check_boundary (model, boundary_v, boundary_vertex_count, boundary_edge_count)
 This procedure checks and labels edges shared by two or more triangles facets of the 2D STL model.
subroutine, public s_register_edge (temp_boundary_v, edge, edge_index, edge_count)
 This procedure appends the edge end vertices to a temporary buffer.
subroutine, public s_distance_normals_3d (ntrs, pid, point, normals, distance)
 This procedure determines 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)
 This procedure determines 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 ()
subroutine, public s_pack_model_for_gpu (ma)

Variables

type(t_model_array), dimension(:), allocatable, target, public models
integer, dimension(:), allocatable, public gpu_ntrs
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

Detailed Description

Binary STL file reader and processor for immersed boundary geometry.

Function/Subroutine Documentation

◆ f_intersects_triangle()

integer function m_model::f_intersects_triangle ( type(t_ray), intent(in) ray,
type(t_triangle), intent(in) triangle )
private

This procedure checks if a ray intersects a triangle.

Parameters
rayRay.
triangleTriangle.
Returns
True if the ray intersects the triangle, false otherwise.

Definition at line 956 of file m_model.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_model_is_inside()

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 )

This procedure, recursively, finds whether a point is inside an octree.

Parameters
modelModel to search in.
pointPoint to test.
spacingSpace around the point to search in (grid spacing).
spcNumber of samples per cell.
Returns
True if the point is inside the octree, false otherwise.

Definition at line 825 of file m_model.fpp.f90.

Here is the call graph for this function:

◆ f_model_is_inside_flat()

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 )

This procedure, given a cell center will determine if a point exists instide a surface.

Parameters
ntrsNumber of triangles in the model
pidPatch ID od this model
pointPoint to test.
Returns
fraction The perfentage of candidate rays cast indicate that we are inside the model

Definition at line 887 of file m_model.fpp.f90.

Here is the call graph for this function:

◆ f_model_random_number()

real(wp) function m_model::f_model_random_number ( integer, intent(inout) seed)
private

This function is used to replace the fortran random number generator because the native generator is not compatible being called from GPU routines/functions.

Definition at line 805 of file m_model.fpp.f90.

Here is the caller graph for this function:

◆ f_model_read()

impure type(t_model) function, public m_model::f_model_read ( character(len=*), intent(in) filepath)

This procedure reads a mesh from a file.

Parameters
filepathPath to the file to read.
Returns
The model read from the file.

Definition at line 618 of file m_model.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_read_line()

impure logical function m_model::f_read_line ( integer, intent(in) iunit,
character(80), intent(out) line )
private

Definition at line 754 of file m_model.fpp.f90.

Here is the caller graph for this function:

◆ s_check_boundary()

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 )

This procedure checks and labels edges shared by two or more triangles facets of the 2D STL model.

Parameters
modelModel to search in.
boundary_vertex_countOutput total boundary vertex count
[out]boundary_vOutput boundary vertices/normals
[out]boundary_edge_countOutput boundary vertex/edge count

Definition at line 1025 of file m_model.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_distance_normals_2d()

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 )

This procedure determines the levelset distance and normals of 2D models by computing the exact closest point via projection onto boundary edges.

Parameters
boundary_vFlat GPU array of boundary vertices/normals for all patches
pidPatch index into the boundary_v array
boundary_edge_countTotal number of boundary edges for this patch
pointThe cell center of the current levelset cell
normalsOutput levelset normals
distanceOutput levelset distance

Definition at line 1366 of file m_model.fpp.f90.

◆ s_distance_normals_3d()

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 )

This procedure determines the levelset distance and normals of 3D models by computing the exact closest point via projection onto triangle surfaces.

Parameters
ntrsNumber of triangles for this patch
trs_vFlat GPU array of triangle vertices for all patches
trs_nFlat GPU array of triangle normals for all patches
pidPatch index into the arrays
pointThe cell center of the current levelset cell
normalsOutput levelset normals
distanceOutput levelset distance

Definition at line 1209 of file m_model.fpp.f90.

◆ s_instantiate_stl_models()

subroutine, public m_model::s_instantiate_stl_models

Definition at line 1449 of file m_model.fpp.f90.

Here is the call graph for this function:

◆ s_model_free()

subroutine, public m_model::s_model_free ( type(t_model), intent(inout) model)

This procedure frees the memory allocated for an STL mesh.

Definition at line 746 of file m_model.fpp.f90.

◆ s_model_write()

impure subroutine, public m_model::s_model_write ( character(len=*), intent(in) filepath,
type(t_model), intent(in) model )

This procedure writes a binary STL file.

Parameters
filepathPath to the file to write.
modelModel to write.

Definition at line 727 of file m_model.fpp.f90.

Here is the call graph for this function:

◆ s_pack_model_for_gpu()

subroutine, public m_model::s_pack_model_for_gpu ( type(t_model_array), intent(inout) ma)

Definition at line 1829 of file m_model.fpp.f90.

Here is the caller graph for this function:

◆ s_read_obj()

impure subroutine m_model::s_read_obj ( character(len=*), intent(in) filepath,
type(t_model), intent(out) model )
private

This procedure reads an OBJ file.

Parameters
filepathPath to the odj file.
modelThe obj file.

Definition at line 542 of file m_model.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_read_stl()

impure subroutine m_model::s_read_stl ( character(len=*), intent(in) filepath,
type(t_model), intent(out) model )
private

This procedure reads an STL file.

Parameters
filepathPath to the STL file.
modelthe STL file.

Definition at line 508 of file m_model.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_read_stl_ascii()

impure subroutine m_model::s_read_stl_ascii ( character(len=*), intent(in) filepath,
type(t_model), intent(out) model )
private

This procedure reads an ASCII STL file.

Parameters
filepathPath to the STL file.
modelthe STL file.

Definition at line 397 of file m_model.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_read_stl_binary()

impure subroutine m_model::s_read_stl_binary ( character(len=*), intent(in) filepath,
type(t_model), intent(out) model )
private

This procedure reads a binary STL file.

Parameters
filepathPath to the STL file.
modelThe binary of the STL file.

Definition at line 346 of file m_model.fpp.f90.

Here is the caller graph for this function:

◆ s_register_edge()

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 )

This procedure appends the edge end vertices to a temporary buffer.

Parameters
[in,out]edge_indexEdge index iterator
[in,out]edge_countTotal number of edges
[in]edgeEdges end points to be registered
[in,out]temp_boundary_vTemporary edge end vertex buffer

Definition at line 1186 of file m_model.fpp.f90.

Here is the caller graph for this function:

◆ s_skip_ignored_lines()

impure subroutine m_model::s_skip_ignored_lines ( integer, intent(in) iunit,
character(80), intent(inout) buffered_line,
logical, intent(inout) is_buffered )
private

Reads the next non-comment line from a model file, using a buffered look-ahead mechanism.

Definition at line 784 of file m_model.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_write_obj()

impure subroutine m_model::s_write_obj ( character(len=*), intent(in) filepath,
type(t_model), intent(in) model )
private

This procedure writes an OBJ file.

Parameters
filepathPath to the obj file.
modelobj to write.

Definition at line 690 of file m_model.fpp.f90.

Here is the caller graph for this function:

◆ s_write_stl()

impure subroutine m_model::s_write_stl ( character(len=*), intent(in) filepath,
type(t_model), intent(in) model )
private

This procedure writes a binary STL file.

Parameters
filepathPath to the STL file.
modelSTL to write

Definition at line 640 of file m_model.fpp.f90.

Here is the caller graph for this function:

Variable Documentation

◆ gpu_boundary_edge_count

integer, dimension(:), allocatable, public m_model::gpu_boundary_edge_count

Definition at line 326 of file m_model.fpp.f90.

◆ gpu_boundary_v

real(wp), dimension(:, :, :, :), allocatable, public m_model::gpu_boundary_v

Definition at line 325 of file m_model.fpp.f90.

◆ gpu_ntrs

integer, dimension(:), allocatable, public m_model::gpu_ntrs

Definition at line 322 of file m_model.fpp.f90.

◆ gpu_total_vertices

integer, dimension(:), allocatable, public m_model::gpu_total_vertices

Definition at line 327 of file m_model.fpp.f90.

◆ gpu_trs_n

real(wp), dimension(:, :, :), allocatable, public m_model::gpu_trs_n

Definition at line 324 of file m_model.fpp.f90.

◆ gpu_trs_v

real(wp), dimension(:, :, :, :), allocatable, public m_model::gpu_trs_v

Definition at line 323 of file m_model.fpp.f90.

◆ models

type(t_model_array), dimension(:), allocatable, target, public m_model::models

Definition at line 320 of file m_model.fpp.f90.

◆ stl_bounding_boxes

real(wp), dimension(:, :, :), allocatable, public m_model::stl_bounding_boxes

Definition at line 328 of file m_model.fpp.f90.