tetgen_io.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_TETGEN_IO_H
21 #define LIBMESH_TETGEN_IO_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/mesh_input.h"
26 #include "libmesh/mesh_output.h"
27 
28 // C++ includes
29 #include <cstddef>
30 #include <map>
31 
32 namespace libMesh
33 {
34 
35 // Forward declarations
36 class MeshBase;
37 
38 
47 class TetGenIO : public MeshInput<MeshBase>,
48  public MeshOutput<MeshBase>
49 {
50 public:
51 
56  explicit
58 
63  explicit
64  TetGenIO (const MeshBase & mesh);
65 
70  virtual void read (const std::string &) override;
71 
76  virtual void write (const std::string &) override;
77 
82  std::vector<std::vector<Real>> node_attributes;
83 
95  std::vector<std::vector<Real>> element_attributes;
96 
97 private:
98 
99 
100  //-------------------------------------------------------------
101  // read support methods
102 
107  void read_nodes_and_elem (std::istream & node_stream,
108  std::istream & ele_stream);
109 
117  void node_in (std::istream & node_stream);
118 
125  void element_in (std::istream & ele_stream);
126 
127  //-------------------------------------------------------------
128  // local data
129 
133  std::map<dof_id_type,dof_id_type> _assign_nodes;
134 
139 
144 };
145 
146 
147 
148 // ------------------------------------------------------------
149 // TetGenIO inline members
150 inline
154 {
155 }
156 
157 
158 
159 inline
162 {
163 }
164 
165 
166 } // namespace libMesh
167 
168 
169 #endif // LIBMESH_TETGEN_IO_H
dof_id_type _num_elements
Definition: tetgen_io.h:143
std::map< dof_id_type, dof_id_type > _assign_nodes
Definition: tetgen_io.h:133
virtual void read(const std::string &) override
Definition: tetgen_io.C:33
MeshBase & mesh
TetGenIO(MeshBase &mesh)
Definition: tetgen_io.h:151
Base class for Mesh.
Definition: mesh_base.h:77
dof_id_type _num_nodes
Definition: tetgen_io.h:138
void read_nodes_and_elem(std::istream &node_stream, std::istream &ele_stream)
Definition: tetgen_io.C:94
virtual void write(const std::string &) override
Definition: tetgen_io.C:259
void node_in(std::istream &node_stream)
Definition: tetgen_io.C:112
void element_in(std::istream &ele_stream)
Definition: tetgen_io.C:170
std::vector< std::vector< Real > > node_attributes
Definition: tetgen_io.h:82
std::vector< std::vector< Real > > element_attributes
Definition: tetgen_io.h:95
uint8_t dof_id_type
Definition: id_types.h:64