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)