libMesh
Loading...
Searching...
No Matches
namebased_io.h
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 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_NAMEBASED_IO_H
21#define LIBMESH_NAMEBASED_IO_H
22
23// Local includes
24#include "libmesh/mesh_output.h"
25#include "libmesh/mesh_input.h"
26
27namespace libMesh
28{
29
30// Forward declarations
31class MeshBase;
32
44class NameBasedIO : public MeshInput<MeshBase>,
45 public MeshOutput<MeshBase>
46{
47public:
48
53 explicit
54 NameBasedIO (const MeshBase &);
55
60 explicit
62
66 virtual void read (const std::string & mesh_file) override;
67
71 virtual void write (const std::string & mesh_file) override;
72
82 virtual void write_equation_systems (const std::string & filename,
83 const EquationSystems & es,
84 const std::set<std::string> * system_names=nullptr) override;
85
91
96 virtual void write_nodal_data (const std::string &,
97 const std::vector<Number> &,
98 const std::vector<std::string> &) override;
99
100 // Certain mesh formats can support parallel I/O, including the
101 // "new" Xdr format and the Nemesis format.
102 bool is_parallel_file_format (std::string_view filename);
103};
104
105
106
107// ------------------------------------------------------------
108// NameBasedIO inline members
109inline
114
115inline
121
122} // namespace libMesh
123
124
125#endif // LIBMESH_NAMEBASED_IO_H
This is the EquationSystems class.
This is the MeshBase class.
Definition mesh_base.h:81
This class defines an abstract interface for Mesh input.
Definition mesh_input.h:49
This class defines an abstract interface for Mesh output.
Definition mesh_output.h:54
This class supports simple reads and writes in any libMesh-supported format, by dispatching to one of...
NameBasedIO(const MeshBase &)
Constructor.
bool is_parallel_file_format(std::string_view filename)
virtual void write_equation_systems(const std::string &filename, const EquationSystems &es, const std::set< std::string > *system_names=nullptr) override
This method implements writing a mesh with data to a specified file where the data is taken from the ...
virtual void read(const std::string &mesh_file) override
This method implements reading a mesh from a specified file.
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
virtual void write(const std::string &mesh_file) override
This method implements writing a mesh to a specified file.
MeshBase & mesh
The libMesh namespace provides an interface to certain functionality in the library.