Debian Codegraph @

src/atlas/interpolation/method/MethodFactory.cc

raw
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 #include "MethodFactory.h"
12
13 // for static linking
14 #include "binning/Binning.h"
15 #include "cubedsphere/CubedSphereBilinear.h"
16 #include "knn/GridBoxAverage.h"
17 #include "knn/GridBoxMaximum.h"
18 #include "knn/KNearestNeighbours.h"
19 #include "knn/NearestNeighbour.h"
20 #include "sphericalvector/SphericalVector.h"
21 #include "structured/Cubic2D.h"
22 #include "structured/Cubic3D.h"
23 #include "structured/Linear2D.h"
24 #include "structured/Linear3D.h"
25 #include "structured/QuasiCubic2D.h"
26 #include "structured/QuasiCubic3D.h"
27 #include "structured/RegionalLinear2D.h"
28 #include "unstructured/FiniteElement.h"
29 #include "unstructured/ConservativeSphericalPolygonInterpolation.h"
30 #include "unstructured/UnstructuredBilinearLonLat.h"
31 #include "unstructured/SphericalMeanValue.h"
32
33
34 namespace atlas {
35 namespace interpolation {
36
37 namespace {
38
39 void force_link() {
40 static struct Link {
41 Link() {
42 MethodBuilder<method::UnstructuredBilinearLonLat>();
43 MethodBuilder<method::FiniteElement>();
44 MethodBuilder<method::KNearestNeighbours>();
45 MethodBuilder<method::NearestNeighbour>();
46 MethodBuilder<method::Linear2D>();
47 MethodBuilder<method::Linear3D>();
48 MethodBuilder<method::Cubic2D>();
49 MethodBuilder<method::Cubic3D>();
50 MethodBuilder<method::QuasiCubic2D>();
51 MethodBuilder<method::QuasiCubic3D>();
52 MethodBuilder<method::RegionalLinear2D>();
53 MethodBuilder<method::GridBoxAverage>();
54 MethodBuilder<method::GridBoxMaximum>();
55 MethodBuilder<method::CubedSphereBilinear>();
56 MethodBuilder<method::SphericalVector>();
57 MethodBuilder<method::Binning>();
58 MethodBuilder<method::ConservativeSphericalPolygonInterpolation>();
59 MethodBuilder<method::SphericalMeanValue>();
60 }
61 } link;
62 }
63
64 } // namespace
65
66 Method* MethodFactory::build(const std::string& name, const Method::Config& config) {
67 force_link();
68 auto factory = get(name);
69 return factory->make(config);
70 }
71
72 } // namespace interpolation
73 } // namespace atlas