DOLFINx 0.12.0.0
DOLFINx C++
Loading...
Searching...
No Matches
ordering.h
1// Copyright (C) 2021 Chris Richardson
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 "AdjacencyList.h"
10#include <cstddef>
11#include <cstdint>
12#include <functional>
13#include <span>
14#include <variant>
15#include <vector>
16
17namespace dolfinx::graph
18{
39std::vector<std::int32_t>
40reorder_rcm(const graph::AdjacencyList<std::int32_t>& graph);
41
43using reorder_graph_fn = std::function<std::vector<std::int32_t>(
45
52using reorder_geom_fn = std::function<std::vector<std::int32_t>(
53 std::span<const double> x, int gdim)>;
54
59using Reorder = std::variant<reorder_graph_fn, reorder_geom_fn>;
60} // namespace dolfinx::graph
This class provides a static adjacency list data structure.
Definition AdjacencyList.h:41
Graph data structures and algorithms.
Definition AdjacencyList.h:23
std::variant< reorder_graph_fn, reorder_geom_fn > Reorder
A graph or geometric reordering function for mesh cells.
Definition ordering.h:59
std::vector< std::int32_t > reorder_rcm(const graph::AdjacencyList< std::int32_t > &graph)
Re-order a graph using the Reverse Cuthill-McKee algorithm.
Definition ordering.cpp:149
std::function< std::vector< std::int32_t >( const graph::AdjacencyList< std::int32_t > &)> reorder_graph_fn
Signature of functions that reorder the nodes of a graph.
Definition ordering.h:43
std::function< std::vector< std::int32_t >( std::span< const double > x, int gdim)> reorder_geom_fn
Signature of functions that reorder points from their positions.
Definition ordering.h:52