nemesis_io.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_NEMESIS_IO_H
21 #define LIBMESH_NEMESIS_IO_H
22 
23 
24 // Local includes
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/mesh_input.h"
27 #include "libmesh/mesh_output.h"
29 
30 // C++ includes
31 
32 namespace libMesh
33 {
34 
35 // Forward declarations
36 class Nemesis_IO_Helper;
37 
50 class Nemesis_IO : public MeshInput<MeshBase>,
51  public MeshOutput<MeshBase>,
52  public ParallelObject
53 {
54 
55 public:
56 
61  explicit
62  Nemesis_IO (MeshBase & mesh, bool single_precision=false);
63 
67  virtual ~Nemesis_IO ();
68 
74  virtual void read (const std::string & base_filename) override;
75 
79  virtual void write (const std::string & base_filename) override;
80 
84  void write_timestep (const std::string & fname,
85  const EquationSystems & es,
86  const int timestep,
87  const Real time);
88 
98  void set_output_variables(const std::vector<std::string> & output_variables,
99  bool allow_empty = true);
100 
104  virtual void write_nodal_data (const std::string & fname,
105  const std::vector<Number> & soln,
106  const std::vector<std::string> & names) override;
107 
111  virtual void write_nodal_data (const std::string & fname,
112  const NumericVector<Number> & parallel_soln,
113  const std::vector<std::string> & names) override;
114 
122  void write_element_data (const EquationSystems & es);
123 
127  void verbose (bool set_verbosity);
128 
132  void write_global_data (const std::vector<Number> &,
133  const std::vector<std::string> &);
134 
138  void write_information_records (const std::vector<std::string> &);
139 
145  void append(bool val);
146 
147 private:
148 #if defined(LIBMESH_HAVE_EXODUS_API) && defined(LIBMESH_HAVE_NEMESIS_API)
149  std::unique_ptr<Nemesis_IO_Helper> nemhelper;
150 
156 #endif
157 
161  bool _verbose;
162 
167  bool _append;
168 
174  void prepare_to_write_nodal_data (const std::string & fname,
175  const std::vector<std::string> & names);
176 
181  std::vector<std::string> _output_variables;
182 
189 };
190 
191 
192 } // namespace libMesh
193 
194 
195 #endif // LIBMESH_NEMESIS_IO_H
Manages multiples systems of equations.
virtual void read(const std::string &base_filename) override
Definition: nemesis_io.C:148
void write_information_records(const std::vector< std::string > &)
Definition: nemesis_io.C:1548
Base class for Mesh.
Definition: mesh_base.h:77
virtual ~Nemesis_IO()
Definition: nemesis_io.C:112
void write_timestep(const std::string &fname, const EquationSystems &es, const int timestep, const Real time)
Definition: nemesis_io.C:1248
void prepare_to_write_nodal_data(const std::string &fname, const std::vector< std::string > &names)
Definition: nemesis_io.C:1275
void write_element_data(const EquationSystems &es)
Definition: nemesis_io.C:1375
An object whose state is distributed along a set of processors.
virtual void write_nodal_data(const std::string &fname, const std::vector< Number > &soln, const std::vector< std::string > &names) override
Definition: nemesis_io.C:1456
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void write_global_data(const std::vector< Number > &, const std::vector< std::string > &)
Definition: nemesis_io.C:1483
virtual void write(const std::string &base_filename) override
Definition: nemesis_io.C:1190
void append(bool val)
Definition: nemesis_io.C:131
std::unique_ptr< Nemesis_IO_Helper > nemhelper
Definition: nemesis_io.h:149
void set_output_variables(const std::vector< std::string > &output_variables, bool allow_empty=true)
Definition: nemesis_io.C:138
Nemesis_IO(MeshBase &mesh, bool single_precision=false)
Definition: nemesis_io.C:88
void verbose(bool set_verbosity)
Definition: nemesis_io.C:118
std::vector< std::string > _output_variables
Definition: nemesis_io.h:181