$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_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 #include "libmesh/parallel_object.h" 00029 00030 // C++ includes 00031 00032 namespace libMesh 00033 { 00034 00035 // Forward declarations 00036 class EquationSystems; 00037 class ExodusII_IO_Helper; 00038 class MeshBase; 00039 class System; 00040 00050 // ------------------------------------------------------------ 00051 // ExodusII_IO class definition 00052 class ExodusII_IO : public MeshInput<MeshBase>, 00053 public MeshOutput<MeshBase>, 00054 public ParallelObject 00055 { 00056 public: 00057 00062 explicit 00063 ExodusII_IO (MeshBase& mesh, 00064 bool single_precision=false); 00065 00069 virtual ~ExodusII_IO (); 00070 00078 virtual void read (const std::string& name); 00079 00083 virtual void write (const std::string& fname); 00084 00088 void verbose (bool set_verbosity); 00089 00093 const std::vector<Real>& get_time_steps(); 00094 00102 int get_num_time_steps(); 00103 00107 void copy_nodal_solution(System& system, 00108 std::string var_name, 00109 unsigned int timestep=1); 00110 00115 void copy_nodal_solution(System& system, 00116 std::string system_var_name, 00117 std::string exodus_var_name, 00118 unsigned int timestep=1); 00119 00124 void copy_elemental_solution(System& system, 00125 std::string system_var_name, 00126 std::string exodus_var_name, 00127 unsigned int timestep=1); 00128 00132 void write_discontinuous_exodusII (const std::string& name, 00133 const EquationSystems& es, 00134 const std::set<std::string>* system_names=NULL); 00135 00139 void write_element_data (const EquationSystems& es); 00140 00144 void write_nodal_data (const std::string&, 00145 const std::vector<Number>&, 00146 const std::vector<std::string>&); 00147 00151 void write_nodal_data_discontinuous (const std::string&, 00152 const std::vector<Number>&, 00153 const std::vector<std::string>&); 00154 00158 void write_global_data (const std::vector<Number>&, 00159 const std::vector<std::string>&); 00160 00164 void write_information_records (const std::vector<std::string>&); 00165 00170 void write_timestep (const std::string& fname, 00171 const EquationSystems& es, 00172 const int timestep, 00173 const Real time); 00174 00183 void set_output_variables(const std::vector<std::string>& output_variables, 00184 bool allow_empty = true); 00185 00197 void use_mesh_dimension_instead_of_spatial_dimension(bool val); 00198 00203 void set_coordinate_offset(Point p); 00204 00210 void append(bool val); 00211 00215 const std::vector<std::string> & get_elem_var_names(); 00216 00220 const std::vector<std::string> & get_nodal_var_names(); 00221 00222 private: 00228 #ifdef LIBMESH_HAVE_EXODUS_API 00229 ExodusII_IO_Helper *exio_helper; 00230 #endif 00231 00236 int _timestep; 00237 00241 bool _verbose; 00242 00247 std::vector<std::string> _output_variables; 00248 00253 bool _append; 00254 00259 void write_nodal_data_common(std::string fname, 00260 const std::vector<std::string>& names, 00261 bool continuous=true); 00262 00268 bool _allow_empty_variables; 00269 00270 }; 00271 00272 00273 } // namespace libMesh 00274 00275 00276 #endif // LIBMESH_EXODUSII_IO_H