libMesh
tecplot_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_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 
31 namespace libMesh
32 {
33 
34 // Forward declarations
35 class MeshBase;
36 
43 class TecplotIO : public MeshOutput<MeshBase>
44 {
45 public:
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 &) libmesh_override;
62 
68 
73  virtual void write_nodal_data (const std::string &,
74  const std::vector<Number> &,
75  const std::vector<std::string> &) libmesh_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 
109 private:
110 
116  void write_ascii (const std::string &,
117  const std::vector<Number> * = libmesh_nullptr,
118  const std::vector<std::string> * = libmesh_nullptr);
119 
127  void write_binary (const std::string &,
128  const std::vector<Number> * = libmesh_nullptr,
129  const std::vector<std::string> * = libmesh_nullptr);
130 
138  unsigned elem_dimension();
139 
140  //---------------------------------------------------------------------------
141  // local data
142 
146  bool _binary;
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
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) libmesh_override
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: tecplot_io.C:186
int & strand_offset()
Strand offset for this file.
Definition: tecplot_io.C:154
double _time
Solution time.
Definition: tecplot_io.h:151
void write_binary(const std::string &, const std::vector< Number > *=libmesh_nullptr, const std::vector< std::string > *=libmesh_nullptr)
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: tecplot_io.C:350
const class libmesh_nullptr_t libmesh_nullptr
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 & binary()
Flag indicating whether or not to write a binary file (if the tecio.a library was found by configure)...
Definition: tecplot_io.C:140
This is the MeshBase class.
Definition: mesh_base.h:68
bool _binary
Flag to write binary data.
Definition: tecplot_io.h:146
std::set< subdomain_id_type > _subdomain_ids
The subdomains in the mesh.
Definition: tecplot_io.h:172
virtual void write(const std::string &) libmesh_override
This method implements writing a mesh to a specified file.
Definition: tecplot_io.C:173
int _strand_offset
Offset for Tecplot&#39;s STRANDID.
Definition: tecplot_io.h:156
TecplotIO(const MeshBase &, const bool binary=false, const double time=0., const int strand_offset=0)
Constructor.
Definition: tecplot_io.C:120
void write_ascii(const std::string &, const std::vector< Number > *=libmesh_nullptr, const std::vector< std::string > *=libmesh_nullptr)
This method implements writing a mesh with nodal data to a specified file where the nodal data and va...
Definition: tecplot_io.C:231
unsigned elem_dimension()
Determines the logical spatial dimension of the elements in the Mesh.
Definition: tecplot_io.C:203
bool _ascii_append
If true, when writing in ASCII format, open the file in std::ofstream::app mode.
Definition: tecplot_io.h:167
This class implements writing meshes in the Tecplot format.
Definition: tecplot_io.h:43
bool & ascii_append()
Set to true to write multiple solutions to a single file (ASCII only).
Definition: tecplot_io.C:167
std::string & zone_title()
The zone title to write.
Definition: tecplot_io.C:161
std::string _zone_title
The zone title to write.
Definition: tecplot_io.h:161
double & time()
Solution time for transient data.
Definition: tecplot_io.C:147