tecplot_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_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 &) 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 
109 private:
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 
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
int & strand_offset()
Definition: tecplot_io.C:156
Base class for Mesh.
Definition: mesh_base.h:77
std::set< subdomain_id_type > _subdomain_ids
Definition: tecplot_io.h:172
void write_ascii(const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr)
Definition: tecplot_io.C:233
void write_binary(const std::string &, const std::vector< Number > *=nullptr, const std::vector< std::string > *=nullptr)
Definition: tecplot_io.C:352
TecplotIO(const MeshBase &, const bool binary=false, const double time=0., const int strand_offset=0)
Definition: tecplot_io.C:122
virtual void write(const std::string &) override
Definition: tecplot_io.C:175
unsigned elem_dimension()
Definition: tecplot_io.C:205
virtual void write_nodal_data(const std::string &, const std::vector< Number > &, const std::vector< std::string > &) override
Definition: tecplot_io.C:188
bool & ascii_append()
Definition: tecplot_io.C:169
std::string & zone_title()
Definition: tecplot_io.C:163
std::string _zone_title
Definition: tecplot_io.h:161
double & time()
Definition: tecplot_io.C:149