DOLFINx
0.11.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
17
namespace
pugi
18
{
19
class
xml_document;
20
}
21
22
namespace
dolfinx::fem
23
{
24
template
<dolfinx::scalar T, std::
float
ing_po
int
U>
25
class
Function
;
26
}
27
28
namespace
dolfinx::mesh
29
{
30
template
<std::
float
ing_po
int
T>
31
class
Mesh
;
32
}
33
34
namespace
dolfinx::io
35
{
36
46
class
VTKFile
47
{
48
public
:
50
VTKFile
(MPI_Comm comm,
const
std::filesystem::path& filename,
51
const
std::string& file_mode);
52
54
~VTKFile
();
55
57
void
close
();
58
60
void
flush
();
61
68
template
<std::
float
ing_po
int
U>
69
void
write
(
const
mesh::Mesh<U>
&
mesh
,
double
time = 0.0);
70
87
template
<dolfinx::scalar T, std::
float
ing_po
int
U = scalar_value_t<T>>
88
void
89
write
(
const
std::vector<std::reference_wrapper<
const
fem::Function<T, U>
>>& u,
90
double
t);
91
92
private
:
93
std::unique_ptr<pugi::xml_document> _pvd_xml;
94
95
std::filesystem::path _filename;
96
97
// MPI communicator
98
dolfinx::MPI::Comm
_comm;
99
};
100
}
// namespace dolfinx::io
dolfinx::MPI::Comm
A duplicate MPI communicator and manage lifetime of the communicator.
Definition
MPI.h:42
dolfinx::fem::Function
Definition
Function.h:47
dolfinx::io::VTKFile::write
void write(const mesh::Mesh< U > &mesh, double time=0.0)
Write a mesh to file.
Definition
VTKFile.cpp:763
dolfinx::io::VTKFile::close
void close()
Close file.
Definition
VTKFile.cpp:731
dolfinx::io::VTKFile::VTKFile
VTKFile(MPI_Comm comm, const std::filesystem::path &filename, const std::string &file_mode)
Create VTK file.
Definition
VTKFile.cpp:709
dolfinx::io::VTKFile::~VTKFile
~VTKFile()
Destructor.
Definition
VTKFile.cpp:721
dolfinx::io::VTKFile::flush
void flush()
Flushes XML files to disk.
Definition
VTKFile.cpp:748
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