41 use mpi_f08,
only : mpi_mode_rdonly, mpi_info_null, &
42 mpi_file_open, mpi_file_read_all, mpi_file, mpi_status, &
61 class(*),
target,
intent(in) :: data
62 real(kind=
rp),
intent(in),
optional :: t
63 call neko_log%error(
'Not implemented')
68 class(*),
target,
intent(inout) :: data
70 type(mpi_status) :: status
72 type(
point_t),
target :: p1, p2, p3
75 integer :: i, p_idx, ierr
77 call this%check_exists()
86 call mpi_file_open(
neko_comm, trim(this%fname), &
87 mpi_mode_rdonly, mpi_info_null, fh, ierr)
88 call mpi_file_read_all(fh, stl_hdr, 1,
mpi_stl_header, status, ierr)
90 if (stl_hdr%hdr(1:6) .eq.
'solid')
then
91 call neko_log%error(
'Invalid STL file (ASCII)')
94 call tri_msh%init(stl_hdr%ntri)
95 allocate(stl_tri(stl_hdr%ntri))
97 call mpi_file_read_all(fh, stl_tri, stl_hdr%ntri, &
101 do i = 1, stl_hdr%ntri
103 p1 =
point_t(dble(stl_tri(i)%v1), p_idx)
105 p2 =
point_t(dble(stl_tri(i)%v2), p_idx)
107 p3 =
point_t(dble(stl_tri(i)%v3), p_idx)
108 call tri_msh%add_element(p1, p2, p3)
113 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 .