Debian Codegraph @

src/atlas/grid/CubedSphereGrid.cc

raw
1 /*
2 * (C) Copyright 2020 UCAR
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 */
7
8
9 #include <string>
10
11 #include "atlas/grid/CubedSphereGrid.h"
12 #include "atlas/grid/Grid.h"
13 #include "atlas/grid/detail/grid/CubedSphere.h"
14 #include "atlas/projection/Projection.h"
15
16 namespace atlas {
17
18 inline const CubedSphereGrid::grid_t* cubedsphere_grid(const Grid::Implementation* grid) {
19 return dynamic_cast<const CubedSphereGrid::grid_t*>(grid);
20 }
21
22 CubedSphereGrid::CubedSphereGrid(): Grid(), grid_(nullptr) {}
23
24 CubedSphereGrid::CubedSphereGrid(const Grid& grid): Grid(grid), grid_(cubedsphere_grid(get())) {}
25
26 CubedSphereGrid::CubedSphereGrid(const Grid::Implementation* grid): Grid(grid), grid_(cubedsphere_grid(get())) {}
27
28 CubedSphereGrid::CubedSphereGrid(const std::string& grid): Grid(grid), grid_(cubedsphere_grid(get())) {}
29
30 CubedSphereGrid::CubedSphereGrid(const int& N, const Projection& projection):
31 Grid(new CubedSphereGrid::grid_t(N, projection, "C")), grid_(cubedsphere_grid(get())) {}
32
33 } // namespace atlas