exodusII_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_EXODUSII_IO_H 00021 #define LIBMESH_EXODUSII_IO_H 00022 00023 00024 // Local includes 00025 #include "libmesh/libmesh_common.h" 00026 #include "libmesh/mesh_input.h" 00027 #include "libmesh/mesh_output.h" 00028 00029 // C++ includes 00030 00031 namespace libMesh 00032 { 00033 00034 // Forward declarations 00035 class EquationSystems; 00036 class ExodusII_IO_Helper; 00037 class MeshBase; 00038 class System; 00039 00049 // ------------------------------------------------------------ 00050 // ExodusII_IO class definition 00051 class ExodusII_IO : public MeshInput<MeshBase>, 00052 public MeshOutput<MeshBase> 00053 { 00054 00055 public: 00056 00061 explicit 00062 ExodusII_IO (MeshBase& mesh); 00063 00067 virtual ~ExodusII_IO (); 00068 00076 virtual void read (const std::string& name); 00077 00081 virtual void write (const std::string& fname); 00082 00083 00087 void verbose (bool set_verbosity); 00088 00092 const std::vector<Real>& get_time_steps(); 00093 00097 void copy_nodal_solution(System& system, std::string var_name, unsigned int timestep=1); 00098 00103 void copy_nodal_solution(System& es, std::string system_var_name, std::string exodus_var_name, unsigned int timestep=1); 00104 00108 void write_discontinuous_exodusII (const std::string& name, 00109 const EquationSystems& es); 00110 00111 00115 void write_element_data (const EquationSystems& es); 00116 00120 void write_nodal_data (const std::string&, 00121 const std::vector<Number>&, 00122 const std::vector<std::string>&); 00123 00127 void write_nodal_data_discontinuous (const std::string&, 00128 const std::vector<Number>&, 00129 const std::vector<std::string>&); 00130 00134 void write_global_data (const std::vector<Number>&, 00135 const std::vector<std::string>&); 00136 00140 void write_information_records (const std::vector<std::string>&); 00141 00146 void write_timestep (const std::string& fname, 00147 const EquationSystems& es, 00148 const int timestep, 00149 const Real time); 00150 00156 void set_output_variables(const std::vector<std::string> & output_variables) { _output_variables = output_variables; } 00157 00169 void use_mesh_dimension_instead_of_spatial_dimension(bool val); 00170 00171 private: 00177 #ifdef LIBMESH_HAVE_EXODUS_API 00178 ExodusII_IO_Helper *exio_helper; 00179 #endif 00180 00184 int _timestep; 00185 00189 bool _verbose; 00190 00195 std::vector<std::string> _output_variables; 00196 }; 00197 00198 00199 } // namespace libMesh 00200 00201 00202 #endif // LIBMESH_EXODUSII_IO_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:46 UTC
Hosted By: