$extrastylesheet
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_LEGACY_XDR_IO_H 00021 #define LIBMESH_LEGACY_XDR_IO_H 00022 00023 00024 // Local includes 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 class MeshData; 00037 00043 // ------------------------------------------------------------ 00044 // LegacyXdrIO class definition 00045 class LegacyXdrIO : public MeshInput<MeshBase>, 00046 public MeshOutput<MeshBase> 00047 { 00048 00049 public: 00057 enum FileFormat {DEAL=0, MGF=1, LIBM=2}; 00058 00066 explicit 00067 LegacyXdrIO (MeshBase&, const bool=false); 00068 00076 explicit 00077 LegacyXdrIO (const MeshBase&, const bool=false); 00078 00082 virtual ~LegacyXdrIO (); 00083 00087 virtual void read (const std::string&); 00088 00093 void read_mgf (const std::string&); 00094 00098 virtual void write (const std::string&); 00099 00104 void write_mgf (const std::string&); 00105 00116 void read_mgf_soln (const std::string& name, 00117 std::vector<Number>& soln, 00118 std::vector<std::string>& var_names) const; 00119 00129 void write_mgf_soln (const std::string& name, 00130 std::vector<Number>& soln, 00131 std::vector<std::string>& var_names) const; 00132 00136 bool & binary(); 00137 00141 bool binary() const; 00142 00143 00144 private: 00145 00152 void read_ascii (const std::string&, const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM); 00153 00160 void read_binary (const std::string&, const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM); 00161 00162 00163 00173 void write_ascii (const std::string&, const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM); 00174 00181 void write_binary (const std::string&, const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM); 00182 00183 00187 void read_mesh (const std::string&, 00188 const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM, 00189 MeshData* = NULL); 00190 00194 void write_mesh (const std::string&, 00195 const LegacyXdrIO::FileFormat = LegacyXdrIO::LIBM); 00196 00200 void read_soln (const std::string&, 00201 std::vector<Real>&, 00202 std::vector<std::string>&) const; 00203 00207 void write_soln (const std::string& name, 00208 std::vector<Real>& soln, 00209 std::vector<std::string>&) const; 00210 00211 //------------------------------------------------------------- 00212 // local data 00213 00217 bool _binary; 00218 }; 00219 00220 00221 00222 } // namespace libMesh 00223 00224 00225 00226 00227 #endif // LIBMESH_LEGACY_XDR_IO_H