Debian Codegraph @

src/atlas/mesh/actions/ReorderReverseCuthillMckee.h

raw
1 /*
2 * (C) Copyright 2013 ECMWF.
3 *
4 * This software is licensed under the terms of the Apache Licence Version 2.0
5 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 * In applying this licence, ECMWF does not waive the privileges and immunities
7 * granted to it by virtue of its status as an intergovernmental organisation
8 * nor does it submit to any jurisdiction.
9 */
10
11 #pragma once
12
13 #include "atlas/mesh/actions/Reorder.h"
14
15 namespace atlas {
16 namespace mesh {
17 namespace actions {
18
19 // ------------------------------------------------------------------
20
21 /// Reorder implementation that reorders nodes of a mesh following a Reverse Cuthill-Mckee algorithm
22 /// based on the node-to-node connectivity by mesh edges
23 /// Cells and edges are reordered to follow lowest node index.
24 ///
25 /// Usage:
26 /// auto reorder = Reorder{ option::type("reverse_cuthill_mckee") | config };
27 /// reorder( mesh );
28 ///
29 /// The optional extra config can contain:
30 ///
31 /// - "ghost_at_end" : <bool> (default=true) // Determines if ghost nodes should be reordered in between
32 /// // internal nodes or added/remain at the end
33
34 class ReorderReverseCuthillMckee : public ReorderImpl {
35 public:
36 ReorderReverseCuthillMckee(const eckit::Parametrisation& = util::NoConfig());
37
38 std::vector<idx_t> computeNodesOrder(Mesh&) override;
39
40 private:
41 bool ghost_at_end_{true};
42 };
43
44
45 // ------------------------------------------------------------------
46
47 } // namespace actions
48 } // namespace mesh
49 } // namespace atlas