vtk_io.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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 #ifndef LIBMESH_VTK_IO_H
20 #define LIBMESH_VTK_IO_H
21 
22 // Local includes
23 #include "libmesh/libmesh_common.h"
24 #include "libmesh/mesh_input.h"
25 #include "libmesh/mesh_output.h"
26 
27 #ifdef LIBMESH_HAVE_VTK
28 #include "vtkType.h"
29 #endif
30 
31 // C++ includes
32 #include <cstddef>
33 #include <map>
34 
35 // Forward declarations
36 
37 class vtkUnstructuredGrid;
38 class vtkPoints;
39 class vtkCellArray;
40 
41 namespace libMesh
42 {
43 
44 class MeshBase;
45 class MeshData;
46 
59 // ------------------------------------------------------------
60 // VTKIO class definition
61 class VTKIO : public MeshInput<MeshBase>,
62  public MeshOutput<MeshBase>
63 {
64 public:
69  explicit
70  VTKIO (MeshBase& mesh, MeshData* mesh_data=NULL);
71 
76  explicit
77  VTKIO (const MeshBase& mesh, MeshData* mesh_data=NULL);
78 
83  virtual void write_nodal_data (const std::string&,
84  const std::vector<Number>&,
85  const std::vector<std::string>&);
86 
91  // virtual void write_equation_systems(const std::string& fname,
92  // const EquationSystems& es,
93  // const std::set<std::string>* system_names=NULL);
94 
99  virtual void read (const std::string&);
100 
104  virtual void write (const std::string&);
105 
109  vtkUnstructuredGrid* get_vtk_grid();
110 
114  void set_compression(bool b);
115 
116 private:
117 #ifdef LIBMESH_HAVE_VTK
118 
121  vtkIdType get_elem_type(ElemType type);
122 #endif
123 
127  void nodes_to_vtk();
128 
132  void cells_to_vtk();
133 
137  void system_vectors_to_vtk(const EquationSystems& es, vtkUnstructuredGrid*& grid);
138 
142  vtkUnstructuredGrid* _vtk_grid;
143 
149 
153  bool _compress;
154 
158  std::map<dof_id_type, dof_id_type> _local_node_map;
159 };
160 
161 
162 
163 } // namespace libMesh
164 
165 
166 #endif // LIBMESH_VTK_IO_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo