tetgen_io.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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 class MeshData;
38 
39 
48 // ------------------------------------------------------------
49 // TetGenIO class definition
50 class TetGenIO : public MeshInput<MeshBase>,
51  public MeshOutput<MeshBase>
52 {
53  public:
54 
59  explicit
60  TetGenIO (MeshBase& mesh, MeshData* mesh_data=NULL);
61 
66  explicit
67  TetGenIO (const MeshBase& mesh, MeshData* mesh_data=NULL);
68 
73  virtual void read (const std::string& );
74 
79  virtual void write (const std::string& );
80 
85  std::vector<std::vector<Real> > node_attributes;
86 
91  std::vector<std::vector<Real> > element_attributes;
92 
93  private:
94 
95 
96  //-------------------------------------------------------------
97  // read support methods
98 
103  void read_nodes_and_elem (std::istream& node_stream,
104  std::istream& ele_stream);
105 
115  void node_in (std::istream& node_stream);
116 
124  void element_in (std::istream& ele_stream);
125 
126  //-------------------------------------------------------------
127  // local data
128 
132  std::map<dof_id_type,dof_id_type> _assign_nodes;
133 
138 
143 
149 };
150 
151 
152 
153 // ------------------------------------------------------------
154 // TetGenIO inline members
155 inline
157  MeshInput<MeshBase> (mesh),
158  MeshOutput<MeshBase>(mesh),
159  _mesh_data(mesh_data)
160 {
161 }
162 
163 
164 
165 inline
166 TetGenIO::TetGenIO (const MeshBase& mesh, MeshData* mesh_data) :
167  MeshOutput<MeshBase>(mesh),
168  _mesh_data(mesh_data)
169 {
170 }
171 
172 
173 } // namespace libMesh
174 
175 
176 #endif // LIBMESH_TETGEN_IO_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo