atlas
PartitionPolygon.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 
15 
16 #pragma once
17 
18 #include <vector>
19 
20 #include "atlas/util/Object.h"
21 
22 #include "atlas/library/config.h"
23 #include "atlas/projection/Projection.h"
24 #include "atlas/util/Config.h"
25 #include "atlas/util/Polygon.h"
26 
27 namespace atlas {
28 namespace mesh {
29 namespace detail {
30 class MeshImpl;
31 }
32 } // namespace mesh
33 } // namespace atlas
34 
35 namespace atlas {
36 namespace mesh {
37 
42 public: // methods
43  //-- Constructors
44 
46  PartitionPolygon( const detail::MeshImpl& mesh, idx_t halo );
47 
48  //-- Accessors
49 
50  idx_t halo() const override { return halo_; }
51 
53  size_t footprint() const override;
54 
55  void outputPythonScript( const eckit::PathName&, const eckit::Configuration& = util::NoConfig() ) const override;
56 
57  PointsXY xy() const override;
58  PointsXY lonlat() const override;
59 
60  void allGather( util::PartitionPolygons& ) const override;
61 
62 private:
63  void print( std::ostream& ) const;
64 
65  friend std::ostream& operator<<( std::ostream& s, const PartitionPolygon& p ) {
66  p.print( s );
67  return s;
68  }
69 
70 private:
71  const detail::MeshImpl& mesh_;
72  idx_t halo_;
73 };
74 
75 //------------------------------------------------------------------------------------------------------
76 
77 } // namespace mesh
78 } // namespace atlas
Definition: Polygon.h:155
Definition: Polygon.h:98
Definition: MeshImpl.h:54
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
Definition: Config.h:148
long idx_t
Integer type for indices in connectivity tables.
Definition: config.h:42
idx_t halo() const override
Return value of halo.
Definition: PartitionPolygon.h:50
Polygon class that holds the boundary of a mesh partition.
Definition: PartitionPolygon.h:41