atlas
BuildParallelFields.h
Go to the documentation of this file.
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 
14 
15 #pragma once
16 
17 #include "atlas/library/config.h"
18 #include "atlas/mesh/Mesh.h"
19 
20 namespace atlas {
21 namespace mesh {
22 class Nodes;
23 }
24 } // namespace atlas
25 
26 namespace atlas {
27 namespace mesh {
28 namespace actions {
29 
30 /*
31  * Build all parallel fields in the mesh
32  * - calls build_nodes_parallel_fields()
33  */
34 void build_parallel_fields( Mesh& mesh );
35 
36 /*
37  * Build parallel fields for the "nodes" function space if they don't exist.
38  * - glb_idx: create unique indices for non-positive values
39  * - partition: set to mpi::rank() for negative values
40  * - remote_idx: rebuild from scratch
41  */
42 void build_nodes_parallel_fields( mesh::Nodes& nodes );
43 
44 /*
45  * Build parallel fields for the "edges" function space if they don't exist.
46  * - glb_idx: create unique indices for non-positive values
47  * - partition: set to partition of node with lowest glb_idx
48  * - remote_idx: rebuild from scratch
49  *
50  * TODO: Make sure that the edge-partition is at least one of the partition
51  * numbers of the
52  * neighbouring elements.
53  * Because of this problem, the size of the halo should be set to 2
54  * instead of 1!!!
55  */
56 void build_edges_parallel_fields( Mesh& mesh );
57 
58 void build_cells_parallel_fields( Mesh& mesh );
59 
60 void renumber_nodes_glb_idx( mesh::Nodes& nodes );
61 
62 // ------------------------------------------------------------------
63 // C wrapper interfaces to C++ routines
64 
65 extern "C" {
66 void atlas__build_parallel_fields( Mesh::Implementation* mesh );
67 void atlas__build_nodes_parallel_fields( mesh::Nodes* nodes );
68 void atlas__build_edges_parallel_fields( Mesh::Implementation* mesh );
69 void atlas__renumber_nodes_glb_idx( mesh::Nodes* nodes );
70 }
71 
72 // ------------------------------------------------------------------
73 
74 } // namespace actions
75 } // namespace mesh
76 } // namespace atlas
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33