| 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 <string> |
| 14 |
#include <vector> |
| 15 |
|
| 16 |
#include "atlas/library/config.h" |
| 17 |
|
| 18 |
namespace atlas { |
| 19 |
class Mesh; |
| 20 |
|
| 21 |
namespace mesh { |
| 22 |
namespace actions { |
| 23 |
|
| 24 |
class BuildHalo { |
| 25 |
public: |
| 26 |
BuildHalo(Mesh& mesh); |
| 27 |
void operator()(int nb_elems); |
| 28 |
|
| 29 |
private: |
| 30 |
Mesh& mesh_; |
| 31 |
|
| 32 |
public: |
| 33 |
std::vector<idx_t> periodic_points_local_index_; |
| 34 |
std::vector<std::vector<idx_t>> periodic_cells_local_index_; |
| 35 |
}; |
| 36 |
|
| 37 |
/// @brief Enlarge each partition of the mesh with a halo of elements |
| 38 |
/// @param [inout] mesh The mesh to enlarge |
| 39 |
/// @param [in] nb_elems Size of the halo |
| 40 |
/// @author Willem Deconinck |
| 41 |
/// @date June 2014 |
| 42 |
inline void build_halo(Mesh& mesh, int nb_elems) { |
| 43 |
BuildHalo f(mesh); |
| 44 |
f(nb_elems); |
| 45 |
} |
| 46 |
|
| 47 |
// ------------------------------------------------------------------ |
| 48 |
// C wrapper interfaces to C++ routines |
| 49 |
extern "C" { |
| 50 |
void atlas__build_halo(Mesh::Implementation* mesh, int nb_elems); |
| 51 |
} |
| 52 |
// ------------------------------------------------------------------ |
| 53 |
|
| 54 |
} // namespace actions |
| 55 |
} // namespace mesh |
| 56 |
} // namespace atlas |