legacy_xdr_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_LEGACY_XDR_IO_H
21 #define LIBMESH_LEGACY_XDR_IO_H
22 
23 
24 // Local includes
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 class MeshData;
37 
43 // ------------------------------------------------------------
44 // LegacyXdrIO class definition
45 class LegacyXdrIO : public MeshInput<MeshBase>,
46  public MeshOutput<MeshBase>
47 {
48 
49  public:
57  enum FileFormat {DEAL=0, MGF=1, LIBM=2};
58 
66  explicit
67  LegacyXdrIO (MeshBase&, const bool=false);
68 
76  explicit
77  LegacyXdrIO (const MeshBase&, const bool=false);
78 
82  virtual ~LegacyXdrIO ();
83 
87  virtual void read (const std::string&);
88 
93  void read_mgf (const std::string&);
94 
98  virtual void write (const std::string&);
99 
104  void write_mgf (const std::string&);
105 
116  void read_mgf_soln (const std::string& name,
117  std::vector<Number>& soln,
118  std::vector<std::string>& var_names) const;
119 
129  void write_mgf_soln (const std::string& name,
130  std::vector<Number>& soln,
131  std::vector<std::string>& var_names) const;
132 
136  bool & binary();
137 
141  bool binary() const;
142 
143 
144  private:
145 
152  void read_ascii (const std::string&, const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM);
153 
160  void read_binary (const std::string&, const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM);
161 
162 
163 
173  void write_ascii (const std::string&, const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM);
174 
181  void write_binary (const std::string&, const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM);
182 
183 
187  void read_mesh (const std::string&,
189  MeshData* = NULL);
190 
194  void write_mesh (const std::string&,
196 
200  void read_soln (const std::string&,
201  std::vector<Real>&,
202  std::vector<std::string>&) const;
203 
207  void write_soln (const std::string& name,
208  std::vector<Real>& soln,
209  std::vector<std::string>&) const;
210 
211  //-------------------------------------------------------------
212  // local data
213 
217  bool _binary;
218 };
219 
220 
221 
222 } // namespace libMesh
223 
224 
225 
226 
227 #endif // LIBMESH_LEGACY_XDR_IO_H

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

Hosted By:
SourceForge.net Logo