Debian Codegraph @

src/atlas/mesh/IsGhostNode.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/array/ArrayView.h"
14 #include "atlas/array/MakeView.h"
15 #include "atlas/field/Field.h"
16 #include "atlas/mesh/Nodes.h"
17 #include "atlas/parallel/mpi/mpi.h"
18
19 namespace atlas {
20 namespace mesh {
21
22 class IsGhostNode {
23 public:
24 IsGhostNode(const mesh::Nodes& nodes):
25 flags_(array::make_view<int, 1>(nodes.flags())), ghost_(array::make_view<int, 1>(nodes.ghost())) {}
26
27 bool operator()(idx_t idx) const { return Nodes::Topology::check(flags_(idx), Nodes::Topology::GHOST); }
28
29 private:
30 array::ArrayView<const int, 1> flags_;
31 array::ArrayView<const int, 1> ghost_;
32 };
33
34 } // namespace mesh
35 } // namespace atlas