DOLFINx
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
15namespace dolfinx
16{
17namespace fem
18{
19class FunctionSpace;
20}
21
22namespace mesh
23{
24enum class CellType;
25class Mesh;
26} // namespace mesh
27
28namespace io
29{
40std::tuple<xt::xtensor<double, 2>, std::vector<std::int64_t>,
41 std::vector<std::uint8_t>, xt::xtensor<std::int32_t, 2>>
42vtk_mesh_from_space(const fem::FunctionSpace& V);
43
55xt::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