59 class(*),
target,
intent(in) :: data
60 real(kind=
rp),
intent(in),
optional :: t
61 call neko_log%error(
'Not implemented')
66 class(*),
target,
intent(inout) :: data
68 type(mpi_status) :: status
70 type(
point_t),
target :: p1, p2, p3
73 integer :: i, p_idx, ierr
75 call this%check_exists()
84 call mpi_file_open(
neko_comm, trim(this%fname), &
85 mpi_mode_rdonly, mpi_info_null, fh, ierr)
86 call mpi_file_read_all(fh, stl_hdr, 1,
mpi_stl_header, status, ierr)
88 if (stl_hdr%hdr(1:6) .eq.
'solid')
then
89 call neko_log%error(
'Invalid STL file (ASCII)')
92 call tri_msh%init(stl_hdr%ntri)
93 allocate(stl_tri(stl_hdr%ntri))
95 call mpi_file_read_all(fh, stl_tri, stl_hdr%ntri, &
99 do i = 1, stl_hdr%ntri
101 p1 =
point_t(dble(stl_tri(i)%v1), p_idx)
103 p2 =
point_t(dble(stl_tri(i)%v2), p_idx)
105 p3 =
point_t(dble(stl_tri(i)%v3), p_idx)
106 call tri_msh%add_element(p1, p2, p3)
111 call mpi_file_close(fh, ierr)
type(mpi_comm) 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 .