libMesh
Loading...
Searching...
No Matches
tecplot_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_TECPLOT_IO_H
21#define LIBMESH_TECPLOT_IO_H
22
23// Local includes
24#include "libmesh/libmesh_common.h"
25#include "libmesh/mesh_output.h"
26
27// C++ Includes
28#include <cstddef>
29#include <set>
30
31namespace libMesh
32{
33
34// Forward declarations
35class MeshBase;
36
43class TecplotIO : public MeshOutput<MeshBase>
44{
45public:
46
54 explicit
55 TecplotIO (const MeshBase &, const bool binary=false,
56 const double time=0., const int strand_offset=0);
57
61 virtual void write (const std::string &) override;
62
68
73 virtual void write_nodal_data (const std::string &,
74 const std::vector<Number> &,
75 const std::vector<std::string> &) override;
76
81 bool & binary ();
82
87 double & time ();
88
95 int & strand_offset ();
96
100 std::string & zone_title ();
101
107 bool & ascii_append ();
108
109private:
110
116 void write_ascii (const std::string &,
117 const std::vector<Number> * = nullptr,
118 const std::vector<std::string> * = nullptr);
119
127 void write_binary (const std::string &,
128 const std::vector<Number> * = nullptr,
129 const std::vector<std::string> * = nullptr);
130
138 unsigned elem_dimension();
139
140 //---------------------------------------------------------------------------
141 // local data
142
147
151 double _time;
152
157
161 std::string _zone_title;
162
168
172 std::set<subdomain_id_type> _subdomain_ids;
173};
174
175} // namespace libMesh
176
177
178#endif // LIBMESH_TECPLOT_IO_H
This is the MeshBase class.
Definition mesh_base.h:81
This class defines an abstract interface for Mesh output.
Definition mesh_output.h:54
This class implements writing meshes in the Tecplot format.
Definition tecplot_io.h:44
virtual void write(const std::string &) override
This method implements writing a mesh to a specified file.
Definition tecplot_io.C:174
double & time()
Solution time for transient data.
Definition tecplot_io.C:148
std::string & zone_title()
The zone title to write.
Definition tecplot_io.C:162
int _strand_offset
Offset for Tecplot's STRANDID.
Definition tecplot_io.h:156
void write_binary(const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr)
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition tecplot_io.C:351
std::set< subdomain_id_type > _subdomain_ids
The subdomains in the mesh.
Definition tecplot_io.h:172
bool & ascii_append()
Set to true to write multiple solutions to a single file (ASCII only).
Definition tecplot_io.C:168
bool _ascii_append
If true, when writing in ASCII format, open the file in std::ofstream::app mode.
Definition tecplot_io.h:167
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...
Definition tecplot_io.C:187
bool & binary()
Flag indicating whether or not to write a binary file (if the tecio.a library was found by configure)...
Definition tecplot_io.C:141
unsigned elem_dimension()
Determines the logical spatial dimension of the elements in the Mesh.
Definition tecplot_io.C:204
void write_ascii(const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr)
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition tecplot_io.C:232
double _time
Solution time.
Definition tecplot_io.h:151
int & strand_offset()
Strand offset for this file.
Definition tecplot_io.C:155
std::string _zone_title
The zone title to write.
Definition tecplot_io.h:161
bool _binary
Flag to write binary data.
Definition tecplot_io.h:146
The libMesh namespace provides an interface to certain functionality in the library.