11 #ifndef TEST_INTERFACE_LOCALIZATION_H_
12 #define TEST_INTERFACE_LOCALIZATION_H_
20 #define ECKIT_TESTING_SELF_REGISTER_CASES 0
22 #include <boost/noncopyable.hpp>
24 #include "eckit/config/LocalConfiguration.h"
25 #include "eckit/testing/Test.h"
33 #include "oops/util/DateTime.h"
54 return theLocalizationFixture;
69 oops::Log::test() <<
"Testing localization: " << *
local_ << std::endl;
72 ~LocalizationFixture<MODEL>() {}
74 std::unique_ptr<const Geometry_>
resol_;
75 std::unique_ptr<const oops::Variables>
ctlvars_;
76 std::unique_ptr<const util::DateTime>
time_;
77 std::unique_ptr<Localization_>
local_;
86 Increment_ dx(Test_::resol(), Test_::ctlvars(), Test_::time());
88 Test_::localization().randomize(dx);
89 EXPECT(dx.norm() > 0.0);
98 Increment_ dx(Test_::resol(), Test_::ctlvars(), Test_::time());
100 EXPECT(dx.norm() == 0.0);
101 Test_::localization().multiply(dx);
102 EXPECT(dx.norm() == 0.0);
111 Increment_ dx(Test_::resol(), Test_::ctlvars(), Test_::time());
114 EXPECT(dx.norm() > 0.0);
115 Test_::localization().multiply(dx);
116 EXPECT(dx.norm() > 0.0);
126 std::string
testid()
const override {
return "test::Localization<" + MODEL::name() +
">";}
129 std::vector<eckit::testing::Test>& ts = eckit::testing::specification();
131 ts.emplace_back(
CASE(
"interface/Localization/testLocalizationRandomize")
132 { testLocalizationRandomize<MODEL>(); });
133 ts.emplace_back(
CASE(
"interface/Localization/testLocalizationZero")
134 { testLocalizationZero<MODEL>(); });
135 ts.emplace_back(
CASE(
"interface/Localization/testLocalizationMultiply")
136 { testLocalizationMultiply<MODEL>(); });
Geometry class used in oops; subclass of interface class interface::Geometry.
Increment class used in oops.
Abstract model-space localization class used by high level algorithms and applications.
static const oops::Variables & ctlvars()
oops::Localization< MODEL > Localization_
static const Localization_ & localization()
std::unique_ptr< const oops::Variables > ctlvars_
oops::IncrementEnsemble< MODEL > Ensemble_
std::unique_ptr< Localization_ > local_
std::unique_ptr< const util::DateTime > time_
std::unique_ptr< const Geometry_ > resol_
oops::Geometry< MODEL > Geometry_
static const Geometry_ & resol()
static LocalizationFixture< MODEL > & getInstance()
static const util::DateTime & time()
void clear() const override
void register_tests() const override
std::string testid() const override
static const eckit::Configuration & config()
const eckit::mpi::Comm & world()
Default communicator with all MPI tasks (ie MPI_COMM_WORLD)
void testLocalizationRandomize()
void testLocalizationMultiply()
void testLocalizationZero()
CASE("test_linearmodelparameterswrapper_valid_name")