gmsh_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_GMSH_IO_H
21 #define LIBMESH_GMSH_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 
31 namespace libMesh
32 {
33 
34 // Forward declarations
35 class MeshBase;
36 
37 
38 
49 // ------------------------------------------------------------
50 // GMVIO class definition
51 class GmshIO : public MeshInput<MeshBase>,
52  public MeshOutput<MeshBase>
53 {
54  public:
55 
60  explicit
61  GmshIO (MeshBase& mesh);
62 
67  explicit
68  GmshIO (const MeshBase& mesh);
69 
79  virtual void read (const std::string& name);
80 
85  virtual void write (const std::string& name);
86 
91  virtual void write_nodal_data (const std::string&,
92  const std::vector<Number>&,
93  const std::vector<std::string>&);
94 
105  bool & binary ();
106 
107 
108 private:
114  virtual void read_mesh (std::istream& in);
115 
120  virtual void write_mesh (std::ostream& out);
121 
127  void write_post (const std::string&,
128  const std::vector<Number>* = NULL,
129  const std::vector<std::string>* = NULL);
130 
134  bool _binary;
135 
136 
137 
138 };
139 
140 
141 
142 // ------------------------------------------------------------
143 // GmshIO inline members
144 inline
146  MeshOutput<MeshBase> (mesh),
147  _binary (false)
148 {
149 }
150 
151 
152 inline
154  MeshInput<MeshBase> (mesh),
155  MeshOutput<MeshBase> (mesh),
156  _binary (false)
157 {}
158 
159 inline
160 bool & GmshIO::binary ()
161 {
162  return _binary;
163 }
164 
165 
166 } // namespace libMesh
167 
168 #endif // LIBMESH_GMSH_IO_H

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

Hosted By:
SourceForge.net Logo