libMesh
nemesis_io.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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"
28 #include "libmesh/parallel_object.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) libmesh_override;
75 
79  virtual void write (const std::string & base_filename) libmesh_override;
80 
84  void write_timestep (const std::string & fname,
85  const EquationSystems & es,
86  const int timestep,
87  const Real time);
88 
92  virtual void write_nodal_data (const std::string & fname,
93  const std::vector<Number> & soln,
94  const std::vector<std::string> & names) libmesh_override;
95 
99  virtual void write_nodal_data (const std::string & fname,
100  const NumericVector<Number> & parallel_soln,
101  const std::vector<std::string> & names) libmesh_override;
102 
106  void verbose (bool set_verbosity);
107 
111  void write_global_data (const std::vector<Number> &,
112  const std::vector<std::string> &);
113 
117  void write_information_records (const std::vector<std::string> &);
118 
124  void append(bool val);
125 
126 private:
127 #if defined(LIBMESH_HAVE_EXODUS_API) && defined(LIBMESH_HAVE_NEMESIS_API)
129 
135 #endif
136 
140  bool _verbose;
141 
146  bool _append;
147 
153  void prepare_to_write_nodal_data (const std::string & fname,
154  const std::vector<std::string> & names);
155 };
156 
157 
158 } // namespace libMesh
159 
160 
161 #endif // LIBMESH_NEMESIS_IO_H
This is the EquationSystems class.
virtual void write_nodal_data(const std::string &fname, const std::vector< Number > &soln, const std::vector< std::string > &names) libmesh_override
Output a nodal solution.
Definition: nemesis_io.C:1363
void write_information_records(const std::vector< std::string > &)
Write out information records.
Definition: nemesis_io.C:1455
This class defines an abstract interface for Mesh output.
Definition: mesh_output.h:53
The libMesh namespace provides an interface to certain functionality in the library.
bool _verbose
Controls whether extra debugging information is printed to the screen or not.
Definition: nemesis_io.h:140
This is the MeshBase class.
Definition: mesh_base.h:68
virtual void write(const std::string &base_filename) libmesh_override
This method implements writing a mesh to a specified file.
Definition: nemesis_io.C:1180
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
virtual ~Nemesis_IO()
Destructor.
Definition: nemesis_io.C:108
void write_timestep(const std::string &fname, const EquationSystems &es, const int timestep, const Real time)
Write one timestep&#39;s worth of the solution.
Definition: nemesis_io.C:1242
void prepare_to_write_nodal_data(const std::string &fname, const std::vector< std::string > &names)
Helper function containing code shared between the two different versions of write_nodal_data which t...
Definition: nemesis_io.C:1269
This class defines an abstract interface for Mesh input.
Definition: mesh_base.h:50
The Nemesis_IO class implements reading parallel meshes in the Nemesis file format from Sandia Nation...
Definition: nemesis_io.h:50
bool _append
Default false.
Definition: nemesis_io.h:146
This class forms the base class for all other classes that are expected to be implemented in parallel...
int _timestep
Keeps track of the current timestep index being written.
Definition: nemesis_io.h:134
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void write_global_data(const std::vector< Number > &, const std::vector< std::string > &)
Write out global variables.
Definition: nemesis_io.C:1390
virtual void read(const std::string &base_filename) libmesh_override
Implements reading the mesh from several different files.
Definition: nemesis_io.C:135
void append(bool val)
If true, this flag will cause the Nemesis_IO object to attempt to open an existing file for writing...
Definition: nemesis_io.C:127
UniquePtr< Nemesis_IO_Helper > nemhelper
Definition: nemesis_io.h:128
Nemesis_IO(MeshBase &mesh, bool single_precision=false)
Constructor.
Definition: nemesis_io.C:85
void verbose(bool set_verbosity)
Set the flag indicating if we should be verbose.
Definition: nemesis_io.C:114