Line data Source code
1 : // *****************************************************************************
2 : /*!
3 : \file src/IO/UGRIDMeshReader.hpp
4 : \copyright 2012-2015 J. Bakosi,
5 : 2016-2018 Los Alamos National Security, LLC.,
6 : 2019-2021 Triad National Security, LLC.,
7 : 2022-2025 J. Bakosi
8 : All rights reserved. See the LICENSE file for details.
9 : \brief UGRID mesh reader class declaration
10 : \details UGRID mesh reader class declaration. Mesh reader facilitating
11 : reading a mesh from a simple text file used by NASA.
12 : \see http://www.simcenter.msstate.edu/software/downloads/doc/ug_io/3d_grid_file_type_ugrid.html, http://www.simcenter.msstate.edu/software/downloads/doc/aflr3/aflr3_io_summary.html
13 : */
14 : // *****************************************************************************
15 : #ifndef UGRIDMeshReader_h
16 : #define UGRIDMeshReader_h
17 :
18 : #include <iosfwd>
19 :
20 : #include "Reader.hpp"
21 :
22 : namespace tk {
23 :
24 : class UnsMesh;
25 :
26 : //! \brief UGRIDMeshReader : tk::Reader
27 : //! \details Mesh reader class facilitating reading a mesh from a simple text
28 : //! file used by NASA.
29 : class UGRIDMeshReader : public Reader {
30 :
31 : public:
32 : //! Constructor
33 1 : explicit UGRIDMeshReader( const std::string& filename ) :
34 1 : Reader( filename ), m_nnode(0), m_ntet(0), m_ntri(0) {}
35 :
36 : //! Read UGRID mesh
37 : void readMesh( UnsMesh& mesh );
38 :
39 : private:
40 : std::size_t m_nnode; //!< Number of nodes
41 : std::size_t m_ntet; //!< Number of tetrahedra
42 : std::size_t m_ntri; //!< Number of triangles
43 :
44 : //! Read header
45 : void readHeader();
46 :
47 : //! Read nodes
48 : void readNodes( UnsMesh& mesh );
49 :
50 : //! Read element connectivity
51 : void readElements( UnsMesh& mesh );
52 : };
53 :
54 : } // tk::
55 :
56 : #endif // UGRIDMeshReader_h
|