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 <fstream>
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 function
22 {
23 class Function;
24 }
25 
26 namespace mesh
27 {
28 class Mesh;
29 } // namespace mesh
30 
31 namespace io
32 {
33 
35 
38 
39 class VTKFile
40 {
41 public:
43  VTKFile(const std::string filename);
44 
46  ~VTKFile() = default;
47 
49  void write(const mesh::Mesh& mesh);
50 
52  void write(const function::Function& u);
53 
55  void write(const mesh::Mesh& mesh, double t);
56 
58  void write(const function::Function& u, double t);
59 
60 private:
61  const std::string _filename;
62 
63  // Counter for the number of times various data has been written
64  std::size_t _counter;
65 };
66 } // namespace io
67 } // namespace dolfinx
dolfinx::io::VTKFile::~VTKFile
~VTKFile()=default
Destructor.
dolfinx::mesh::Mesh
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition: Mesh.h:46
dolfinx::io::VTKFile::write
void write(const mesh::Mesh &mesh)
Output mesh.
Definition: VTKFile.cpp:602
dolfinx::function::Function
This class represents a function in a finite element function space , given by.
Definition: Function.h:41
dolfinx::io::VTKFile
Output of meshes and functions in VTK format.
Definition: VTKFile.h:39
dolfinx::io::VTKFile::VTKFile
VTKFile(const std::string filename)
Create VTK file.
Definition: VTKFile.cpp:597