DOLFINx
0.12.0.0
DOLFINx C++
Toggle main menu visibility
Loading...
Searching...
No Matches
dolfinx
io
VTKFile.h
1
// Copyright (C) 2020 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 <concepts>
10
#include <dolfinx/common/MPI.h>
11
#include <dolfinx/common/types.h>
12
#include <filesystem>
13
#include <functional>
14
#include <memory>
15
#include <string>
16
#include <string_view>
17
18
namespace
pugi
19
{
20
class
xml_document;
21
}
22
23
namespace
dolfinx::fem
24
{
25
template
<dolfinx::scalar T, std::
float
ing_po
int
U>
26
class
Function
;
27
}
28
29
namespace
dolfinx::mesh
30
{
31
template
<std::
float
ing_po
int
T>
32
class
Mesh
;
33
}
34
35
namespace
dolfinx::io
36
{
37
47
class
VTKFile
48
{
49
public
:
51
VTKFile
(MPI_Comm comm,
const
std::filesystem::path& filename,
52
std::string_view file_mode);
53
55
~VTKFile
();
56
58
void
close
();
59
61
void
flush
();
62
69
template
<std::
float
ing_po
int
U>
70
void
write
(
const
mesh::Mesh<U>
&
mesh
,
double
t = 0.0);
71
88
template
<dolfinx::scalar T, std::
float
ing_po
int
U = scalar_value_t<T>>
89
void
90
write
(
const
std::vector<std::reference_wrapper<
const
fem::Function<T, U>
>>& u,
91
double
t);
92
93
private
:
94
std::unique_ptr<pugi::xml_document> _pvd_xml;
95
96
std::filesystem::path _filename;
97
98
// MPI communicator
99
dolfinx::MPI::Comm
_comm;
100
};
101
}
// namespace dolfinx::io
dolfinx::MPI::Comm
A duplicate MPI communicator and manage lifetime of the communicator.
Definition
MPI.h:43
dolfinx::fem::Function
Definition
Function.h:47
dolfinx::io::VTKFile::write
void write(const mesh::Mesh< U > &mesh, double t=0.0)
Write a mesh to file.
Definition
VTKFile.cpp:767
dolfinx::io::VTKFile::close
void close()
Close file.
Definition
VTKFile.cpp:735
dolfinx::io::VTKFile::~VTKFile
~VTKFile()
Destructor.
Definition
VTKFile.cpp:725
dolfinx::io::VTKFile::flush
void flush()
Flushes XML files to disk.
Definition
VTKFile.cpp:752
dolfinx::io::VTKFile::VTKFile
VTKFile(MPI_Comm comm, const std::filesystem::path &filename, std::string_view file_mode)
Create VTK file.
Definition
VTKFile.cpp:713
dolfinx::mesh::Mesh
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition
Mesh.h:23
dolfinx::fem
Finite element method functionality.
Definition
assemble_expression_impl.h:23
dolfinx::io
Support for file IO.
Definition
ADIOS2Writers.h:43
dolfinx::mesh
Mesh data structures and algorithms on meshes.
Definition
DofMap.h:32
Generated by
1.17.0