Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/d3/d56/vtk__utils_8h_source.html
DOLFINx  0.4.1
DOLFINx C++ interface
vtk_utils.h
1 // Copyright (C) 2020-2022 Garth N. Wells and Jørgen S. Dokken
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 <cstdint>
10 #include <dolfinx/mesh/cell_types.h>
11 #include <tuple>
12 #include <vector>
13 #include <xtensor/xtensor.hpp>
14 
15 namespace dolfinx
16 {
17 namespace fem
18 {
19 class FunctionSpace;
20 }
21 
22 namespace mesh
23 {
24 enum class CellType;
25 class Mesh;
26 } // namespace mesh
27 
28 namespace io
29 {
40 std::tuple<xt::xtensor<double, 2>, std::vector<std::int64_t>,
41  std::vector<std::uint8_t>, xt::xtensor<std::int32_t, 2>>
42 vtk_mesh_from_space(const fem::FunctionSpace& V);
43 
55 xt::xtensor<std::int64_t, 2> extract_vtk_connectivity(const mesh::Mesh& mesh);
56 
57 } // namespace io
58 } // namespace dolfinx
std::tuple< xt::xtensor< double, 2 >, std::vector< std::int64_t >, std::vector< std::uint8_t >, xt::xtensor< std::int32_t, 2 > > vtk_mesh_from_space(const fem::FunctionSpace &V)
Given a FunctionSpace, create a topology and geometry based on the dof coordinates.
Definition: vtk_utils.cpp:137
xt::xtensor< std::int64_t, 2 > extract_vtk_connectivity(const mesh::Mesh &mesh)
Extract the cell topology (connectivity) in VTK ordering for all cells the mesh. The 'topology' inclu...
Definition: vtk_utils.cpp:173
CellType
Cell type identifier.
Definition: cell_types.h:22