| 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/library/config.h" |
| 14 |
#include "atlas/mesh/Mesh.h" |
| 15 |
|
| 16 |
namespace atlas { |
| 17 |
|
| 18 |
class Grid; |
| 19 |
|
| 20 |
namespace mesh { |
| 21 |
namespace actions { |
| 22 |
|
| 23 |
/* |
| 24 |
* Build median-dual mesh by connecting cell centres with edge centres |
| 25 |
* - dual_volumes field |
| 26 |
* - dual_normals field |
| 27 |
*/ |
| 28 |
void build_median_dual_mesh(Mesh& mesh); |
| 29 |
|
| 30 |
/* |
| 31 |
* Build centroid-dual mesh by connecting cell centres with cell centres |
| 32 |
* - dual_volumes field |
| 33 |
* - dual_normals field |
| 34 |
* - skewness field value 1 at ip1, value -1 at ip2 |
| 35 |
* - alpha field value 1 at ip1, value 0 at ip2 |
| 36 |
*/ |
| 37 |
void build_centroid_dual_mesh(Mesh& mesh); |
| 38 |
|
| 39 |
/* |
| 40 |
* Build brick-dual mesh |
| 41 |
* - dual_volumes field |
| 42 |
* @note Only works for reduced grids with 1 MPI task |
| 43 |
* This was urgently coded to show the resolution as IFS sees it. |
| 44 |
* |
| 45 |
* # | # | # | # | |
| 46 |
* | | | | |
| 47 |
* ----+-+-----+-+-----+-+-----+-+ |
| 48 |
* | | | | |
| 49 |
* # | # | # | # | |
| 50 |
* | | | | |
| 51 |
* -+----+--+----+--+----+--+----+ |
| 52 |
* | | | | |
| 53 |
* | # | # | # | # |
| 54 |
*/ |
| 55 |
void build_brick_dual_mesh(const Grid& grid, Mesh& mesh); |
| 56 |
|
| 57 |
// ------------------------------------------------------------------ |
| 58 |
// C wrapper interfaces to C++ routines |
| 59 |
extern "C" { |
| 60 |
void atlas__build_median_dual_mesh(Mesh::Implementation* mesh); |
| 61 |
void atlas__build_centroid_dual_mesh(Mesh::Implementation* mesh); |
| 62 |
} |
| 63 |
// ------------------------------------------------------------------ |
| 64 |
|
| 65 |
} // namespace actions |
| 66 |
} // namespace mesh |
| 67 |
} // namespace atlas |