DOLFIN-X
DOLFIN-X C++ interface
VTKFile.h
1 // Copyright (C) 2005-2019 Garth N. Wells
2 //
3 // This file is part of DOLFINX (https://www.fenicsproject.org)
4 //
5 // SPDX-License-Identifier: LGPL-3.0-or-later
6 
7 #pragma once
8 
9 #include <complex>
10 #include <string>
11 #include <utility>
12 #include <vector>
13 
14 namespace pugi
15 {
16 class xml_node;
17 }
18 
19 namespace dolfinx
20 {
21 namespace fem
22 {
23 template <typename T>
24 class Function;
25 }
26 
27 namespace mesh
28 {
29 class Mesh;
30 } // namespace mesh
31 
32 namespace io
33 {
34 
36 
39 
40 class VTKFile
41 {
42 public:
44  VTKFile(const std::string filename);
45 
47  ~VTKFile() = default;
48 
50  void write(const mesh::Mesh& mesh);
51 
53  void write(const fem::Function<double>& u);
54 
56  void write(const fem::Function<std::complex<double>>& u);
57 
59  void write(const mesh::Mesh& mesh, double t);
60 
62  void write(const fem::Function<double>& u, double t);
63 
65  void write(const fem::Function<std::complex<double>>& u, double t);
66 
67 private:
68  const std::string _filename;
69 
70  // Counter for the number of times various data has been written
71  std::size_t _counter;
72 };
73 } // namespace io
74 } // namespace dolfinx
This class represents a function in a finite element function space , given by.
Definition: Function.h:43
Output of meshes and functions in VTK format.
Definition: VTKFile.h:41
VTKFile(const std::string filename)
Create VTK file.
Definition: VTKFile.cpp:610
void write(const mesh::Mesh &mesh)
Output mesh.
Definition: VTKFile.cpp:615
~VTKFile()=default
Destructor.
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition: Mesh.h:57