gmsh_io.h
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 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 00049 // ------------------------------------------------------------ 00050 // GMVIO class definition 00051 class GmshIO : public MeshInput<MeshBase>, 00052 public MeshOutput<MeshBase> 00053 { 00054 public: 00055 00060 explicit 00061 GmshIO (MeshBase& mesh); 00062 00067 explicit 00068 GmshIO (const MeshBase& mesh); 00069 00079 virtual void read (const std::string& name); 00080 00085 virtual void write (const std::string& name); 00086 00091 virtual void write_nodal_data (const std::string&, 00092 const std::vector<Number>&, 00093 const std::vector<std::string>&); 00094 00105 bool & binary (); 00106 00107 00108 private: 00114 virtual void read_mesh (std::istream& in); 00115 00120 virtual void write_mesh (std::ostream& out); 00121 00127 void write_post (const std::string&, 00128 const std::vector<Number>* = NULL, 00129 const std::vector<std::string>* = NULL); 00130 00134 bool _binary; 00135 00136 00137 00138 }; 00139 00140 00141 00142 // ------------------------------------------------------------ 00143 // GmshIO inline members 00144 inline 00145 GmshIO::GmshIO (const MeshBase& mesh) : 00146 MeshOutput<MeshBase> (mesh), 00147 _binary (false) 00148 { 00149 } 00150 00151 00152 inline 00153 GmshIO::GmshIO (MeshBase& mesh) : 00154 MeshInput<MeshBase> (mesh), 00155 MeshOutput<MeshBase> (mesh), 00156 _binary (false) 00157 {} 00158 00159 inline 00160 bool & GmshIO::binary () 00161 { 00162 return _binary; 00163 } 00164 00165 00166 } // namespace libMesh 00167 00168 #endif // LIBMESH_GMSH_IO_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:47 UTC
Hosted By: