legacy_xdr_io.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2016 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 
45 class LegacyXdrIO : public MeshInput<MeshBase>,
46  public MeshOutput<MeshBase>
47 {
48 public:
56  enum FileFormat {DEAL=0, MGF=1, LIBM=2};
57 
65  explicit
66  LegacyXdrIO (MeshBase &, const bool=false);
67 
75  explicit
76  LegacyXdrIO (const MeshBase &, const bool=false);
77 
81  virtual ~LegacyXdrIO ();
82 
86  virtual void read (const std::string &) libmesh_override;
87 
92  void read_mgf (const std::string &);
93 
97  virtual void write (const std::string &) libmesh_override;
98 
103  void write_mgf (const std::string &);
104 
115  void read_mgf_soln (const std::string & name,
116  std::vector<Number> & soln,
117  std::vector<std::string> & var_names) const;
118 
128  void write_mgf_soln (const std::string & name,
129  std::vector<Number> & soln,
130  std::vector<std::string> & var_names) const;
131 
135  bool & binary();
136 
140  bool binary() const;
141 
142 
143 private:
144 
151  void read_ascii (const std::string &,
153 
160  void read_binary (const std::string &,
161  const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM);
162 
163 
164 
174  void write_ascii (const std::string &,
175  const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM);
176 
183  void write_binary (const std::string &,
184  const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM);
185 
186 
190  void read_mesh (const std::string &,
191  const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM,
193 
197  void write_mesh (const std::string &,
198  const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM);
199 
203  void read_soln (const std::string &,
204  std::vector<Real> &,
205  std::vector<std::string> &) const;
206 
210  void write_soln (const std::string & name,
211  std::vector<Real> & soln,
212  std::vector<std::string> &) const;
213 
214  //-------------------------------------------------------------
215  // local data
216 
220  bool _binary;
221 };
222 
223 
224 
225 } // namespace libMesh
226 
227 
228 
229 
230 #endif // LIBMESH_LEGACY_XDR_IO_H
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
void read_binary(const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM)
void write_mgf(const std::string &)
void write_ascii(const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM)
LegacyXdrIO(MeshBase &, const bool=false)
Definition: legacy_xdr_io.C:57
const class libmesh_nullptr_t libmesh_nullptr
void write_binary(const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM)
virtual void write(const std::string &) libmesh_override
virtual void read(const std::string &) libmesh_override
Definition: legacy_xdr_io.C:98
void read_ascii(const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM)
void read_soln(const std::string &, std::vector< Real > &, std::vector< std::string > &) const
void write_mesh(const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void read_mesh(const std::string &, const LegacyXdrIO::FileFormat=LegacyXdrIO::LIBM, MeshData *=libmesh_nullptr)
void read_mgf(const std::string &)
void write_mgf_soln(const std::string &name, std::vector< Number > &soln, std::vector< std::string > &var_names) const
void read_mgf_soln(const std::string &name, std::vector< Number > &soln, std::vector< std::string > &var_names) const
void write_soln(const std::string &name, std::vector< Real > &soln, std::vector< std::string > &) const