41 use mpi_f08,
only : mpi_mode_rdonly, mpi_info_null, &
42 mpi_file_open, mpi_file_read_all, mpi_file, mpi_status, &
60 class(*),
target,
intent(in) :: data
61 real(kind=
rp),
intent(in),
optional :: t
62 call neko_log%error(
'Not implemented')
67 class(*),
target,
intent(inout) :: data
69 type(mpi_status) :: status
71 type(
point_t),
target :: p1, p2, p3
74 integer :: i, p_idx, ierr
76 call this%check_exists()
85 call mpi_file_open(
neko_comm, trim(this%get_fname()), &
86 mpi_mode_rdonly, mpi_info_null, fh, ierr)
87 call mpi_file_read_all(fh, stl_hdr, 1,
mpi_stl_header, status, ierr)
89 if (stl_hdr%hdr(1:6) .eq.
'solid')
then
90 call neko_log%error(
'Invalid STL file (ASCII)')
93 call tri_msh%init(stl_hdr%ntri)
94 allocate(stl_tri(stl_hdr%ntri))
96 call mpi_file_read_all(fh, stl_tri, stl_hdr%ntri, &
100 do i = 1, stl_hdr%ntri
102 call p1%init(dble(stl_tri(i)%v1), p_idx)
104 call p2%init(dble(stl_tri(i)%v2), p_idx)
106 call p3%init(dble(stl_tri(i)%v3), p_idx)
107 call tri_msh%add_element(p1, p2, p3)
112 call mpi_file_close(fh, ierr)
type(mpi_comm), public neko_comm
MPI communicator.
type(log_t), public neko_log
Global log stream.
type(mpi_datatype), public mpi_stl_header
MPI Derived type for a STL header.
type(mpi_datatype), public mpi_stl_triangle
MPI derived type for a STL triangle.
integer, parameter, public rp
Global precision used in computations.
Stereolithography (STL) file.
subroutine stl_file_write(this, data, t)
subroutine stl_file_read(this, data)
Stereolithography format.
Defines a triangular surface mesh.
A point in with coordinates .