$extrastylesheet
gmsh_io.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_GMSH_IO_H
00021 #define LIBMESH_GMSH_IO_H
00022 
00023 // Local includes
00024 #include "libmesh/libmesh_common.h"
00025 #include "libmesh/mesh_input.h"
00026 #include "libmesh/mesh_output.h"
00027 
00028 // C++ includes
00029 #include <cstddef>
00030 
00031 namespace libMesh
00032 {
00033 
00034 // Forward declarations
00035 class MeshBase;
00036 
00037 
00038 
00050 // ------------------------------------------------------------
00051 // GMVIO class definition
00052 class GmshIO : public MeshInput<MeshBase>,
00053                public MeshOutput<MeshBase>
00054 {
00055 public:
00056 
00061   explicit
00062   GmshIO (MeshBase& mesh);
00063 
00068   explicit
00069   GmshIO (const MeshBase& mesh);
00070 
00078   virtual void read (const std::string& name);
00079 
00084   virtual void write (const std::string& name);
00085 
00090   virtual void write_nodal_data (const std::string&,
00091                                  const std::vector<Number>&,
00092                                  const std::vector<std::string>&);
00093 
00104   bool & binary ();
00105 
00106 
00107 private:
00113   virtual void read_mesh (std::istream& in);
00114 
00119   virtual void write_mesh (std::ostream& out);
00120 
00126   void write_post (const std::string&,
00127                    const std::vector<Number>* = NULL,
00128                    const std::vector<std::string>* = NULL);
00129 
00133   bool _binary;
00134 };
00135 
00136 
00137 } // namespace libMesh
00138 
00139 #endif // LIBMESH_GMSH_IO_H