diff --git a/dune/gdt/local/operators/integrals.hh b/dune/gdt/local/operators/integrals.hh index df7f4e865860dc2581f04e0d54032b8107613136..9746c397fc5a94dac937c65c9db9c8e8833f0d8a 100644 --- a/dune/gdt/local/operators/integrals.hh +++ b/dune/gdt/local/operators/integrals.hh @@ -119,7 +119,7 @@ public: const XT::Functions::LocalfunctionSetInterface<EO, D, d, R, rA, rCA>& ansatz_base, Dune::DynamicMatrix<R>& ret) const { - static_assert(std::is_same<EO,E>::value, "Additional EO tpl only added for clang compat"); + static_assert(std::is_same<EO, E>::value, "Additional EO tpl only added for clang compat"); const auto& entity = ansatz_base.entity(); const auto local_functions = integrand_.localFunctions(entity); // create quadrature diff --git a/dune/gdt/playground/timestepper/rosenbrock.hh b/dune/gdt/playground/timestepper/rosenbrock.hh index d56b58807fd70f074bf4eb6161bbd6b67406524a..1669b1065c0643167769611b1d8a871159641264 100644 --- a/dune/gdt/playground/timestepper/rosenbrock.hh +++ b/dune/gdt/playground/timestepper/rosenbrock.hh @@ -83,8 +83,8 @@ struct RosenbrockButcherArrayProvider<RangeFieldType, TimeFieldType, RosenbrockT static Dune::DynamicMatrix<RangeFieldType> A() { return Dune::XT::Common::from_string<Dune::DynamicMatrix<RangeFieldType>>(std::string("[0 0 0 0;") + " 0.438 0 0 0;" - + " 0.796920457938 0.0730795420615 0 0;" - + " 0.796920457938 0.0730795420615 0 0]"); + + " 0.796920457938 0.0730795420615 0 0;" + + " 0.796920457938 0.0730795420615 0 0]"); } static Dune::DynamicVector<RangeFieldType> b_1() @@ -118,9 +118,9 @@ struct RosenbrockButcherArrayProvider<RangeFieldType, TimeFieldType, RosenbrockT { static Dune::DynamicMatrix<RangeFieldType> A() { - return Dune::XT::Common::from_string<Dune::DynamicMatrix<RangeFieldType>>(std::string("[0 0 0 0;") + " 0.462 0 0 0;" - + " -0.0815668168327 0.961775150166 0 0;" - + " -0.0815668168327 0.961775150166 0 0]"); + return Dune::XT::Common::from_string<Dune::DynamicMatrix<RangeFieldType>>( + std::string("[0 0 0 0;") + " 0.462 0 0 0;" + " -0.0815668168327 0.961775150166 0 0;" + + " -0.0815668168327 0.961775150166 0 0]"); } static Dune::DynamicVector<RangeFieldType> b_1() diff --git a/dune/gdt/test/CMakeLists.txt b/dune/gdt/test/CMakeLists.txt index 28e6e5ac64d2b202e9ab38767603c944b8c233f2..e024f2611cee8e059e8a66eb2b5f4c6a0154fd9b 100644 --- a/dune/gdt/test/CMakeLists.txt +++ b/dune/gdt/test/CMakeLists.txt @@ -13,7 +13,7 @@ BEGIN_TESTCASES() END_TESTCASES() foreach (test ${dxt_test_binaries}) - if (test MATCHES spaces) + if (${test} MATCHES spaces) list(APPEND spaces_test_binaries ${test}) elseif (${test} MATCHES operators) list(APPEND operators_test_binaries ${test}) @@ -83,28 +83,15 @@ endif (NOT ${SPE10MODEL1DATA} STREQUAL "SPE10MODEL1DATA-NOTFOUND") add_subdirectory(linearelliptic) add_subdirectory(hyperbolic) -target_link_libraries(test_linearelliptic__cg_discretization__alugrid_fem_eigen expectations_linearelliptic_cg_discretizations_alugrid) -target_link_libraries(test_linearelliptic__cg_discretization__yaspgrid_fem_eigen expectations_linearelliptic_cg_discretizations_yaspgrid) -target_link_libraries(test_linearelliptic__cg_discretization__alugrid_fem_istl expectations_linearelliptic_cg_discretizations_alugrid) -target_link_libraries(test_linearelliptic__cg_discretization__yaspgrid_fem_istl expectations_linearelliptic_cg_discretizations_yaspgrid) -target_link_libraries(test_linearelliptic__cg_discretization__alugrid_pdelab_eigen expectations_linearelliptic_cg_discretizations_alugrid) -target_link_libraries(test_linearelliptic__cg_discretization__yaspgrid_pdelab_eigen expectations_linearelliptic_cg_discretizations_yaspgrid) -target_link_libraries(test_linearelliptic__cg_discretization__alugrid_pdelab_istl expectations_linearelliptic_cg_discretizations_alugrid) -target_link_libraries(test_linearelliptic__cg_discretization__yaspgrid_pdelab_istl expectations_linearelliptic_cg_discretizations_yaspgrid) -target_link_libraries(test_linearelliptic__swipdg_discretization__alugrid_fem_eigen expectations_linearelliptic_swipdg_discretizations_alugrid) -target_link_libraries(test_linearelliptic__swipdg_discretization__yaspgrid_fem_eigen expectations_linearelliptic_swipdg_discretizations_yaspgrid) -target_link_libraries(test_linearelliptic__swipdg_discretization__alugrid_fem_istl expectations_linearelliptic_swipdg_discretizations_alugrid) -target_link_libraries(test_linearelliptic__swipdg_discretization__yaspgrid_fem_istl expectations_linearelliptic_swipdg_discretizations_yaspgrid) -target_link_libraries(test_linearelliptic__swipdg_discretization__yaspgrid_pdelab_eigen expectations_linearelliptic_swipdg_discretizations_yaspgrid) -target_link_libraries(test_linearelliptic__swipdg_discretization__yaspgrid_pdelab_istl expectations_linearelliptic_swipdg_discretizations_yaspgrid) - -target_link_libraries(test_linearelliptic__swipdg_estimators__alugrid_fem_eigen expectations_linearelliptic_swipdg_discretizations_alugrid - expectations_linearelliptic_swipdg_estimators_alugrid) -target_link_libraries(test_linearelliptic__swipdg_estimators__alugrid_fem_istl expectations_linearelliptic_swipdg_discretizations_alugrid - expectations_linearelliptic_swipdg_estimators_alugrid) - -target_link_libraries(test_hyperbolic__fv_discretization__yaspgrid_godunov_euler expectations_hyperbolic_fv_discretizations_yaspgrid) -target_link_libraries(test_hyperbolic__fv_discretization__yaspgrid_godunov_reconstruction_euler expectations_hyperbolic_fv_discretizations_yaspgrid) -target_link_libraries(test_hyperbolic__fv_discretization__yaspgrid_laxfriedrichs_euler expectations_hyperbolic_fv_discretizations_yaspgrid) -target_link_libraries(test_hyperbolic__fv_discretization__yaspgrid_godunov_adaptive_rungekutta expectations_hyperbolic_fv_discretizations_yaspgrid) +foreach(test_target ${dxt_test_binaries}) + if(${test_target} MATCHES linearelliptic__) + target_link_libraries(${test_target} cg_expectations) + endif(${test_target} MATCHES linearelliptic__) + if(${test_target} MATCHES linearelliptic__) + target_link_libraries(${test_target} swipdg_expectations) + endif(${test_target} MATCHES linearelliptic__) + if(${test_target} MATCHES hyperbolic__fv_discretization) + target_link_libraries(${test_target} expectations_hyperbolic_fv_discretizations_yaspgrid) + endif(${test_target} MATCHES hyperbolic__fv_discretization) +endforeach(${test_target} ${dxt_test_binaries}) diff --git a/dune/gdt/test/grids.hh b/dune/gdt/test/grids.hh index 9b3c3a5a3a8e2465a6ad001b7e46a9d597e19975..7af884aa64def3da3569cd9a67fa2f479153c9db 100644 --- a/dune/gdt/test/grids.hh +++ b/dune/gdt/test/grids.hh @@ -28,7 +28,8 @@ Yasp##dim##dLeafGridViewType; \ typedef typename Dune::GDT::SpaceTools:: \ LevelGridPartView<Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates<double, dim>>, true>::Type \ - Yasp##dim##dLevelGridViewType; + Yasp##dim##dLevelGridViewType; \ + typedef Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates<double, dim>> Yasp##dim##Grid; YASPGRID_TYPES(1) YASPGRID_TYPES(2) YASPGRID_TYPES(3) diff --git a/dune/gdt/test/grids.mini b/dune/gdt/test/grids.mini new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dune/gdt/test/hyperbolic/CMakeLists.txt b/dune/gdt/test/hyperbolic/CMakeLists.txt index 807b116319b8268fd465b5035849d2fe49c672fa..b20e30f5092ca1e9a1cc8eab482d2e5766326e10 100644 --- a/dune/gdt/test/hyperbolic/CMakeLists.txt +++ b/dune/gdt/test/hyperbolic/CMakeLists.txt @@ -7,7 +7,7 @@ # Tobias Leibner (2016) # expectation targets -add_library(expectations_hyperbolic_fv_discretizations_yaspgrid +dune_add_library(expectations_hyperbolic_fv_discretizations_yaspgrid STATIC EXCLUDE_FROM_ALL eocexpectations-fv-sourcebeam-1dyaspgrid.cxx @@ -19,8 +19,3 @@ add_library(expectations_hyperbolic_fv_discretizations_yaspgrid eocexpectations-fv-shallowwater-1dyaspgrid.cxx eocexpectations-fv-shocktube-1dyaspgrid.cxx) -# add some compile flags -foreach (_target expectations_hyperbolic_fv_discretizations_yaspgrid) - add_dune_mpi_flags(${_target}) -endforeach (_target) - diff --git a/dune/gdt/test/hyperbolic/all_eocexpectations.hh b/dune/gdt/test/hyperbolic/all_eocexpectations.hh new file mode 100644 index 0000000000000000000000000000000000000000..858b04f0816087e15dc83f1eff985c0144db9539 --- /dev/null +++ b/dune/gdt/test/hyperbolic/all_eocexpectations.hh @@ -0,0 +1,13 @@ +#include "eocexpectations_base.hh" +#include "eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.hh" +#include "eocexpectations-fv-burgers-1dyaspgrid.hh" +#include "eocexpectations-fv-burgers-2dyaspgrid.hh" +#include "eocexpectations-fv-shallowwater-1dyaspgrid.hh" +#include "eocexpectations-fv-shocktube-1dyaspgrid.hh" +#include "eocexpectations-fv-sourcebeam-1dyaspgrid.hh" +#include "eocexpectations-fv-transport-1dyaspgrid.hh" +#include "eocexpectations-fv-transport-2dyaspgrid.hh" +#include "eocexpectations.hh" +#include "eocstudy.hh" +#include "fv-discretization.hh" +#include "problems.hh" diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.cxx b/dune/gdt/test/hyperbolic/eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.cxx index 81630e16e9be9ddd3d82221914be95ad7acfa7e4..e5a95fa7b155756fa1457965d058d22c03975a84 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.cxx +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.cxx @@ -1,55 +1,31 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) -// Tobias Leibner (2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> - -#include "problems/2dboltzmann.hh" -#include "eocexpectations.hh" - - +#include <config.h> +#include "eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.hh" namespace Dune { namespace GDT { -namespace Tests { +namespace Test { -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<2> +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 3.2)) - return {2.27e+00, 1.09e+00}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 3.2 / 5.0)) - return {1.12e-01, 6.11e-02}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template class HyperbolicEocExpectations<Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler>; - - -} // namespace Tests + if (type == "L1") { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 3.2)) + return {2.27e+00, 1.09e+00}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 3.2 / 5.0)) + return {1.12e-01, 6.11e-02}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.hh b/dune/gdt/test/hyperbolic/eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..fc05b7d581902b794b7691edb0702018eb7a9d0b --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-boltzmanncheckerboard-2dyaspgrid.hh @@ -0,0 +1,38 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) +// Tobias Leibner (2016) + +#include "config.h" + +#include <dune/grid/yaspgrid.hh> + +#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> + +#include "problems/2dboltzmann.hh" +#include "eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class HyperbolicEocExpectations<Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler> : public internal::HyperbolicEocExpectationsBase<2> +{ + typedef Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + + +} // namespace Tests +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-1dyaspgrid.cxx b/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-1dyaspgrid.cxx index 057cf430becfb553c1f3f60cce4d019f73e8ba2f..bcdf11993fcf8e504be7e43b3e9385a57db3cc95 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-1dyaspgrid.cxx +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-1dyaspgrid.cxx @@ -1,119 +1,80 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) -// Tobias Leibner (2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> - -#include "problems/burgers.hh" -#include "eocexpectations.hh" - - +#include <config.h> +#include "eocexpectations-fv-burgers-1dyaspgrid.hh" namespace Dune { namespace GDT { -namespace Tests { - - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<1> +namespace Test { + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::BurgersTestCase<Yasp1, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {8.96e-02, 3.87e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {1.33e-02, 6.34e-03}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {1.13e-01, 6.17e-02, 2.88e-02, 1.24e-02, 4.82e-03}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov, TimeStepperMethods::dormand_prince, anything> - : public internal::HyperbolicEocExpectationsBase<1> + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {8.96e-02, 3.87e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {1.33e-02, 6.34e-03}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {1.13e-01, 6.17e-02, 2.88e-02, 1.24e-02, 4.82e-03}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::dormand_prince>:: + results(const HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::dormand_prince>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::BurgersTestCase<Yasp1, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {8.64e-02, 3.72e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {1.33e-02, 6.33e-03}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {1.15e-01, 6.48e-02, 3.31e-02, 1.52e-02, 5.68e-03}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<1> + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {8.64e-02, 3.72e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {1.33e-02, 6.33e-03}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {1.15e-01, 6.48e-02, 3.31e-02, 1.52e-02, 5.68e-03}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::laxfriedrichs, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::BurgersTestCase<Yasp1, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {1.03e-01, 5.58e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {1.71e-02, 7.63e-03}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + if (type == "L1") { + if (test_case.num_refinements() == 1) + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {1.03e-01, 5.58e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {1.71e-02, 7.63e-03}; else - return {1.76e-01, 1.30e-01, 7.79e-02, 3.85e-02, 1.41e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler>; - -template class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, - TimeStepperMethods::dormand_prince>; - -template class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::laxfriedrichs, - TimeStepperMethods::explicit_euler>; - - -} // namespace Tests + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + else + return {1.76e-01, 1.30e-01, 7.79e-02, 3.85e-02, 1.41e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-1dyaspgrid.hh b/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-1dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..cade15f2992aa08db76100d5096b7ce8fa843ab3 --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-1dyaspgrid.hh @@ -0,0 +1,60 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) +// Tobias Leibner (2016) + +#include "config.h" + +#include <dune/grid/yaspgrid.hh> + +#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> + +#include "problems/burgers.hh" +#include "eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::BurgersTestCase<Yasp1, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::dormand_prince> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::BurgersTestCase<Yasp1, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::BurgersTestCase<Yasp1, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + + +} // namespace Tests +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-2dyaspgrid.cxx b/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-2dyaspgrid.cxx index 36969ad48af401b6f558d25b8a471e174502f80e..63516a700c21de03d3235203fd1dec1bd69091c1 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-2dyaspgrid.cxx +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-2dyaspgrid.cxx @@ -1,55 +1,30 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) -// Tobias Leibner (2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> - -#include "problems/burgers.hh" -#include "eocexpectations.hh" - - +#include <config.h> +#include "eocexpectations-fv-burgers-2dyaspgrid.hh" namespace Dune { namespace GDT { -namespace Tests { - - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, - NumericalFluxes::godunov, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<2> +namespace Test { + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp2, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::BurgersTestCase<Yasp2, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {1.79e-03, 8.44e-04}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {3.60e-04, 1.70e-04}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - EXPECT_TRUE(false) << "test results missing for type: " << type; - } - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp2, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler>; - - -} // namespace Tests + if (type == "L1") { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {1.79e-03, 8.44e-04}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {3.60e-04, 1.70e-04}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + EXPECT_TRUE(false) << "test results missing for type: " << type; + } + return {}; +} + +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-2dyaspgrid.hh b/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..1c1fc076c35e3312569c8a2c76d11b6f1ea7ebd0 --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-burgers-2dyaspgrid.hh @@ -0,0 +1,38 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) +// Tobias Leibner (2016) + +#include "config.h" + +#include <dune/grid/yaspgrid.hh> + +#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> + +#include "problems/burgers.hh" +#include "eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class HyperbolicEocExpectations<Hyperbolic::BurgersTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<2> +{ + typedef Hyperbolic::BurgersTestCase<Yasp2, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + + +} // namespace Tests +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-shallowwater-1dyaspgrid.cxx b/dune/gdt/test/hyperbolic/eocexpectations-fv-shallowwater-1dyaspgrid.cxx index 270cea2736f2cd1b372f7347b097b70cd34efa98..fe39135e5dc7b6e2d1ee5b20242b584f973076de 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations-fv-shallowwater-1dyaspgrid.cxx +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-shallowwater-1dyaspgrid.cxx @@ -1,58 +1,34 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) -// Tobias Leibner (2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> - -#include "problems/shallowwater.hh" -#include "eocexpectations.hh" - - +#include <config.h> +#include "eocexpectations-fv-shallowwater-1dyaspgrid.hh" namespace Dune { namespace GDT { -namespace Tests { +namespace Test { -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::ShallowWaterTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<1> +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::ShallowWaterTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::ShallowWaterTestCase<Yasp1, double>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::ShallowWaterTestCase<Yasp1, double> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 3.0)) - return {3.02e+00, 1.59e+00}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 3.0 / 5.0)) - return {5.03e-01, 2.31e-01}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {4.10e+00, 2.82e+00, 1.41e+00}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template class HyperbolicEocExpectations<Hyperbolic::ShallowWaterTestCase<Yasp1, double>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler>; - - -} // namespace Tests + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 3.0)) + return {3.02e+00, 1.59e+00}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 3.0 / 5.0)) + return {5.03e-01, 2.31e-01}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {4.10e+00, 2.82e+00, 1.41e+00}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-shallowwater-1dyaspgrid.hh b/dune/gdt/test/hyperbolic/eocexpectations-fv-shallowwater-1dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..f56c4b06d0f3e0d662d6287049a55869b0cbc20b --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-shallowwater-1dyaspgrid.hh @@ -0,0 +1,38 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) +// Tobias Leibner (2016) + +#include "config.h" + +#include <dune/grid/yaspgrid.hh> + +#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> + +#include "problems/shallowwater.hh" +#include "eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class HyperbolicEocExpectations<Hyperbolic::ShallowWaterTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::ShallowWaterTestCase<Yasp1, double> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + + +} // namespace Tests +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-shocktube-1dyaspgrid.cxx b/dune/gdt/test/hyperbolic/eocexpectations-fv-shocktube-1dyaspgrid.cxx index 1ec12234600b86b895b2f077412141c187ccfbcb..6218d1b030f635fdb7f5d2cd8454527868616346 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations-fv-shocktube-1dyaspgrid.cxx +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-shocktube-1dyaspgrid.cxx @@ -1,119 +1,80 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) -// Tobias Leibner (2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> - -#include "problems/sodshocktube.hh" -#include "eocexpectations.hh" - - +#include <config.h> +#include "eocexpectations-fv-shocktube-1dyaspgrid.hh" namespace Dune { namespace GDT { -namespace Tests { - - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<1> +namespace Test { + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::ShockTubeTestCase<Yasp1, double> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25)) - return {6.95e-02, 4.88e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25 / 5.0)) - return {6.68e-03, 4.69e-03}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {6.99e-02, 4.93e-02, 3.30e-02, 2.05e-02}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov, TimeStepperMethods::dormand_prince, anything> - : public internal::HyperbolicEocExpectationsBase<1> + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25)) + return {6.95e-02, 4.88e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25 / 5.0)) + return {6.68e-03, 4.69e-03}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {6.99e-02, 4.93e-02, 3.30e-02, 2.05e-02}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::dormand_prince>:: + results(const HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::dormand_prince>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::ShockTubeTestCase<Yasp1, double> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25)) - return {7.01e-02, 4.98e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25 / 5.0)) - return {6.68e-03, 4.71e-03}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {7.05e-02, 5.04e-02, 3.47e-02, 2.32e-02}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<1> + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25)) + return {7.01e-02, 4.98e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25 / 5.0)) + return {6.68e-03, 4.71e-03}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {7.05e-02, 5.04e-02, 3.47e-02, 2.32e-02}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::laxfriedrichs, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::ShockTubeTestCase<Yasp1, double> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25)) - return {8.82e-02, 6.65e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25 / 5.0)) - return {8.66e-03, 6.02e-03}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + if (type == "L1") { + if (test_case.num_refinements() == 1) + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25)) + return {8.82e-02, 6.65e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 0.25 / 5.0)) + return {8.66e-03, 6.02e-03}; else - return {8.86e-02, 6.70e-02, 4.91e-02, 3.42e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler>; - -template class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, - TimeStepperMethods::dormand_prince>; - -template class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::laxfriedrichs, - TimeStepperMethods::explicit_euler>; - - -} // namespace Tests + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + else + return {8.86e-02, 6.70e-02, 4.91e-02, 3.42e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-shocktube-1dyaspgrid.hh b/dune/gdt/test/hyperbolic/eocexpectations-fv-shocktube-1dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..42a72533958839674d6de983f8b51205514a3e29 --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-shocktube-1dyaspgrid.hh @@ -0,0 +1,60 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) +// Tobias Leibner (2016) + +#include "config.h" + +#include <dune/grid/yaspgrid.hh> + +#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> + +#include "problems/sodshocktube.hh" +#include "eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::ShockTubeTestCase<Yasp1, double> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::dormand_prince> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::ShockTubeTestCase<Yasp1, double> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::ShockTubeTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::ShockTubeTestCase<Yasp1, double> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + + +} // namespace Tests +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-sourcebeam-1dyaspgrid.cxx b/dune/gdt/test/hyperbolic/eocexpectations-fv-sourcebeam-1dyaspgrid.cxx index f9122d4d458a5efe7975bb7825b00ac4e1a18714..d6228b363650e74e71c0860eac9d2c92a165c1b4 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations-fv-sourcebeam-1dyaspgrid.cxx +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-sourcebeam-1dyaspgrid.cxx @@ -1,84 +1,53 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) -// Tobias Leibner (2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> - -#include "problems/fokkerplanck/sourcebeam.hh" -#include "eocexpectations.hh" - - +#include <config.h> +#include "eocexpectations-fv-sourcebeam-1dyaspgrid.hh" namespace Dune { namespace GDT { -namespace Tests { +namespace Test { -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<1> +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::SourceBeamTestCase<Yasp1, double> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { + if (type == "L1") { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 4.0)) + return {3.25e-01, 1.63e-01}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 4.0 / 5.0)) + return {9.16e-02, 4.08e-02}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov_with_reconstruction, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, + Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov_with_reconstruction, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) +{ + if (type == "L1") { + if (test_case.num_refinements() == 1) { if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 4.0)) - return {3.25e-01, 1.63e-01}; + return {2.63e-01, 1.39e-01}; else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 4.0 / 5.0)) - return {9.16e-02, 4.08e-02}; + return {7.07e-02, 3.13e-02}; else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov_with_reconstruction, TimeStepperMethods::explicit_euler, - anything> : public internal::HyperbolicEocExpectationsBase<1> -{ - typedef Hyperbolic::SourceBeamTestCase<Yasp1, double> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 4.0)) - return {2.63e-01, 1.39e-01}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 4.0 / 5.0)) - return {7.07e-02, 3.13e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template class HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler>; - -template class HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, - Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov_with_reconstruction, - TimeStepperMethods::explicit_euler>; - - -} // namespace Tests + EXPECT_TRUE(false) << "test results missing for type: " << type; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-sourcebeam-1dyaspgrid.hh b/dune/gdt/test/hyperbolic/eocexpectations-fv-sourcebeam-1dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..220f93c2dfe62fbfc6af1d7abc1e65a5c82776cc --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-sourcebeam-1dyaspgrid.hh @@ -0,0 +1,49 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) +// Tobias Leibner (2016) + +#include "config.h" + +#include <dune/grid/yaspgrid.hh> + +#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> + +#include "problems/fokkerplanck/sourcebeam.hh" +#include "eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::SourceBeamTestCase<Yasp1, double> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::SourceBeamTestCase<Yasp1, double>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov_with_reconstruction, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::SourceBeamTestCase<Yasp1, double> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + + +} // namespace Tests +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-1dyaspgrid.cxx b/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-1dyaspgrid.cxx index f0e2772383e71bb1dc08365be906e0a1a637e775..589a0506df661983465693020b81257f96f6145d 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-1dyaspgrid.cxx +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-1dyaspgrid.cxx @@ -1,150 +1,114 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) -// Tobias Leibner (2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> - -#include "problems/transport.hh" -#include "eocexpectations.hh" - - +#include <config.h> +#include "eocexpectations-fv-transport-1dyaspgrid.hh" namespace Dune { namespace GDT { -namespace Tests { - - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<1> +namespace Test { + +std::vector<double> +Dune::GDT::Test::HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>:: + results( + const Dune::GDT::Test::HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::TransportTestCase<Yasp1, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {3.33e-01, 2.95e-01}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {5.02e-02, 3.51e-02}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + if (type == "L1") { + if (test_case.num_refinements() == 1) + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {3.33e-01, 2.95e-01}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {5.02e-02, 3.51e-02}; else - return {3.44e-01, 3.10e-01, 2.40e-01, 1.64e-01, 1.09e-01}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov, TimeStepperMethods::dormand_prince, anything> - : public internal::HyperbolicEocExpectationsBase<1> + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + else + return {3.44e-01, 3.10e-01, 2.40e-01, 1.64e-01, 1.09e-01}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +Dune::GDT::Test::HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::dormand_prince>:: + results( + const Dune::GDT::Test::HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, + TimeStepperMethods::dormand_prince>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::TransportTestCase<Yasp1, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {3.36e-01, 3.05e-01}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {5.03e-02, 3.55e-02}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + if (type == "L1") { + if (test_case.num_refinements() == 1) + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {3.36e-01, 3.05e-01}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {5.03e-02, 3.55e-02}; else - return {3.46e-01, 3.19e-01, 2.72e-01, 2.10e-01, 1.51e-01}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<1> + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + else + return {3.46e-01, 3.19e-01, 2.72e-01, 2.10e-01, 1.51e-01}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +Dune::GDT::Test::HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::laxfriedrichs, + TimeStepperMethods::explicit_euler>:: + results( + const Dune::GDT::Test::HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::laxfriedrichs, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::TransportTestCase<Yasp1, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {3.46e-01, 3.35e-01}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {5.69e-02, 4.67e-02}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {3.57e-01, 3.48e-01, 3.12e-01, 2.50e-01, 1.87e-01}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov_with_reconstruction, TimeStepperMethods::explicit_euler, - anything> : public internal::HyperbolicEocExpectationsBase<1> + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {3.46e-01, 3.35e-01}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {5.69e-02, 4.67e-02}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {3.57e-01, 3.48e-01, 3.12e-01, 2.50e-01, 1.87e-01}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +Dune::GDT::Test::HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov_with_reconstruction, + TimeStepperMethods::explicit_euler>:: + results( + const Dune::GDT::Test::HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov_with_reconstruction, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::TransportTestCase<Yasp1, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {4.75e-01, 2.81e-01}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {4.75e-02, 2.81e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - } else { - return {3.29e-01, 2.47e-01, 1.06e-01, 3.83e-02, 3.33e-02}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler>; - -template class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::godunov, - TimeStepperMethods::dormand_prince>; - -template class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 1, NumericalFluxes::laxfriedrichs, - TimeStepperMethods::explicit_euler>; - -template class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 1, - NumericalFluxes::godunov_with_reconstruction, - TimeStepperMethods::explicit_euler>; - - -} // namespace Tests + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {4.75e-01, 2.81e-01}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {4.75e-02, 2.81e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + } else { + return {3.29e-01, 2.47e-01, 1.06e-01, 3.83e-02, 3.33e-02}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-1dyaspgrid.hh b/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-1dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..4d370dd5da4aee4fd8c882873040556074074940 --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-1dyaspgrid.hh @@ -0,0 +1,71 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) +// Tobias Leibner (2016) + +#include "config.h" + +#include <dune/grid/yaspgrid.hh> + +#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> + +#include "problems/transport.hh" +#include "eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::TransportTestCase<Yasp1, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov, TimeStepperMethods::dormand_prince> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::TransportTestCase<Yasp1, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::TransportTestCase<Yasp1, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp1, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 1, + NumericalFluxes::godunov_with_reconstruction, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<1> +{ + typedef Hyperbolic::TransportTestCase<Yasp1, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + + +} // namespace Tests +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-2dyaspgrid.cxx b/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-2dyaspgrid.cxx index 5da0604f673922054d23aa39914df0d05df7bbba..0a4d02d15f0b06c5179c456aa18a6061d34b1c33 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-2dyaspgrid.cxx +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-2dyaspgrid.cxx @@ -1,120 +1,81 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) -// Tobias Leibner (2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> - -#include "problems/transport.hh" -#include "eocexpectations.hh" - - +#include <config.h> +#include "eocexpectations-fv-transport-2dyaspgrid.hh" namespace Dune { namespace GDT { -namespace Tests { - - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, - NumericalFluxes::godunov, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<2> +namespace Test { + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::TransportTestCase<Yasp2, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {7.29e-02, 7.51e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {1.23e-02, 1.04e-02}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {7.34e-02, 7.64e-02, 6.26e-02}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, - NumericalFluxes::godunov, TimeStepperMethods::dormand_prince, anything> - : public internal::HyperbolicEocExpectationsBase<2> + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {7.29e-02, 7.51e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {1.23e-02, 1.04e-02}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {7.34e-02, 7.64e-02, 6.26e-02}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, + NumericalFluxes::godunov, TimeStepperMethods::dormand_prince>:: + results(const HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, + TimeStepperMethods::dormand_prince>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::TransportTestCase<Yasp2, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {7.33e-02, 7.85e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {1.23e-02, 1.06e-02}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {7.39e-02, 7.96e-02, 7.76e-02}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template <bool anything> -class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, - NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler, anything> - : public internal::HyperbolicEocExpectationsBase<2> + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {7.33e-02, 7.85e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {1.23e-02, 1.06e-02}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {7.39e-02, 7.96e-02, 7.76e-02}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, + NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler>:: + results(const HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, + Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::laxfriedrichs, + TimeStepperMethods::explicit_euler>::TestCaseType& test_case, + const std::string type) { - typedef Hyperbolic::TransportTestCase<Yasp2, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L1") { - if (test_case.num_refinements() == 1) { - if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) - return {7.36e-02, 7.72e-02}; - else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) - return {1.27e-02, 1.10e-02}; - else - EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); - } else { - return {7.41e-02, 7.85e-02, 6.67e-02}; - } - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // HyperbolicEocExpectations - -template class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, - TimeStepperMethods::explicit_euler>; - -template class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, - TimeStepperMethods::dormand_prince>; - -template class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, - Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::laxfriedrichs, - TimeStepperMethods::explicit_euler>; - - -} // namespace Tests + if (type == "L1") { + if (test_case.num_refinements() == 1) { + if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0)) + return {7.36e-02, 7.72e-02}; + else if (Dune::XT::Common::FloatCmp::eq(test_case.t_end(), 1.0 / 5.0)) + return {1.27e-02, 1.10e-02}; + else + EXPECT_TRUE(false) << "test results missing for t_end = " << Dune::XT::Common::to_string(test_case.t_end()); + } else { + return {7.41e-02, 7.85e-02, 6.67e-02}; + } + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-2dyaspgrid.hh b/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..10cb3509e6280ede5f5b346a2d57fd12ba62d23d --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations-fv-transport-2dyaspgrid.hh @@ -0,0 +1,60 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) +// Tobias Leibner (2016) + +#include "config.h" + +#include <dune/grid/yaspgrid.hh> + +#include <dune/gdt/test/hyperbolic/discretizers/fv.hh> + +#include "problems/transport.hh" +#include "eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, + NumericalFluxes::godunov, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<2> +{ + typedef Hyperbolic::TransportTestCase<Yasp2, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, + NumericalFluxes::godunov, TimeStepperMethods::dormand_prince> + : public internal::HyperbolicEocExpectationsBase<2> +{ + typedef Hyperbolic::TransportTestCase<Yasp2, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + +template <> +class HyperbolicEocExpectations<Hyperbolic::TransportTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, + NumericalFluxes::laxfriedrichs, TimeStepperMethods::explicit_euler> + : public internal::HyperbolicEocExpectationsBase<2> +{ + typedef Hyperbolic::TransportTestCase<Yasp2, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // HyperbolicEocExpectations + + +} // namespace Tests +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations.hh b/dune/gdt/test/hyperbolic/eocexpectations.hh index afba5271680e1547a90603909bb0cde401946577..751f8d6207f1e0e39e5390a98f9b3366c057987c 100644 --- a/dune/gdt/test/hyperbolic/eocexpectations.hh +++ b/dune/gdt/test/hyperbolic/eocexpectations.hh @@ -15,40 +15,17 @@ #include "discretizers/base.hh" #include <dune/gdt/discretizations/default.hh> +#include <dune/gdt/test/grids.hh> + +#include "eocexpectations_base.hh" namespace Dune { namespace GDT { -namespace Tests { - -using Yasp1 = Dune::YaspGrid<1, Dune::EquidistantOffsetCoordinates<double, 1>>; -using Yasp2 = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>; - -namespace internal { - - -template <int dimDomain> -class HyperbolicEocExpectationsBase -{ -public: - static double rate(const std::string type) - { - if (type == "L1") { - if (dimDomain == 1) - return 0.5; - else - return 0.25; - } else { - EXPECT_TRUE(false) << "expected rate missing for type: " << type; - return 0; - } - } // ... rate(...) -}; // class HyperbolicEocExpectationsBase - +namespace Test { -} // namespace internal template <class TestCaseType, Hyperbolic::ChooseDiscretizer disc, size_t dimDomain, NumericalFluxes num_flux, - TimeStepperMethods time_stepper, bool anything = true> + TimeStepperMethods time_stepper> class HyperbolicEocExpectations : public internal::HyperbolicEocExpectationsBase<dimDomain> { public: @@ -70,7 +47,7 @@ public: }; // HyperbolicEocExpectations -} // namespace Tests +} // namespace Test } // namespace GDT } // namespace Dune diff --git a/dune/gdt/test/hyperbolic/eocexpectations_base.hh b/dune/gdt/test/hyperbolic/eocexpectations_base.hh new file mode 100644 index 0000000000000000000000000000000000000000..a8b2818d3b2a37ca5ec93b47b2ccf0839ed61257 --- /dev/null +++ b/dune/gdt/test/hyperbolic/eocexpectations_base.hh @@ -0,0 +1,50 @@ +#ifndef DUNE_GDT_TEST_HYPERBOLIC_EOCEXPECTATIONS_BASE_HH +#define DUNE_GDT_TEST_HYPERBOLIC_EOCEXPECTATIONS_BASE_HH + +#include "discretizers/base.hh" + +#include <dune/gdt/test/grids.hh> + +namespace Dune { +namespace GDT { +namespace Test { + + +using Yasp1 = Yasp1Grid; +using Yasp2 = Yasp2Grid; + +namespace internal { + + +template <int dimDomain> +class HyperbolicEocExpectationsBase +{ +public: + static double rate(const std::string type) + { + if (type == "L1") { + if (dimDomain == 1) + return 0.5; + else + return 0.25; + } else { + EXPECT_TRUE(false) << "expected rate missing for type: " << type; + return 0; + } + } // ... rate(...) +}; // class HyperbolicEocExpectationsBase + + +} // namespace internal + +template <class TestCaseType, Hyperbolic::ChooseDiscretizer disc, size_t dimDomain, NumericalFluxes num_flux, + TimeStepperMethods time_stepper> +class HyperbolicEocExpectations; + + +} // namespace Test +} // namespace GDT +} // namespace Dune + + +#endif // DUNE_GDT_TEST_HYPERBOLIC_EOCEXPECTATIONS_BASE_HH diff --git a/dune/gdt/test/hyperbolic/eocstudy.hh b/dune/gdt/test/hyperbolic/eocstudy.hh index 4e1d40a8c400134b28a57a1164fcab633118e3a8..2f693ec187dffa0c3930e0cdd8d63db8ff42b455 100644 --- a/dune/gdt/test/hyperbolic/eocstudy.hh +++ b/dune/gdt/test/hyperbolic/eocstudy.hh @@ -14,11 +14,12 @@ #include <dune/xt/common/test/gtest/gtest.h> #include "../instationary-eocstudy.hh" -#include "eocexpectations.hh" +#include "eocexpectations_base.hh" +#include "all_eocexpectations.hh" namespace Dune { namespace GDT { -namespace Tests { +namespace Test { template <class TestCaseImp, class DiscretizerImp> diff --git a/dune/gdt/test/hyperbolic/fv-discretization.hh b/dune/gdt/test/hyperbolic/fv-discretization.hh index 9d83abae86627ba1b8a0f016608246ab7188c4cd..f83563a4cea6e66415134026b99b7c37be993f88 100644 --- a/dune/gdt/test/hyperbolic/fv-discretization.hh +++ b/dune/gdt/test/hyperbolic/fv-discretization.hh @@ -44,7 +44,7 @@ struct hyperbolic_FV_discretization_base : public ::testing::Test numerical_flux, time_stepper> Discretizer; - Tests::HyperbolicEocStudy<TestCaseType, Discretizer> eoc_study(test_case, {}); + Dune::GDT::Test::HyperbolicEocStudy<TestCaseType, Discretizer> eoc_study(test_case, {}); XT::Test::check_eoc_study_for_success(eoc_study, eoc_study.run(DXTC_LOG_INFO)); } // ... eoc_study() }; // hyperbolic_FV_discretization_base diff --git a/dune/gdt/test/hyperbolic/problems.hh b/dune/gdt/test/hyperbolic/problems.hh index b81a4722837f4aa67c687ea5e152d5aacf2c9de9..3b054650f0243fd933e665224dd00d29733002e0 100644 --- a/dune/gdt/test/hyperbolic/problems.hh +++ b/dune/gdt/test/hyperbolic/problems.hh @@ -19,7 +19,7 @@ #include <dune/gdt/test/hyperbolic/problems/fokkerplanck/sourcebeam.hh> using Yasp1 = Dune::YaspGrid<1, Dune::EquidistantOffsetCoordinates<double, 1>>; -using Yasp2 = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>; +using Yasp2 = Yasp2Grid; typedef testing::Types<Dune::GDT::Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double, 1>, Dune::GDT::Hyperbolic::BurgersTestCase<Yasp1>, Dune::GDT::Hyperbolic::BurgersTestCase<Yasp2>, @@ -42,7 +42,7 @@ typedef testing::Types<Dune::GDT::Hyperbolic::SourceBeamTestCase<Yasp1, double, namespace Dune { namespace GDT { -namespace Tests { +namespace Test { extern template class HyperbolicEocExpectations<Hyperbolic::Boltzmann2DCheckerboardTestCase<Yasp2, double, 1>, Hyperbolic::ChooseDiscretizer::fv, 2, NumericalFluxes::godunov, diff --git a/dune/gdt/test/hyperbolic/problems/2dboltzmann.hh b/dune/gdt/test/hyperbolic/problems/2dboltzmann.hh index a6432c18736a76b8cf253372ea42dc0a464d136d..94a1dd0a346d2654e8e68e831fa49d20db1b3451 100644 --- a/dune/gdt/test/hyperbolic/problems/2dboltzmann.hh +++ b/dune/gdt/test/hyperbolic/problems/2dboltzmann.hh @@ -505,7 +505,7 @@ public: template <class G, class R = double, size_t momentOrder = 1> class Boltzmann2DCheckerboardTestCase - : public Dune::GDT::Tests:: + : public Dune::GDT::Test:: NonStationaryTestCase<G, Problems::Boltzmann2DCheckerboard<typename G::template Codim<0>::Entity, typename G::ctype, G::dimension, R, momentOrder>> { @@ -520,7 +520,7 @@ public: static const size_t dimRangeCols = 1; private: - typedef typename Dune::GDT::Tests::NonStationaryTestCase<G, ProblemType> BaseType; + typedef typename Dune::GDT::Test::NonStationaryTestCase<G, ProblemType> BaseType; public: using typename BaseType::GridType; diff --git a/dune/gdt/test/hyperbolic/problems/burgers.hh b/dune/gdt/test/hyperbolic/problems/burgers.hh index 9380a454cda82e2edb82b129e47cfafddcb81ad9..b7c1ec41e45af86e503de3109c853ffe11660c5e 100644 --- a/dune/gdt/test/hyperbolic/problems/burgers.hh +++ b/dune/gdt/test/hyperbolic/problems/burgers.hh @@ -152,8 +152,8 @@ public: template <class G, class R = double, size_t r = 1, size_t rC = 1> class BurgersTestCase - : public Dune::GDT::Tests::NonStationaryTestCase<G, Problems::Burgers<typename G::template Codim<0>::Entity, - typename G::ctype, G::dimension, R, r, rC>> + : public Dune::GDT::Test::NonStationaryTestCase<G, Problems::Burgers<typename G::template Codim<0>::Entity, + typename G::ctype, G::dimension, R, r, rC>> { typedef typename G::template Codim<0>::Entity E; typedef typename G::ctype D; @@ -165,7 +165,7 @@ public: typedef Problems::Burgers<E, D, d, R, r> ProblemType; private: - typedef Tests::NonStationaryTestCase<G, ProblemType> BaseType; + typedef Test::NonStationaryTestCase<G, ProblemType> BaseType; public: using typename BaseType::GridType; diff --git a/dune/gdt/test/hyperbolic/problems/fokkerplanck/sourcebeam.hh b/dune/gdt/test/hyperbolic/problems/fokkerplanck/sourcebeam.hh index 66cf8f213c5205af5bcf6a347f0d5ca890cb99f9..31746006ff48e8603f04690566d0deff19c24f64 100644 --- a/dune/gdt/test/hyperbolic/problems/fokkerplanck/sourcebeam.hh +++ b/dune/gdt/test/hyperbolic/problems/fokkerplanck/sourcebeam.hh @@ -301,9 +301,9 @@ public: template <class G, class R = double, size_t momentOrder = 5> class SourceBeamTestCase - : public Dune::GDT::Tests::NonStationaryTestCase<G, Problems::SourceBeam<typename G::template Codim<0>::Entity, - typename G::ctype, G::dimension, R, - momentOrder>> + : public Dune::GDT::Test::NonStationaryTestCase<G, Problems::SourceBeam<typename G::template Codim<0>::Entity, + typename G::ctype, G::dimension, R, + momentOrder>> { typedef typename G::template Codim<0>::Entity E; typedef typename G::ctype D; @@ -316,7 +316,7 @@ public: static const size_t dimRangeCols = 1; private: - typedef typename Dune::GDT::Tests::NonStationaryTestCase<G, ProblemType> BaseType; + typedef typename Dune::GDT::Test::NonStationaryTestCase<G, ProblemType> BaseType; public: using typename BaseType::GridType; diff --git a/dune/gdt/test/hyperbolic/problems/shallowwater.hh b/dune/gdt/test/hyperbolic/problems/shallowwater.hh index b05a667e1f3feca33dc9ec8c838588f615abc8f0..bb2184f5ee0ef6ecdd64808bf532d0318e2eaf07 100644 --- a/dune/gdt/test/hyperbolic/problems/shallowwater.hh +++ b/dune/gdt/test/hyperbolic/problems/shallowwater.hh @@ -164,8 +164,8 @@ public: // Test case for shallow water equations, see LeVeque, Finite Volume Methods for Hyperbolic Problems, 2002, Example 13.1 template <class G, class R = double> class ShallowWaterTestCase - : public Dune::GDT::Tests::NonStationaryTestCase<G, Problems::ShallowWater<typename G::template Codim<0>::Entity, - typename G::ctype, G::dimension, R, 2>> + : public Dune::GDT::Test::NonStationaryTestCase<G, Problems::ShallowWater<typename G::template Codim<0>::Entity, + typename G::ctype, G::dimension, R, 2>> { typedef typename G::template Codim<0>::Entity E; typedef typename G::ctype D; @@ -177,7 +177,7 @@ public: typedef typename Problems::ShallowWater<E, D, d, R, 2> ProblemType; private: - typedef typename Dune::GDT::Tests::NonStationaryTestCase<G, ProblemType> BaseType; + typedef typename Dune::GDT::Test::NonStationaryTestCase<G, ProblemType> BaseType; public: using typename BaseType::GridType; diff --git a/dune/gdt/test/hyperbolic/problems/sodshocktube.hh b/dune/gdt/test/hyperbolic/problems/sodshocktube.hh index d9cfb1366b522ff0f69af8f8db3c74795565d4ef..09e92b3f1c1c609ad596e176ae4ce08b59dcf137 100644 --- a/dune/gdt/test/hyperbolic/problems/sodshocktube.hh +++ b/dune/gdt/test/hyperbolic/problems/sodshocktube.hh @@ -343,8 +343,8 @@ public: template <class G, class R = double> class ShockTubeTestCase - : public Dune::GDT::Tests::NonStationaryTestCase<G, Problems::ShockTube<typename G::template Codim<0>::Entity, - typename G::ctype, G::dimension, R, 3>> + : public Dune::GDT::Test::NonStationaryTestCase<G, Problems::ShockTube<typename G::template Codim<0>::Entity, + typename G::ctype, G::dimension, R, 3>> { typedef typename G::template Codim<0>::Entity E; typedef typename G::ctype D; @@ -356,7 +356,7 @@ public: typedef typename Problems::ShockTube<E, D, d, R, dimRange> ProblemType; private: - typedef typename Dune::GDT::Tests::NonStationaryTestCase<G, ProblemType> BaseType; + typedef typename Dune::GDT::Test::NonStationaryTestCase<G, ProblemType> BaseType; public: using typename BaseType::GridType; diff --git a/dune/gdt/test/hyperbolic/problems/transport.hh b/dune/gdt/test/hyperbolic/problems/transport.hh index fdaad41d5c65eba605208db64f3e617bc135eba6..bcd50c40b39f92862af9a3aae8503cb7a9814303 100644 --- a/dune/gdt/test/hyperbolic/problems/transport.hh +++ b/dune/gdt/test/hyperbolic/problems/transport.hh @@ -358,8 +358,8 @@ public: template <class G, class R = double, size_t r = 1, size_t rC = 1> class TransportTestCase - : public Dune::GDT::Tests::NonStationaryTestCase<G, Problems::Transport<typename G::template Codim<0>::Entity, - typename G::ctype, G::dimension, R, r, rC>> + : public Dune::GDT::Test::NonStationaryTestCase<G, Problems::Transport<typename G::template Codim<0>::Entity, + typename G::ctype, G::dimension, R, r, rC>> { typedef typename G::template Codim<0>::Entity E; typedef typename G::ctype D; @@ -371,7 +371,7 @@ public: typedef typename Problems::Transport<E, D, d, R, r, rC> ProblemType; private: - typedef typename Dune::GDT::Tests::NonStationaryTestCase<G, ProblemType> BaseType; + typedef typename Dune::GDT::Test::NonStationaryTestCase<G, ProblemType> BaseType; public: using typename BaseType::GridType; diff --git a/dune/gdt/test/instationary-eocstudy.hh b/dune/gdt/test/instationary-eocstudy.hh index 073f5b1228b0d6f14c55b1d603a52e56fdf5300a..fd69907f188dceefec2367b1062afe43665181d0 100644 --- a/dune/gdt/test/instationary-eocstudy.hh +++ b/dune/gdt/test/instationary-eocstudy.hh @@ -23,7 +23,7 @@ namespace Dune { namespace GDT { -namespace Tests { +namespace Test { /** @@ -58,8 +58,8 @@ public: { out << "+===============================================================+\n" << "|+=============================================================+|\n" - << "|| This is a GDT::Tests::NonStationaryTestCase, please provide ||\n" - << "|| a meaningful message by implementing `print_header()` ||\n" + << "|| This is a GDT::Tests:NonStationaryTestCase, please provide ||\n" + << "|| a meaningful message by implementing `print_header()` ||\n" << "|+=============================================================+|\n" << "+===============================================================+" << std::endl; } diff --git a/dune/gdt/test/linearelliptic/cg-discretization.hh b/dune/gdt/test/linearelliptic/cg-discretization.hh deleted file mode 100644 index ad110dd2a45131c1cd98e088997c2c4e8d7d98af..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic/cg-discretization.hh +++ /dev/null @@ -1,58 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_GDT_TEST_LINEARELLIPTIC_CG_DISCRETIZATION_HH -#define DUNE_GDT_TEST_LINEARELLIPTIC_CG_DISCRETIZATION_HH - -#ifndef THIS_IS_A_BUILDBOT_BUILD -#define THIS_IS_A_BUILDBOT_BUILD 0 -#endif - -#include <dune/xt/common/test/common.hh> -#include <dune/xt/functions/spe10/model1.hh> -#include <dune/xt/la/container.hh> - -#include <dune/gdt/spaces/interface.hh> - -#include "eocstudy.hh" -#include "discretizers/cg.hh" - - -template <class TestCaseType> -struct linearelliptic_CG_discretization : public ::testing::Test -{ - template <Dune::GDT::ChooseSpaceBackend space_backend, Dune::XT::LA::Backends la_backend> - static void eoc_study() - { - using namespace Dune; - using namespace Dune::GDT; -#if THIS_IS_A_BUILDBOT_BUILD - TestCaseType test_case(/*num_refs=*/1); // As in: only 1! -#else - TestCaseType test_case; -#endif - test_case.print_header(DXTC_LOG_INFO); - DXTC_LOG_INFO << std::endl; - typedef LinearElliptic::CGDiscretizer<typename TestCaseType::GridType, - XT::Grid::Layers::level, - space_backend, - la_backend, - 1, - typename TestCaseType::ProblemType::RangeFieldType, - 1> - Discretizer; - Dune::GDT::Test::LinearEllipticEocStudy<TestCaseType, Discretizer> eoc_study(test_case); - try { - Dune::XT::Test::check_eoc_study_for_success(eoc_study, eoc_study.run(DXTC_LOG_INFO)); - } catch (Dune::XT::Common::Exceptions::spe10_data_file_missing&) { - Dune::XT::Common::TimedLogger().get("gdt.test.linearelliptic.cg.discretization").warn() - << "missing SPE10 data file!" << std::endl; - } - } // ... eoc_study() -}; // linearelliptic_CG_discretization - -#endif // DUNE_GDT_TEST_LINEARELLIPTIC_CG_DISCRETIZATION_HH diff --git a/dune/gdt/test/linearelliptic/cg-testcases.hh b/dune/gdt/test/linearelliptic/cg-testcases.hh deleted file mode 100644 index 4df5afb064486e6f2283c80545ed7fcff67589f5..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic/cg-testcases.hh +++ /dev/null @@ -1,153 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) - -#ifndef DUNE_GDT_TEST_LINEARELLIPTIC_CG_TESTCASES_HH -#define DUNE_GDT_TEST_LINEARELLIPTIC_CG_TESTCASES_HH - -#include <dune/grid/yaspgrid.hh> -#include <dune/grid/alugrid.hh> - -#include <dune/xt/common/test/gtest/gtest.h> - -#include "eocexpectations.hh" -#include "problems.hh" - - -typedef testing:: - Types<Dune::GDT::LinearElliptic::AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>>, - Dune::GDT::LinearElliptic::ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>>, - Dune::GDT::LinearElliptic::ESV2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>>, - Dune::GDT::LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>>, - Dune::GDT::LinearElliptic::Spe10Model1TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>>> - YaspGridTestCases; - - -#if HAVE_ALUGRID - - -typedef testing:: - Types<Dune::GDT::LinearElliptic::AO2013TestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>>, - Dune::GDT::LinearElliptic::AO2013TestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>>, - Dune::GDT::LinearElliptic::ER2007TestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>>, - Dune::GDT::LinearElliptic::ER2007TestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>>, - Dune::GDT::LinearElliptic::ESV2007TestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>>, - Dune::GDT::LinearElliptic::ESV2007TestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>>, - Dune::GDT::LinearElliptic::MixedBoundaryTestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>>, - Dune::GDT::LinearElliptic::MixedBoundaryTestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>>, - Dune::GDT::LinearElliptic::Spe10Model1TestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming>>, - Dune::GDT::LinearElliptic::Spe10Model1TestCase<Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>>> - AluGridTestCases; - - -#endif // HAVE_ALUGRID - - -namespace Dune { -namespace GDT { -namespace Test { - - -// YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>> - -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - Spe10Model1TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - - -#if HAVE_ALUGRID - - -// ALUGrid< 2, 2, simplex, conforming > - -extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, - conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, - conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - - -// ALUGrid< 2, 2, simplex, nonconforming > - -extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, - nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, - nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, - nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, - nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - -extern template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, - nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - - -#endif // HAVE_ALUGRID - -} // namespace Test -} // namespace GDT -} // namespace Dune - -#endif // DUNE_GDT_TEST_LINEARELLIPTIC_CG_TESTCASES_HH diff --git a/dune/gdt/test/linearelliptic/eocexpectations.hh b/dune/gdt/test/linearelliptic/eocexpectations.hh index 01aa0650cca211a74f03e8429bde9bb39bae0c6c..a6fb4111377558866d6960a3a2e5cdac50f2b01d 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations.hh +++ b/dune/gdt/test/linearelliptic/eocexpectations.hh @@ -14,35 +14,17 @@ #include "discretizers/base.hh" -namespace Dune { -namespace GDT { -namespace Test { -namespace internal { +#include "eocexpectations_base.hh" +#include <dune/gdt/test/grids.hh> +#include "problems.hh" -template <int polOrder> -class LinearEllipticEocExpectationsBase -{ -public: - static size_t rate(const std::string type) - { - if (type == "L2") - return polOrder + 1; - else if (type == "H1_semi") - return polOrder; - else if (type == "energy") - return polOrder; - else - EXPECT_TRUE(false) << "expected rate missing for type: " << type; - return 0; - } // ... rate(...) -}; // class LinearEllipticEocExpectationsBase - - -} // namespace internal +namespace Dune { +namespace GDT { +namespace Test { -template <class TestCaseType, LinearElliptic::ChooseDiscretizer disc, int polOrder, bool anything = true> +template <class TestCaseType, LinearElliptic::ChooseDiscretizer disc, int polOrder> class LinearEllipticEocExpectations : public internal::LinearEllipticEocExpectationsBase<polOrder> { public: diff --git a/dune/gdt/test/linearelliptic/eocexpectations/CMakeLists.txt b/dune/gdt/test/linearelliptic/eocexpectations/CMakeLists.txt index 3f2fcbd1b7b97b3706e8627955c3a8ec99c54e4e..699f14f2da949d4cb1203c0dad06148f16cb05e8 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/CMakeLists.txt +++ b/dune/gdt/test/linearelliptic/eocexpectations/CMakeLists.txt @@ -7,49 +7,27 @@ # expectation targets # CG -add_library(expectations_linearelliptic_cg_discretizations_yaspgrid - STATIC - EXCLUDE_FROM_ALL +dune_add_library(cg_expectations + NO_EXPORT + SOURCES cg-ao2013-2dyaspgrid.cxx cg-er2007-2dyaspgrid.cxx cg-esv2007-2dyaspgrid.cxx cg-mixedboundary-2dyaspgrid.cxx - cg-spe10-2dyaspgrid.cxx) -add_library(expectations_linearelliptic_cg_discretizations_alugrid - STATIC - EXCLUDE_FROM_ALL + cg-spe10-2dyaspgrid.cxx cg-ao2013-2dalugrid.cxx cg-er2007-2dalugrid.cxx cg-esv2007-2dalugrid.cxx cg-mixedboundary-2dalugrid.cxx - cg-spe10-2dalugrid.cxx) - -# SWIPDG -add_library(expectations_linearelliptic_swipdg_discretizations_yaspgrid - STATIC - EXCLUDE_FROM_ALL + cg-spe10-2dalugrid.cxx swipdg-ao2013-2dyaspgrid.cxx swipdg-er2007-2dyaspgrid.cxx swipdg-esv2007-2dyaspgrid.cxx swipdg-mixedboundary-2dyaspgrid.cxx - swipdg-spe10-2dyaspgrid.cxx) -add_library(expectations_linearelliptic_swipdg_discretizations_alugrid - STATIC - EXCLUDE_FROM_ALL + swipdg-spe10-2dyaspgrid.cxx swipdg-ao2013-2dalugrid.cxx swipdg-er2007-2dalugrid.cxx swipdg-esv2007-2dalugrid.cxx swipdg-mixedboundary-2dalugrid.cxx swipdg-spe10-2dalugrid.cxx) -# add some compile flags -foreach (_target expectations_linearelliptic_cg_discretizations_alugrid - expectations_linearelliptic_swipdg_discretizations_alugrid) - add_dune_alugrid_flags(${_target}) -endforeach (_target) -foreach (_target expectations_linearelliptic_cg_discretizations_alugrid - expectations_linearelliptic_cg_discretizations_yaspgrid - expectations_linearelliptic_swipdg_discretizations_alugrid - expectations_linearelliptic_swipdg_discretizations_yaspgrid) - add_dune_mpi_flags(${_target}) -endforeach (_target) diff --git a/dune/gdt/test/linearelliptic/eocexpectations/all.hh b/dune/gdt/test/linearelliptic/eocexpectations/all.hh new file mode 100644 index 0000000000000000000000000000000000000000..a94683cb4d4235820255dd773d5e565a30d627e2 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/all.hh @@ -0,0 +1,20 @@ +#include "cg-ao2013-2dalugrid.hh" +#include "cg-ao2013-2dyaspgrid.hh" +#include "cg-er2007-2dalugrid.hh" +#include "cg-er2007-2dyaspgrid.hh" +#include "cg-esv2007-2dalugrid.hh" +#include "cg-esv2007-2dyaspgrid.hh" +#include "cg-mixedboundary-2dalugrid.hh" +#include "cg-mixedboundary-2dyaspgrid.hh" +#include "cg-spe10-2dalugrid.hh" +#include "cg-spe10-2dyaspgrid.hh" +#include "swipdg-ao2013-2dalugrid.hh" +#include "swipdg-ao2013-2dyaspgrid.hh" +#include "swipdg-er2007-2dalugrid.hh" +#include "swipdg-er2007-2dyaspgrid.hh" +#include "swipdg-esv2007-2dalugrid.hh" +#include "swipdg-esv2007-2dyaspgrid.hh" +#include "swipdg-mixedboundary-2dalugrid.hh" +#include "swipdg-mixedboundary-2dyaspgrid.hh" +#include "swipdg-spe10-2dalugrid.hh" +#include "swipdg-spe10-2dyaspgrid.hh" diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dalugrid.cxx index 6b26415a9caecaa0c5483d903e18da30de80c634..bde676e3ce1c0837d09aa878b08c360c7ddfbc23 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dalugrid.cxx @@ -1,94 +1,65 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/AO2013.hh" -#include "../eocexpectations.hh" +#include "cg-ao2013-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {7.19e-02, 3.26e-02}; - else - return {7.92e-02, 4.15e-02, 1.19e-02, 2.72e-03}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {3.15e-01, 2.57e-01}; - else - return {3.51e-01, 3.02e-01, 1.63e-01, 7.51e-02}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {2.58e-01, 1.41e-01}; - else - return {2.72e-01, 1.66e-01, 8.90e-02, 4.27e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {7.19e-02, 3.26e-02}; + else + return {7.92e-02, 4.15e-02, 1.19e-02, 2.72e-03}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {3.15e-01, 2.57e-01}; + else + return {3.51e-01, 3.02e-01, 1.63e-01, 7.51e-02}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {2.58e-01, 1.41e-01}; + else + return {2.72e-01, 1.66e-01, 8.90e-02, 4.27e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {2.01e-01, 7.41e-02}; - else - return {2.22e-01, 9.90e-02, 2.96e-02, 6.62e-03}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {6.71e-01, 4.24e-01}; - else - return {7.00e-01, 4.89e-01, 2.69e-01, 1.25e-01}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {4.03e-01, 2.13e-01}; - else - return {4.21e-01, 2.50e-01, 1.34e-01, 6.36e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {2.01e-01, 7.41e-02}; + else + return {2.22e-01, 9.90e-02, 2.96e-02, 6.62e-03}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {6.71e-01, 4.24e-01}; + else + return {7.00e-01, 4.89e-01, 2.69e-01, 1.25e-01}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {4.03e-01, 2.13e-01}; + else + return {4.21e-01, 2.50e-01, 1.34e-01, 6.36e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..72caba13eb39f04cc788eaec8afe0e44f7bdfe93 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dalugrid.hh @@ -0,0 +1,49 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/AO2013.hh" + +#include <dune/gdt/test/linearelliptic/eocexpectations_base.hh> + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dyaspgrid.cxx index 982a8e9f204ecdaa24a75847b24959b962a0e1d2..a959e4282aa4cc1f0e2cfa986487f4a57101d47e 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dyaspgrid.cxx @@ -1,66 +1,35 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/AO2013.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "cg-ao2013-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {1.76e-01, 3.94e-02}; - else - return {1.77e-01, 4.49e-02, 1.24e-02, 2.97e-03}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {6.83e-01, 3.78e-01}; - else - return {6.82e-01, 4.19e-01, 2.05e-01, 1.02e-01}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {4.35e-01, 2.66e-01}; - else - return {4.29e-01, 2.63e-01, 1.84e-01, 1.44e-01}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {1.76e-01, 3.94e-02}; + else + return {1.77e-01, 4.49e-02, 1.24e-02, 2.97e-03}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {6.83e-01, 3.78e-01}; + else + return {6.82e-01, 4.19e-01, 2.05e-01, 1.02e-01}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {4.35e-01, 2.66e-01}; + else + return {4.29e-01, 2.63e-01, 1.84e-01, 1.44e-01}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..194d1ae15e7838fc2ccda0976ecaf7081837db70 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-ao2013-2dyaspgrid.hh @@ -0,0 +1,34 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/AO2013.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dalugrid.cxx index 180070e8d7dee8cee5b321ec9af6576bce48381b..d9c60463f46e48392fc814210091744e50f4ff08 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dalugrid.cxx @@ -1,76 +1,44 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/ER2007.hh" -#include "../eocexpectations.hh" - - +#include "cg-er2007-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.14e-01, 1.48e-01, 3.82e-02}; - else if (type == "H1_semi" || type == "energy") - return {4.35e-01, 3.59e-01, 1.84e-01}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") + return {2.15e-01, 2.13e-01, 5.56e-02}; + else if (type == "H1_semi" || type == "energy") + return {4.35e-01, 4.35e-01, 2.24e-01}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.15e-01, 2.13e-01, 5.56e-02}; - else if (type == "H1_semi" || type == "energy") - return {4.35e-01, 4.35e-01, 2.24e-01}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") + return {2.14e-01, 1.48e-01, 3.82e-02}; + else if (type == "H1_semi" || type == "energy") + return {4.35e-01, 3.59e-01, 1.84e-01}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT } // namespace Dune - #endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..1bf87d9af1663908d2012662366f31c11ee55eb9 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dalugrid.hh @@ -0,0 +1,49 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/ER2007.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dyaspgrid.cxx index e20c02c85fecd81ed40156502baa17107b0cf035..0fc8e198f185c065547b327f6dc7b08ea9b6042e 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dyaspgrid.cxx @@ -1,55 +1,24 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/ER2007.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "cg-er2007-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.16e-01, 2.13e-01, 5.56e-02}; - else if (type == "H1_semi" || type == "energy") - return {4.35e-01, 4.35e-01, 2.24e-01}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") + return {2.16e-01, 2.13e-01, 5.56e-02}; + else if (type == "H1_semi" || type == "energy") + return {4.35e-01, 4.35e-01, 2.24e-01}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..8eecc97057d66fe440eb26a0a926bc090d0d20ee --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-er2007-2dyaspgrid.hh @@ -0,0 +1,34 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/ER2007.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dalugrid.cxx index 34b851100db166d8748ab8441f989f47db5df727..7d3cb66b8afc6fd9e890ac6941cdf62a17d4ecb6 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dalugrid.cxx @@ -1,73 +1,42 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/ESV2007.hh" -#include "../eocexpectations.hh" - - +#include "cg-esv2007-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {3.82e-02, 9.64e-03, 2.42e-03, 6.04e-04}; - else if (type == "H1_semi" || type == "energy") - return {1.84e-01, 9.24e-02, 4.63e-02, 2.31e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") + return {3.82e-02, 9.64e-03, 2.42e-03, 6.04e-04}; + else if (type == "H1_semi" || type == "energy") + return {1.84e-01, 9.24e-02, 4.63e-02, 2.31e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {4.22e-02, 1.08e-02, 2.70e-03, 6.76e-04}; - else if (type == "H1_semi" || type == "energy") - return {1.94e-01, 9.79e-02, 4.91e-02, 2.45e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") + return {4.22e-02, 1.08e-02, 2.70e-03, 6.76e-04}; + else if (type == "H1_semi" || type == "energy") + return {1.94e-01, 9.79e-02, 4.91e-02, 2.45e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..cf1e022f1228ee04a1e9ded9b5e4510db0acc3ba --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dalugrid.hh @@ -0,0 +1,49 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/ESV2007.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dyaspgrid.cxx index 6754d9d00adb368df85223b9c878938fd902206a..6f41ae1fd435878d86a563e558487edb4f7c86e0 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dyaspgrid.cxx @@ -1,56 +1,24 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/ESV2007.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "cg-esv2007-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ESV2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {8.28e-03, 2.04e-03, 5.09e-04, 1.27e-04}; - else if (type == "H1_semi" || type == "energy") - return {1.14e-01, 5.68e-02, 2.83e-02, 1.42e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") + return {8.28e-03, 2.04e-03, 5.09e-04, 1.27e-04}; + else if (type == "H1_semi" || type == "energy") + return {1.14e-01, 5.68e-02, 2.83e-02, 1.42e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..e645970640200dfc84b17668df62f04bdf546f62 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-esv2007-2dyaspgrid.hh @@ -0,0 +1,34 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/ESV2007.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dalugrid.cxx index e9724f4f0497c40c3bcff0de7a5ff1d5f07d722d..2e8b17ccdfa57f030a531b872fb835c7a2a0d37a 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dalugrid.cxx @@ -1,91 +1,56 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/mixedboundary.hh" -#include "../eocexpectations.hh" - - +#include "cg-mixedboundary-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {7.95e-02, 1.81e-02}; - else - return {8.31e-02, 2.22e-02, 5.52e-03, 1.19e-03}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {3.01e-01, 1.42e-01}; - else - return {3.11e-01, 1.64e-01, 8.23e-02, 3.75e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, nonconforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {7.95e-02, 1.81e-02}; + else + return {8.31e-02, 2.22e-02, 5.52e-03, 1.19e-03}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {3.01e-01, 1.42e-01}; + else + return {3.11e-01, 1.64e-01, 8.23e-02, 3.75e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {1.28e-01, 3.14e-02}; - else - return {1.35e-01, 3.99e-02, 1.02e-02, 2.16e-03}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {3.61e-01, 1.80e-01}; - else - return {3.75e-01, 2.08e-01, 1.06e-01, 4.87e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, - nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {1.28e-01, 3.14e-02}; + else + return {1.35e-01, 3.99e-02, 1.02e-02, 2.16e-03}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {3.61e-01, 1.80e-01}; + else + return {3.75e-01, 2.08e-01, 1.06e-01, 4.87e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT } // namespace Dune - #endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..9314a61167fe51c987bb5ca1bceb553450fd235d --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dalugrid.hh @@ -0,0 +1,49 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/mixedboundary.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dyaspgrid.cxx index a989b1ac275c82bff74264075d74d6f8e8eb0d73..6c122e1c32d2991203061c3df062775b981fc704 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dyaspgrid.cxx @@ -1,63 +1,30 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/mixedboundary.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "cg-mixedboundary-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {9.48e-02, 2.13e-02}; - else - return {9.77e-02, 2.49e-02, 6.16e-03, 1.38e-03}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {3.64e-01, 1.67e-01}; - else - return {3.71e-01, 1.87e-01, 9.31e-02, 4.31e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class - LinearEllipticEocExpectations<LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {9.48e-02, 2.13e-02}; + else + return {9.77e-02, 2.49e-02, 6.16e-03, 1.38e-03}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {3.64e-01, 1.67e-01}; + else + return {3.71e-01, 1.87e-01, 9.31e-02, 4.31e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..f4e62f28d47932c4e64f5b3b5368a408a09269c1 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-mixedboundary-2dyaspgrid.hh @@ -0,0 +1,34 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/mixedboundary.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dalugrid.cxx index 0c12ced9bf609c40e6c0ca6f27951cfcd8a2a91c..5684891b933241cd1a5b7f8c8f4a3996b6ee0175 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dalugrid.cxx @@ -1,81 +1,48 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/spe10.hh" -#include "../eocexpectations.hh" - - +#include "cg-spe10-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {3.44e-02, 1.01e-02}; - else if (type == "H1_semi") - return {1.47e-01, 7.78e-02}; - else if (type == "energy") - return {1.88e-01, 1.00e-01}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") + return {3.44e-02, 1.01e-02}; + else if (type == "H1_semi") + return {1.47e-01, 7.78e-02}; + else if (type == "energy") + return {1.88e-01, 1.00e-01}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {5.08e-02, 1.54e-02}; - else if (type == "H1_semi") - return {2.01e-01, 1.04e-01}; - else if (type == "energy") - return {2.30e-01, 1.25e-01}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") + return {5.08e-02, 1.54e-02}; + else if (type == "H1_semi") + return {2.01e-01, 1.04e-01}; + else if (type == "energy") + return {2.30e-01, 1.25e-01}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} // ... results(...) } // namespace Test } // namespace GDT } // namespace Dune - #endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..21997b89a243f433d0d4506fcdf312f415c7b3d5 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dalugrid.hh @@ -0,0 +1,49 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/spe10.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dyaspgrid.cxx index 0691967146d7e3b0f4d972fb6e7e20b1cc65e8ff..3dee125ca0b9b977c5e51a58580d83df83a2a6c2 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dyaspgrid.cxx @@ -1,58 +1,26 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/spe10.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "cg-spe10-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - Spe10Model1TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, - 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {1.86e-02, 1.51e-02}; - else if (type == "H1_semi") - return {3.31e-01, 4.32e-01}; - else if (type == "energy") - return {9.58e-01, 1.37e+00}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class - LinearEllipticEocExpectations<LinearElliptic:: - Spe10Model1TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::cg, 1>; - + if (type == "L2") + return {1.86e-02, 1.51e-02}; + else if (type == "H1_semi") + return {3.31e-01, 4.32e-01}; + else if (type == "energy") + return {9.58e-01, 1.37e+00}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..96883e6d1dbc881f2d1d0989127751578df8d87c --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/cg-spe10-2dyaspgrid.hh @@ -0,0 +1,34 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/spe10.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::cg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dalugrid.cxx index 8d87a0df4d97fd96c662e44f8a8d4fd9e12f3ea7..c4eddb815cae097faadf85f633dc82cb14973836 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dalugrid.cxx @@ -1,172 +1,121 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/AO2013.hh" -#include "../eocexpectations.hh" - +#include "swipdg-ao2013-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { -// polorder 1, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {5.33e-02, 1.69e-02}; - else - return {5.57e-02, 1.99e-02, 5.54e-03, 1.29e-03}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {3.82e-01, 2.29e-01}; - else - return {4.32e-01, 2.93e-01, 1.50e-01, 6.54e-02}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {2.32e-01, 1.15e-01}; - else - return {2.53e-01, 1.46e-01, 7.45e-02, 3.35e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {5.33e-02, 1.69e-02}; + else + return {5.57e-02, 1.99e-02, 5.54e-03, 1.29e-03}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {3.82e-01, 2.29e-01}; + else + return {4.32e-01, 2.93e-01, 1.50e-01, 6.54e-02}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {2.32e-01, 1.15e-01}; + else + return {2.53e-01, 1.46e-01, 7.45e-02, 3.35e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {1.18e-02, 2.12e-03}; - else - return {1.18e-02, 2.11e-03, 3.89e-04, 7.76e-05}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {1.67e-01, 5.58e-02}; - else - return {1.69e-01, 5.96e-02, 1.94e-02, 6.04e-03}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {6.96e-02, 2.59e-02}; - else - return {7.41e-02, 3.36e-02, 1.62e-02, 7.03e-03}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 1, nonconforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {1.18e-02, 2.12e-03}; + else + return {1.18e-02, 2.11e-03, 3.89e-04, 7.76e-05}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {1.67e-01, 5.58e-02}; + else + return {1.69e-01, 5.96e-02, 1.94e-02, 6.04e-03}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {6.96e-02, 2.59e-02}; + else + return {7.41e-02, 3.36e-02, 1.62e-02, 7.03e-03}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {9.88e-02, 3.08e-02}; - else - return {1.05e-01, 3.90e-02, 1.27e-02, 3.13e-03}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {5.95e-01, 3.31e-01}; - else - return {6.52e-01, 4.24e-01, 2.20e-01, 9.59e-02}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {3.39e-01, 1.63e-01}; - else - return {3.67e-01, 2.08e-01, 1.06e-01, 4.75e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, nonconforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {9.88e-02, 3.08e-02}; + else + return {1.05e-01, 3.90e-02, 1.27e-02, 3.13e-03}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {5.95e-01, 3.31e-01}; + else + return {6.52e-01, 4.24e-01, 2.20e-01, 9.59e-02}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {3.39e-01, 1.63e-01}; + else + return {3.67e-01, 2.08e-01, 1.06e-01, 4.75e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {2.77e-02, 5.49e-03}; - else - return {2.77e-02, 5.53e-03, 8.36e-04, 1.29e-04}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {2.74e-01, 1.13e-01}; - else - return {2.75e-01, 1.17e-01, 3.67e-02, 1.10e-02}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {1.11e-01, 4.63e-02}; - else - return {1.15e-01, 5.29e-02, 2.34e-02, 1.05e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; -template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {2.77e-02, 5.49e-03}; + else + return {2.77e-02, 5.53e-03, 8.36e-04, 1.29e-04}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {2.74e-01, 1.13e-01}; + else + return {2.75e-01, 1.17e-01, 3.67e-02, 1.10e-02}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {1.11e-01, 4.63e-02}; + else + return {1.15e-01, 5.29e-02, 2.34e-02, 1.05e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT } // namespace Dune - #endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..025cf00bdb80019e6bdccfcf6472b241ff26e258 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dalugrid.hh @@ -0,0 +1,77 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/AO2013.hh" +#include "../eocexpectations.hh" + +namespace Dune { +namespace GDT { +namespace Test { + +// polorder 1, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); +}; // LinearEllipticEocExpectations + +// polorder 2, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); +}; // LinearEllipticEocExpectations + +// polorder 1, nonconforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); +}; // LinearEllipticEocExpectations + +// polorder 2, nonconforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dyaspgrid.cxx index fcd54343a12e48f6c19cef8326b1f4ff96b68ad8..2f0f71cb8b1f4bcfa6f03d16242789d8df3c9d2c 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dyaspgrid.cxx @@ -1,107 +1,62 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/AO2013.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "swipdg-ao2013-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {1.08e-01, 4.64e-02}; - else - return {1.05e-01, 5.00e-02, 1.16e-02, 3.22e-03}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {6.95e-01, 4.28e-01}; - else - return {6.90e-01, 4.81e-01, 2.28e-01, 1.22e-01}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {5.22e-01, 3.57e-01}; - else - return {5.09e-01, 3.44e-01, 2.64e-01, 2.20e-01}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {1.08e-01, 4.64e-02}; + else + return {1.05e-01, 5.00e-02, 1.16e-02, 3.22e-03}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {6.95e-01, 4.28e-01}; + else + return {6.90e-01, 4.81e-01, 2.28e-01, 1.22e-01}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {5.22e-01, 3.57e-01}; + else + return {5.09e-01, 3.44e-01, 2.64e-01, 2.20e-01}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {8.95e-02, 8.74e-03}; - else - return {8.97e-02, 8.75e-03, 1.89e-03, 6.60e-04}; - } else if (type == "H1_semi") { - if (test_case.num_refinements() == 1) - return {5.28e-01, 1.51e-01}; - else - return {5.24e-01, 1.47e-01, 7.39e-02, 5.43e-02}; - } else if (type == "energy") { - if (test_case.num_refinements() == 1) - return {2.91e-01, 2.20e-01}; - else - return {2.70e-01, 2.05e-01, 1.77e-01, 1.46e-01}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {8.95e-02, 8.74e-03}; + else + return {8.97e-02, 8.75e-03, 1.89e-03, 6.60e-04}; + } else if (type == "H1_semi") { + if (test_case.num_refinements() == 1) + return {5.28e-01, 1.51e-01}; + else + return {5.24e-01, 1.47e-01, 7.39e-02, 5.43e-02}; + } else if (type == "energy") { + if (test_case.num_refinements() == 1) + return {2.91e-01, 2.20e-01}; + else + return {2.70e-01, 2.05e-01, 1.77e-01, 1.46e-01}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..8e692e0e13fa305861c253ed24ca7f78d4d11cd2 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-ao2013-2dyaspgrid.hh @@ -0,0 +1,45 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/AO2013.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dalugrid.cxx index a909dd70ebbf28a87374c7b6ba7bab2414ea0025..98985ee4aa6964ff6e6609dcd8e7d6a5e920a5c5 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dalugrid.cxx @@ -1,129 +1,76 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/ER2007.hh" -#include "../eocexpectations.hh" - - +#include "swipdg-er2007-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { -// polorder 1, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {1.11e-01, 6.09e-02, 1.65e-02}; - else if (type == "H1_semi" || type == "energy") - return {3.66e-01, 2.98e-01, 1.46e-01}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") + return {1.11e-01, 6.09e-02, 1.65e-02}; + else if (type == "H1_semi" || type == "energy") + return {3.66e-01, 2.98e-01, 1.46e-01}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {6.35e-02, 6.42e-03, 8.23e-04}; - else if (type == "H1_semi" || type == "energy") - return {2.32e-01, 5.40e-02, 1.41e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 1, nonconforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") + return {2.00e-01, 1.11e-01, 3.29e-02}; + else if (type == "H1_semi" || type == "energy") + return {4.41e-01, 4.05e-01, 2.04e-01}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.00e-01, 1.11e-01, 3.29e-02}; - else if (type == "H1_semi" || type == "energy") - return {4.41e-01, 4.05e-01, 2.04e-01}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, nonconforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") + return {6.35e-02, 6.42e-03, 8.23e-04}; + else if (type == "H1_semi" || type == "energy") + return {2.32e-01, 5.40e-02, 1.41e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {1.51e-01, 1.27e-02, 1.50e-03}; - else if (type == "H1_semi" || type == "energy") - return {3.69e-01, 8.28e-02, 2.12e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; -template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - + if (type == "L2") + return {1.51e-01, 1.27e-02, 1.50e-03}; + else if (type == "H1_semi" || type == "energy") + return {3.69e-01, 8.28e-02, 2.12e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT } // namespace Dune - #endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..59b4bc58407ddd7b4367583e52d5786f5a41e93e --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dalugrid.hh @@ -0,0 +1,78 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/ER2007.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + +// polorder 1, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 2, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 1, nonconforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 2, nonconforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dyaspgrid.cxx index 3c89e68b751103ea57f8a7851250f8e394296a84..3ad355f622a1455d1921e8022f78a90432b289a8 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dyaspgrid.cxx @@ -1,85 +1,40 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/ER2007.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "swipdg-er2007-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.30e-01, 1.60e-01, 4.88e-02}; - else if (type == "H1_semi" || type == "energy") - return {4.58e-01, 4.41e-01, 2.26e-01}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") + return {2.05e-01, 1.66e-02, 1.91e-03}; + else if (type == "H1_semi" || type == "energy") + return {4.39e-01, 9.32e-02, 2.37e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.05e-01, 1.66e-02, 1.91e-03}; - else if (type == "H1_semi" || type == "energy") - return {4.39e-01, 9.32e-02, 2.37e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - + if (type == "L2") + return {2.30e-01, 1.60e-01, 4.88e-02}; + else if (type == "H1_semi" || type == "energy") + return {4.58e-01, 4.41e-01, 2.26e-01}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..84e9f9325e1c3da9d752997d3b9809b301823a38 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-er2007-2dyaspgrid.hh @@ -0,0 +1,45 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/ER2007.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dalugrid.cxx index 8d0aafe27a2191c4544f2782d167ef94ccbc78bf..61e391fa1474426bacf79f286aca79b6c333560e 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dalugrid.cxx @@ -1,129 +1,81 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/ESV2007.hh" -#include "../eocexpectations.hh" - +#include "swipdg-esv2007-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { -// polorder 1, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {1.82e-02, 4.53e-03, 1.12e-03, 2.78e-04}; - else if (type == "H1_semi" || type == "energy") - return {1.48e-01, 7.28e-02, 3.62e-02, 1.80e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations + if (type == "L2") + return {1.82e-02, 4.53e-03, 1.12e-03, 2.78e-04}; + else if (type == "H1_semi" || type == "energy") + return {1.48e-01, 7.28e-02, 3.62e-02, 1.80e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) -// polorder 2, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> { - typedef LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {8.55e-04, 1.06e-04, 1.31e-05, 1.63e-06}; - else if (type == "H1_semi" || type == "energy") - return {1.41e-02, 3.56e-03, 8.91e-04, 2.23e-04}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 1, nonconforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") + return {8.55e-04, 1.06e-04, 1.31e-05, 1.63e-06}; + else if (type == "H1_semi" || type == "energy") + return {1.41e-02, 3.56e-03, 8.91e-04, 2.23e-04}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.31e-02, 5.96e-03, 1.50e-03, 3.76e-04}; - else if (type == "H1_semi" || type == "energy") - return {1.49e-01, 7.33e-02, 3.63e-02, 1.81e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, nonconforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") + return {8.55e-04, 1.06e-04, 1.31e-05, 1.63e-06}; + else if (type == "H1_semi" || type == "energy") + return {1.41e-02, 3.56e-03, 8.91e-04, 2.23e-04}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {6.78e-04, 8.23e-05, 1.02e-05, 1.26e-06}; - else if (type == "H1_semi" || type == "energy") - return {1.32e-02, 3.30e-03, 8.25e-04, 2.06e-04}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations + if (type == "L2") + return {6.78e-04, 8.23e-05, 1.02e-05, 1.26e-06}; + else if (type == "H1_semi" || type == "energy") + return {1.32e-02, 3.30e-03, 8.25e-04, 2.06e-04}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} -template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; -template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - +// ... results(...) } // namespace Test } // namespace GDT } // namespace Dune - #endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..561e6be5c8666a9edb79f8c004fd052b2c733810 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dalugrid.hh @@ -0,0 +1,78 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/ESV2007.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + +// polorder 1, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + +// polorder 2, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + +// polorder 1, nonconforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); +}; // LinearEllipticEocExpectations + +// polorder 2, nonconforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dyaspgrid.cxx index 9f895bb4029ac2b2c4f009f8a61d9258d06ee103..b4514a7cac8a57f856783af0b3dc5ac3dc170858 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dyaspgrid.cxx @@ -1,88 +1,40 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/ESV2007.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "swipdg-esv2007-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { -// typedef YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>; - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ESV2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {1.13e-02, 2.90e-03, 7.41e-04, 1.88e-04}; - else if (type == "H1_semi" || type == "energy") - return {1.25e-01, 6.25e-02, 3.14e-02, 1.58e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") + return {1.13e-02, 2.90e-03, 7.41e-04, 1.88e-04}; + else if (type == "H1_semi" || type == "energy") + return {1.25e-01, 6.25e-02, 3.14e-02, 1.58e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::ESV2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {9.97e-04, 2.59e-04, 6.72e-05, 1.72e-05}; - else if (type == "H1_semi" || type == "energy") - return {1.93e-02, 1.02e-02, 5.30e-03, 2.71e-03}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune:: - YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - + if (type == "L2") + return {9.97e-04, 2.59e-04, 6.72e-05, 1.72e-05}; + else if (type == "H1_semi" || type == "energy") + return {1.93e-02, 1.02e-02, 5.30e-03, 2.71e-03}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..e4323cbcd3725e4ca05dfd9ce4a0e8c59ea4149d --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-esv2007-2dyaspgrid.hh @@ -0,0 +1,44 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/ESV2007.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dalugrid.cxx index 0b8bd7c746e5771458fb3d25469f3d5a72f9cf48..95e46928da6213495bed2f2d6a1263be48eeb960 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dalugrid.cxx @@ -1,159 +1,100 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) - -#include "config.h" - +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/mixedboundary.hh" -#include "../eocexpectations.hh" - - +#include "swipdg-mixedboundary-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { -// polorder 1, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {3.89e-02, 9.55e-03}; - else - return {4.02e-02, 1.12e-02, 2.83e-03, 6.33e-04}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {2.57e-01, 1.18e-01}; - else - return {2.69e-01, 1.39e-01, 6.87e-02, 3.08e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {3.89e-02, 9.55e-03}; + else + return {4.02e-02, 1.12e-02, 2.83e-03, 6.33e-04}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {2.57e-01, 1.18e-01}; + else + return {2.69e-01, 1.39e-01, 6.87e-02, 3.08e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {3.59e-03, 6.36e-04}; - else - return {3.58e-03, 6.25e-04, 1.21e-04, 2.68e-05}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {4.70e-02, 1.59e-02}; - else - return {4.81e-02, 1.79e-02, 7.19e-03, 2.85e-03}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 1, noncoforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, nonconforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {6.46e-02, 1.75e-02}; + else + return {6.84e-02, 2.17e-02, 5.78e-03, 1.27e-03}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {3.12e-01, 1.47e-01}; + else + return {3.28e-01, 1.76e-01, 8.72e-02, 3.89e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {6.46e-02, 1.75e-02}; - else - return {6.84e-02, 2.17e-02, 5.78e-03, 1.27e-03}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {3.12e-01, 1.47e-01}; - else - return {3.28e-01, 1.76e-01, 8.72e-02, 3.89e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, noncoforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, nonconforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {3.59e-03, 6.36e-04}; + else + return {3.58e-03, 6.25e-04, 1.21e-04, 2.68e-05}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {4.70e-02, 1.59e-02}; + else + return {4.81e-02, 1.79e-02, 7.19e-03, 2.85e-03}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {9.67e-03, 1.50e-03}; - else - return {9.67e-03, 1.52e-03, 2.75e-04, 5.63e-05}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {9.25e-02, 2.97e-02}; - else - return {9.33e-02, 3.19e-02, 1.19e-02, 4.66e-03}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; -template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, - nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, - nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {9.67e-03, 1.50e-03}; + else + return {9.67e-03, 1.52e-03, 2.75e-04, 5.63e-05}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {9.25e-02, 2.97e-02}; + else + return {9.33e-02, 3.19e-02, 1.19e-02, 4.66e-03}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT } // namespace Dune - #endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..aa616c7d6201585f4d1e8c47d96bfbdefd9d786a --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dalugrid.hh @@ -0,0 +1,78 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/mixedboundary.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + +// polorder 1, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 2, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 1, noncoforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 2, noncoforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dyaspgrid.cxx index 5a94536421fa5369e4213b070c94bb3c4ac1a839..852ba640d32b3b16db5a2327d3b552563dcc3272 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dyaspgrid.cxx @@ -1,101 +1,52 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/mixedboundary.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "swipdg-mixedboundary-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {7.38e-02, 1.84e-02}; - else - return {7.56e-02, 2.06e-02, 5.56e-03, 1.36e-03}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {3.66e-01, 1.72e-01}; - else - return {3.76e-01, 1.95e-01, 9.89e-02, 4.67e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {7.38e-02, 1.84e-02}; + else + return {7.56e-02, 2.06e-02, 5.56e-03, 1.36e-03}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {3.66e-01, 1.72e-01}; + else + return {3.76e-01, 1.95e-01, 9.89e-02, 4.67e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType& test_case, + const std::string type) { - typedef LinearElliptic::MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& test_case, const std::string type) - { - if (type == "L2") { - if (test_case.num_refinements() == 1) - return {8.85e-03, 2.07e-03}; - else - return {8.82e-03, 2.02e-03, 5.24e-04, 1.42e-04}; - } else if (type == "H1_semi" || type == "energy") { - if (test_case.num_refinements() == 1) - return {6.85e-02, 3.56e-02}; - else - return {6.61e-02, 3.27e-02, 1.81e-02, 1.03e-02}; - } else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class - LinearEllipticEocExpectations<LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class - LinearEllipticEocExpectations<LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - + if (type == "L2") { + if (test_case.num_refinements() == 1) + return {8.85e-03, 2.07e-03}; + else + return {8.82e-03, 2.02e-03, 5.24e-04, 1.42e-04}; + } else if (type == "H1_semi" || type == "energy") { + if (test_case.num_refinements() == 1) + return {6.85e-02, 3.56e-02}; + else + return {6.61e-02, 3.27e-02, 1.81e-02, 1.03e-02}; + } else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..1518ff4a7703c3cd7bd6dabdf52a31dfbd0a38ce --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-mixedboundary-2dyaspgrid.hh @@ -0,0 +1,45 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/mixedboundary.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& test_case, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dalugrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dalugrid.cxx index 78a644ad191a9a1e9f0cfedee793a9d2029245dd..6b9d959c4b111669d269061c66a3dde230994ca5 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dalugrid.cxx @@ -1,139 +1,85 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2016) - -#include "config.h" +#include <config.h> #if HAVE_ALUGRID -#include <dune/grid/alugrid.hh> - -#include "../problems/spe10.hh" -#include "../eocexpectations.hh" - - +#include "swipdg-spe10-2dalugrid.hh" namespace Dune { namespace GDT { namespace Test { -// polorder 1, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {9.48e-03, 2.64e-03}; - else if (type == "H1_semi") - return {1.09e-01, 5.36e-02}; - else if (type == "energy") - return {1.37e-01, 6.60e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, conforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") + return {9.48e-03, 2.64e-03}; + else if (type == "H1_semi") + return {1.09e-01, 5.36e-02}; + else if (type == "energy") + return {1.37e-01, 6.60e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.74e-03, 8.75e-04}; - else if (type == "H1_semi") - return {4.91e-02, 2.26e-02}; - else if (type == "energy") - return {5.60e-02, 2.58e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 1, nonconforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> + if (type == "L2") + return {9.43e-03, 2.55e-03}; + else if (type == "H1_semi") + return {1.43e-01, 7.04e-02}; + else if (type == "energy") + return {1.74e-01, 8.53e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {9.43e-03, 2.55e-03}; - else if (type == "H1_semi") - return {1.43e-01, 7.04e-02}; - else if (type == "energy") - return {1.74e-01, 8.53e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -// polorder 2, nonconforming - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, - 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") + return {2.74e-03, 8.75e-04}; + else if (type == "H1_semi") + return {4.91e-02, 2.26e-02}; + else if (type == "energy") + return {5.60e-02, 2.58e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, double, 1> TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.13e-03, 6.56e-04}; - else if (type == "H1_semi") - return {6.41e-02, 3.24e-02}; - else if (type == "energy") - return {7.56e-02, 3.81e-02}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; -template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, nonconforming>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - + if (type == "L2") + return {2.13e-03, 6.56e-04}; + else if (type == "H1_semi") + return {6.41e-02, 3.24e-02}; + else if (type == "energy") + return {7.56e-02, 3.81e-02}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT } // namespace Dune - #endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dalugrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dalugrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..c5e926dbb876ae4d7dce11140ef77d2a09cf5621 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dalugrid.hh @@ -0,0 +1,78 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2016) + + +#if HAVE_ALUGRID + +#include <dune/grid/alugrid.hh> + +#include "../problems/spe10.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + +// polorder 1, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 2, conforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 1, nonconforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +// polorder 2, nonconforming + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // HAVE_ALUGRID diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dyaspgrid.cxx b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dyaspgrid.cxx index b2e23dc25f4d95bc269249d1ad59aeac3be7e596..7099687511505f217ea26d75d7f04205bc7ee614 100644 --- a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dyaspgrid.cxx +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dyaspgrid.cxx @@ -1,91 +1,44 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#include "config.h" - -#include <dune/grid/yaspgrid.hh> - -#include "../problems/spe10.hh" -#include "../eocexpectations.hh" - - +#include <config.h> +#include "swipdg-spe10-2dyaspgrid.hh" namespace Dune { namespace GDT { namespace Test { - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - Spe10Model1TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1, anything> - : public internal::LinearEllipticEocExpectationsBase<1> +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, - 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {2.73e-02, 2.35e-02}; - else if (type == "H1_semi") - return {4.64e-01, 6.31e-01}; - else if (type == "energy") - return {1.03e+00, 1.49e+00}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - -template <bool anything> -class LinearEllipticEocExpectations<LinearElliptic:: - Spe10Model1TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, - 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2, anything> - : public internal::LinearEllipticEocExpectationsBase<2> + if (type == "L2") + return {2.73e-02, 2.35e-02}; + else if (type == "H1_semi") + return {4.64e-01, 6.31e-01}; + else if (type == "energy") + return {1.03e+00, 1.49e+00}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} + +std::vector<double> +LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>:: + results(const LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>::TestCaseType&, + const std::string type) { - typedef LinearElliptic::Spe10Model1TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, double, - 1> - TestCaseType; - -public: - static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) - { - if (type == "L2") - return {1.82e-02, 7.50e-03}; - else if (type == "H1_semi") - return {5.53e-01, 4.55e-01}; - else if (type == "energy") - return {1.62e+00, 1.33e+00}; - else - EXPECT_TRUE(false) << "test results missing for type: " << type; - return {}; - } // ... results(...) -}; // LinearEllipticEocExpectations - - -template class - LinearEllipticEocExpectations<LinearElliptic:: - Spe10Model1TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; -template class - LinearEllipticEocExpectations<LinearElliptic:: - Spe10Model1TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; - + if (type == "L2") + return {1.82e-02, 7.50e-03}; + else if (type == "H1_semi") + return {5.53e-01, 4.55e-01}; + else if (type == "energy") + return {1.62e+00, 1.33e+00}; + else + EXPECT_TRUE(false) << "test results missing for type: " << type; + return {}; +} } // namespace Test } // namespace GDT diff --git a/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dyaspgrid.hh b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dyaspgrid.hh new file mode 100644 index 0000000000000000000000000000000000000000..a0319d09de71d2eff8e521cb2128ed340179cad4 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations/swipdg-spe10-2dyaspgrid.hh @@ -0,0 +1,45 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + + +#include <dune/grid/yaspgrid.hh> + +#include "../problems/spe10.hh" +#include "../eocexpectations.hh" + + +namespace Dune { +namespace GDT { +namespace Test { + + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1> + : public internal::LinearEllipticEocExpectationsBase<1> +{ + typedef LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + +template <> +class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2> + : public internal::LinearEllipticEocExpectationsBase<2> +{ + typedef LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1> TestCaseType; + +public: + static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type); // ... results(...) +}; // LinearEllipticEocExpectations + + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic/eocexpectations_base.hh b/dune/gdt/test/linearelliptic/eocexpectations_base.hh new file mode 100644 index 0000000000000000000000000000000000000000..08c022c667d123356fef9626005432bc037cb0b8 --- /dev/null +++ b/dune/gdt/test/linearelliptic/eocexpectations_base.hh @@ -0,0 +1,45 @@ +#ifndef DUNE_GDT_TEST_LINEARELLIPTIC_EOCEXPECTATIONS_BASE_HH +#define DUNE_GDT_TEST_LINEARELLIPTIC_EOCEXPECTATIONS_BASE_HH + +#include "discretizers/base.hh" +#include <dune/xt/common/test/gtest/gtest.h> +#include <dune/gdt/test/grids.hh> + +namespace Dune { +namespace GDT { +namespace Test { + +static const auto CG = LinearElliptic::ChooseDiscretizer::cg; + +namespace internal { + + +template <int polOrder> +class LinearEllipticEocExpectationsBase +{ +public: + static size_t rate(const std::string type) + { + if (type == "L2") + return polOrder + 1; + else if (type == "H1_semi") + return polOrder; + else if (type == "energy") + return polOrder; + else + EXPECT_TRUE(false) << "expected rate missing for type: " << type; + return 0; + } // ... rate(...) +}; // class LinearEllipticEocExpectationsBase + + +} // namespace internal + +template <class TestCaseType, LinearElliptic::ChooseDiscretizer disc, int polOrder> +class LinearEllipticEocExpectations; + +} // namespace Test +} // namespace GDT +} // namespace Dune + +#endif // DUNE_GDT_TEST_LINEARELLIPTIC_EOCEXPECTATIONS_BASE_HH diff --git a/dune/gdt/test/linearelliptic/eocstudy.hh b/dune/gdt/test/linearelliptic/eocstudy.hh index ad0df6ac5f5fda21dc5db2631e50c129f7d7aadc..349df71601af029aaf05a28d2bf72fa8aaa2c880 100644 --- a/dune/gdt/test/linearelliptic/eocstudy.hh +++ b/dune/gdt/test/linearelliptic/eocstudy.hh @@ -17,11 +17,13 @@ #include "../stationary-eocstudy.hh" #include "eocexpectations.hh" +#include "eocexpectations/all.hh" + + namespace Dune { namespace GDT { namespace Test { - template <class TestCaseImp, class DiscretizerImp> class LinearEllipticEocStudy : public StationaryEocStudy<TestCaseImp, DiscretizerImp> { diff --git a/dune/gdt/test/linearelliptic/problems/AO2013.hh b/dune/gdt/test/linearelliptic/problems/AO2013.hh index 323a73a4269c6acad48b04155da8c1baa328b004..db5f985db69de3650f017f5dcd3cbd6dd6343620 100644 --- a/dune/gdt/test/linearelliptic/problems/AO2013.hh +++ b/dune/gdt/test/linearelliptic/problems/AO2013.hh @@ -19,6 +19,7 @@ #include <dune/xt/grid/gridprovider/cube.hh> #include <dune/gdt/test/stationary-testcase.hh> +#include <dune/gdt/test/grids.hh> #include "base.hh" @@ -100,7 +101,7 @@ private: }; template <bool anything> - struct Helper<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, anything> + struct Helper<Yasp2Grid, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -111,7 +112,7 @@ private: #if HAVE_ALUGRID template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, conforming>, anything> + struct Helper<AluConform2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -122,7 +123,7 @@ private: }; template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, nonconforming>, anything> + struct Helper<AluSimplex2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { diff --git a/dune/gdt/test/linearelliptic/problems/ER2007.hh b/dune/gdt/test/linearelliptic/problems/ER2007.hh index 4ed00f69df6479a3cf40d1bd442e966967392100..38912d0e3ee6bc6a6d7db5fe81605c6d1788ab29 100644 --- a/dune/gdt/test/linearelliptic/problems/ER2007.hh +++ b/dune/gdt/test/linearelliptic/problems/ER2007.hh @@ -19,6 +19,7 @@ #include <dune/xt/grid/gridprovider/cube.hh> #include <dune/gdt/test/stationary-testcase.hh> +#include <dune/gdt/test/grids.hh> #include "base.hh" @@ -101,7 +102,7 @@ private: }; template <bool anything> - struct Helper<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, anything> + struct Helper<Yasp2Grid, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -112,7 +113,7 @@ private: #if HAVE_ALUGRID template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, conforming>, anything> + struct Helper<AluConform2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -123,7 +124,7 @@ private: }; template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, nonconforming>, anything> + struct Helper<AluSimplex2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { diff --git a/dune/gdt/test/linearelliptic/problems/ESV2007.hh b/dune/gdt/test/linearelliptic/problems/ESV2007.hh index faf4651e27821ab4f5147b5db89a6087e12acbe7..e00f4cde9dc5c2e607ec46b562fd25519e5b4ad9 100644 --- a/dune/gdt/test/linearelliptic/problems/ESV2007.hh +++ b/dune/gdt/test/linearelliptic/problems/ESV2007.hh @@ -19,6 +19,7 @@ #include <dune/xt/grid/gridprovider/cube.hh> #include <dune/gdt/test/stationary-testcase.hh> +#include <dune/gdt/test/grids.hh> #include "base.hh" @@ -100,7 +101,7 @@ private: }; template <bool anything> - struct Helper<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, anything> + struct Helper<Yasp2Grid, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -111,7 +112,7 @@ private: #if HAVE_ALUGRID template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, conforming>, anything> + struct Helper<AluConform2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -122,7 +123,7 @@ private: }; template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, nonconforming>, anything> + struct Helper<AluSimplex2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { diff --git a/dune/gdt/test/linearelliptic/problems/mixedboundary.hh b/dune/gdt/test/linearelliptic/problems/mixedboundary.hh index e559b8095c18af302c6488723f422710a7dd25d1..5f5ce37a802f7f065abcef70d79497c30570ce94 100644 --- a/dune/gdt/test/linearelliptic/problems/mixedboundary.hh +++ b/dune/gdt/test/linearelliptic/problems/mixedboundary.hh @@ -19,6 +19,7 @@ #include <dune/xt/grid/gridprovider/cube.hh> #include <dune/gdt/test/stationary-testcase.hh> +#include <dune/gdt/test/grids.hh> #include "base.hh" @@ -101,7 +102,7 @@ private: }; template <bool anything> - struct Helper<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, anything> + struct Helper<Yasp2Grid, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -112,7 +113,7 @@ private: #if HAVE_ALUGRID template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, conforming>, anything> + struct Helper<AluConform2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -123,7 +124,7 @@ private: }; template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, nonconforming>, anything> + struct Helper<AluSimplex2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { diff --git a/dune/gdt/test/linearelliptic/problems/spe10.hh b/dune/gdt/test/linearelliptic/problems/spe10.hh index a6c1338a202644fe611c6eec0d5d071d90b810f8..220596e3c59924d74627372b2f4bdd676dfa2c37 100644 --- a/dune/gdt/test/linearelliptic/problems/spe10.hh +++ b/dune/gdt/test/linearelliptic/problems/spe10.hh @@ -21,6 +21,7 @@ #include <dune/xt/grid/gridprovider/cube.hh> #include <dune/gdt/test/stationary-testcase.hh> +#include <dune/gdt/test/grids.hh> #include "base.hh" @@ -106,7 +107,7 @@ private: }; template <bool anything> - struct Helper<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, anything> + struct Helper<Yasp2Grid, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -117,7 +118,7 @@ private: #if HAVE_ALUGRID template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, conforming>, anything> + struct Helper<AluConform2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { @@ -128,7 +129,7 @@ private: }; template <bool anything> - struct Helper<ALUGrid<2, 2, simplex, nonconforming>, anything> + struct Helper<AluSimplex2dGridType, anything> { static XT::Common::Configuration value(XT::Common::Configuration cfg) { diff --git a/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/CMakeLists.txt b/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/CMakeLists.txt index 5ed4a49e9e23ad32d6d4213c610a94613df76ad8..67b1593b2916f531b174da8f6371f8e5ae7808bd 100644 --- a/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/CMakeLists.txt +++ b/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/CMakeLists.txt @@ -6,16 +6,10 @@ # Felix Schindler (2016) # expectation targets -add_library(expectations_linearelliptic_swipdg_estimators_alugrid - STATIC - EXCLUDE_FROM_ALL - ao2013-2dalugrid.cxx - esv2007-2dalugrid.cxx - spe10-2dalugrid.cxx) - -# add some compile flags -foreach (_target expectations_linearelliptic_swipdg_estimators_alugrid) - add_dune_alugrid_flags(${_target}) - add_dune_mpi_flags(${_target}) -endforeach (_target) +dune_add_library(swipdg_expectations + NO_EXPORT + SOURCES ao2013-2dalugrid.cxx + esv2007-2dalugrid.cxx + spe10-2dalugrid.cxx + ) diff --git a/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/ao2013-2dalugrid.cxx b/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/ao2013-2dalugrid.cxx index b5a5b02a475cf9360c7e58fa1d1bbd70a7f056f3..d6b197abb636c40dfc4dd0871c63a908a101f29f 100644 --- a/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/ao2013-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/ao2013-2dalugrid.cxx @@ -24,8 +24,7 @@ namespace internal { std::vector<double> results_LinearEllipticSwipdgEstimatorExpectationsAO2013TestCaseALUGrid22simplexconformingdouble1swipdg1( - const LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>& /*test_case*/, - const std::string type) + const LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>& /*test_case*/, const std::string type) { if (type == "energy") return {9.10e-02, 5.23e-02, 2.68e-02, 1.20e-02}; @@ -58,13 +57,12 @@ results_LinearEllipticSwipdgEstimatorExpectationsAO2013TestCaseALUGrid22simplexc #if HAVE_EIGEN template <bool anything> -class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 1, XT::LA::Backends::eigen_sparse, anything> : public internal::LinearEllipticSwipdgEstimatorExpectationsBase<1> { - typedef LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; + typedef LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1> TestCaseType; public: static std::vector<double> results(const TestCaseType& test_case, const std::string type) @@ -96,13 +94,12 @@ template class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::AO2013T template <bool anything> -class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 1, XT::LA::Backends::istl_sparse, anything> : public internal::LinearEllipticSwipdgEstimatorExpectationsBase<1> { - typedef LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; + typedef LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1> TestCaseType; public: static std::vector<double> results(const TestCaseType& test_case, const std::string type) diff --git a/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/esv2007-2dalugrid.cxx b/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/esv2007-2dalugrid.cxx index 5d9eff34e094ae19b494e0c89408c5386939dd88..0dfad85cd7149db422f9d2abfab2bf060d99ecd0 100644 --- a/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/esv2007-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/esv2007-2dalugrid.cxx @@ -22,12 +22,11 @@ namespace Test { // polorder 1, conforming template <XT::LA::Backends la_backend, bool anything> -class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 1, la_backend, anything> : public internal::LinearEllipticSwipdgEstimatorExpectationsBase<1> { - typedef LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; + typedef LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1> TestCaseType; public: static std::vector<double> results(const TestCaseType& /*test_case*/, const std::string type) diff --git a/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/spe10-2dalugrid.cxx b/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/spe10-2dalugrid.cxx index c53d314e7b6827c0a165be68b003577d9a416eb5..6006be6582d15da0869f94c6afcf30a365c0ee18 100644 --- a/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/spe10-2dalugrid.cxx +++ b/dune/gdt/test/linearelliptic/swipdg-estimator-expectations/spe10-2dalugrid.cxx @@ -25,8 +25,7 @@ namespace internal { std::vector<double> results_LinearEllipticSwipdgEstimatorExpectationsSpe10Model1TestCaseALUGrid22simplexconformingdouble1swipdg1( - const LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1>& /*test_case*/, - const std::string type) + const LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>& /*test_case*/, const std::string type) { if (type == "energy") return {8.38e-01, 4.02e-01}; @@ -59,13 +58,12 @@ results_LinearEllipticSwipdgEstimatorExpectationsSpe10Model1TestCaseALUGrid22sim #if HAVE_EIGEN template <bool anything> -class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 1, XT::LA::Backends::eigen_sparse, anything> : public internal::LinearEllipticSwipdgEstimatorExpectationsBase<1> { - typedef LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; + typedef LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1> TestCaseType; public: static std::vector<double> results(const TestCaseType& test_case, const std::string type) @@ -97,13 +95,12 @@ template class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::Spe10Mo template <bool anything> -class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +class LinearEllipticSwipdgEstimatorExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 1, XT::LA::Backends::istl_sparse, anything> : public internal::LinearEllipticSwipdgEstimatorExpectationsBase<1> { - typedef LinearElliptic::Spe10Model1TestCase<ALUGrid<2, 2, simplex, conforming>, double, 1> TestCaseType; + typedef LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, 1> TestCaseType; public: static std::vector<double> results(const TestCaseType& test_case, const std::string type) diff --git a/dune/gdt/test/linearelliptic/swipdg-testcases.hh b/dune/gdt/test/linearelliptic/swipdg-testcases.hh index 106404bd469d8101458a22b68758d195055dd41d..537679e9e5345fb9abfda0bd787f4b1d9d6b4bb4 100644 --- a/dune/gdt/test/linearelliptic/swipdg-testcases.hh +++ b/dune/gdt/test/linearelliptic/swipdg-testcases.hh @@ -17,19 +17,16 @@ #include "problems.hh" -typedef testing:: - Types<Dune::GDT::LinearElliptic::AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>>, - Dune::GDT::LinearElliptic::ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>>, - Dune::GDT::LinearElliptic::ESV2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>>, - Dune::GDT::LinearElliptic:: - MixedBoundaryTestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>> +typedef testing::Types<Dune::GDT::LinearElliptic::AO2013TestCase<Yasp2Grid>, + Dune::GDT::LinearElliptic::ER2007TestCase<Yasp2Grid>, + Dune::GDT::LinearElliptic::ESV2007TestCase<Yasp2Grid>, + Dune::GDT::LinearElliptic::MixedBoundaryTestCase<Yasp2Grid> #if !THIS_IS_A_BUILDBOT_BUILD - , - Dune::GDT::LinearElliptic::Spe10Model1TestCase<Dune::YaspGrid<2, - Dune::EquidistantOffsetCoordinates<double, 2>>> + , + Dune::GDT::LinearElliptic::Spe10Model1TestCase<Yasp2Grid> #endif - > - YaspGridTestCases; + > + YaspGridTestCases; #if HAVE_ALUGRID @@ -59,23 +56,14 @@ namespace Test { // YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, polorder 1 -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; +extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>; -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; +extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>; -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 1>; +extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 1>; extern template class LinearEllipticEocExpectations<LinearElliptic:: @@ -93,23 +81,14 @@ extern template class // YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, polorder 2 -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - AO2013TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; +extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>; -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - ER2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; +extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>; -extern template class - LinearEllipticEocExpectations<LinearElliptic:: - ESV2007TestCase<Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>, - double, 1>, - LinearElliptic::ChooseDiscretizer::swipdg, 2>; +extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, + LinearElliptic::ChooseDiscretizer::swipdg, 2>; extern template class LinearEllipticEocExpectations<LinearElliptic:: @@ -131,16 +110,13 @@ extern template class // ALUGrid< 2, 2, simplex, conforming >, polorder 1 -extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 1>; -extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 1>; -extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 1>; extern template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, @@ -184,16 +160,13 @@ extern template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1T // ALUGrid< 2, 2, simplex, conforming >, polorder 2 -extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 2>; -extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 2>; -extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<ALUGrid<2, 2, simplex, conforming>, - double, 1>, +extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, LinearElliptic::ChooseDiscretizer::swipdg, 2>; extern template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<ALUGrid<2, 2, simplex, diff --git a/dune/gdt/test/linearelliptic__cg_discretization.cc b/dune/gdt/test/linearelliptic__cg_discretization.cc new file mode 100644 index 0000000000000000000000000000000000000000..f39abc421e414c42087f7a446f49adffee3319e3 --- /dev/null +++ b/dune/gdt/test/linearelliptic__cg_discretization.cc @@ -0,0 +1,128 @@ +// This file is part of the dune-gdt project: +// https://github.com/dune-community/dune-gdt +// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. +// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) +// Authors: +// Felix Schindler (2015 - 2016) + +#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING +#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 +#endif + +#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! + +#include <dune/xt/common/test/common.hh> +#include <dune/xt/functions/spe10/model1.hh> +#include <dune/xt/la/container.hh> + +#include <dune/gdt/spaces/interface.hh> + +#include "linearelliptic/eocstudy.hh" +#include "linearelliptic/discretizers/cg.hh" + +#include <dune/gdt/test/linearelliptic/problems.hh> +#include <dune/gdt/test/grids.hh> + +struct linearelliptic_CG_discretization : public ::testing::Test +{ + typedef TESTCASETYPE TestCaseType; + + static void eoc_study() + { + using namespace Dune; + using namespace Dune::GDT; +#if THIS_IS_A_BUILDBOT_BUILD + TestCaseType test_case(/*num_refs=*/1); // As in: only 1! +#else + TestCaseType test_case; +#endif + test_case.print_header(DXTC_LOG_INFO); + DXTC_LOG_INFO << std::endl; + typedef LinearElliptic::CGDiscretizer<typename TestCaseType::GridType, + XT::Grid::Layers::level, + ChooseSpaceBackend::SPACE_BACKEND, + XT::LA::Backends::LA_BACKEND, + 1, + typename TestCaseType::ProblemType::RangeFieldType, + 1> + Discretizer; + Dune::GDT::Test::LinearEllipticEocStudy<TestCaseType, Discretizer> eoc_study(test_case); + try { + Dune::XT::Test::check_eoc_study_for_success(eoc_study, eoc_study.run(DXTC_LOG_INFO)); + } catch (Dune::XT::Common::Exceptions::spe10_data_file_missing&) { + Dune::XT::Common::TimedLogger().get("gdt.test.linearelliptic.cg.discretization").warn() + << "missing SPE10 data file!" << std::endl; + } + } // ... eoc_study() +}; // linearelliptic_CG_discretization + +TEST_F(linearelliptic_CG_discretization, eoc_study) +{ + this->eoc_study(); +} + + +namespace Dune { +namespace GDT { +namespace Test { + +// YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>> +extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<Yasp2Grid, double, 1>, CG, 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<Yasp2Grid, double, 1>, CG, 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<Yasp2Grid, double, 1>, CG, 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<Yasp2Grid, double, 1>, CG, 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<Yasp2Grid, double, 1>, CG, 1>; + + +#if HAVE_ALUGRID + + +// ALUGrid< 2, 2, simplex, conforming > + +extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluConform2dGridType, double, 1>, CG, + 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluConform2dGridType, double, 1>, CG, + 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluConform2dGridType, double, 1>, + CG, 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluConform2dGridType, double, + 1>, + CG, 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluConform2dGridType, double, + 1>, + CG, 1>; + + +// ALUGrid< 2, 2, simplex, nonconforming > + +extern template class LinearEllipticEocExpectations<LinearElliptic::AO2013TestCase<AluSimplex2dGridType, double, 1>, CG, + 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::ER2007TestCase<AluSimplex2dGridType, double, 1>, CG, + 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::ESV2007TestCase<AluSimplex2dGridType, double, 1>, + CG, 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::MixedBoundaryTestCase<AluSimplex2dGridType, double, + 1>, + CG, 1>; + +extern template class LinearEllipticEocExpectations<LinearElliptic::Spe10Model1TestCase<AluSimplex2dGridType, double, + 1>, + CG, 1>; + + +#endif // HAVE_ALUGRID + +} // namespace Test +} // namespace GDT +} // namespace Dune diff --git a/dune/gdt/test/linearelliptic__cg_discretization.mini b/dune/gdt/test/linearelliptic__cg_discretization.mini new file mode 100644 index 0000000000000000000000000000000000000000..964db8ca10bc8337a49ebd2311a78767d01f1f3d --- /dev/null +++ b/dune/gdt/test/linearelliptic__cg_discretization.mini @@ -0,0 +1,15 @@ +__name = {testcases}_{grids_name}_{space_backends}_{la_backends} +__exec_suffix = {testcases}_{grids_name}_{space_backends}_{la_backends} + +grids = Dune::YaspGrid<2\, Dune::EquidistantOffsetCoordinates<double\, 2>>, Dune::ALUGrid<2\, 2\, Dune::simplex\, Dune::conforming>, Dune::ALUGrid<2\, 2\, Dune::simplex\, Dune::nonconforming> | expand grids +1, ALUGRID_FOUND, ALUGRID_FOUND | expand grids | cmake_guard +grids_name = Yasp2, Alu2_Simp_conf, Alu2_Simp_nonc | expand grids + +testcases = AO2013TestCase, ER2007TestCase, ESV2007TestCase, MixedBoundaryTestCase, Spe10Model1TestCase | expand cases +space_backends = fem, pdelab | expand +la_backends = eigen_sparse, istl_sparse | expand + +[__static] +TESTCASETYPE = Dune::GDT::LinearElliptic::{testcases}<{grids}> +SPACE_BACKEND = {space_backends} +LA_BACKEND = {la_backends} diff --git a/dune/gdt/test/linearelliptic__cg_discretization__alugrid_fem_eigen.cc b/dune/gdt/test/linearelliptic__cg_discretization__alugrid_fem_eigen.cc deleted file mode 100644 index 3563ba037526aa7728cf9779781520d559b08824..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic__cg_discretization__alugrid_fem_eigen.cc +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING -#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 -#endif - -#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! - -#include "linearelliptic/cg-discretization.hh" -#include "linearelliptic/cg-testcases.hh" - -using namespace Dune; -using namespace Dune::GDT; - - -#if HAVE_DUNE_FEM && HAVE_EIGEN && HAVE_ALUGRID - -TYPED_TEST_CASE(linearelliptic_CG_discretization, AluGridTestCases); -TYPED_TEST(linearelliptic_CG_discretization, eoc_study_using_fem_and_eigen_and_alugrid) -{ - this->template eoc_study<ChooseSpaceBackend::fem, XT::LA::Backends::eigen_sparse>(); -} - -#else - -TEST(DISABLED_linearelliptic_CG_discretization, eoc_study_using_fem_and_eigen_and_alugrid) -{ -} - -#endif diff --git a/dune/gdt/test/linearelliptic__cg_discretization__alugrid_fem_istl.cc b/dune/gdt/test/linearelliptic__cg_discretization__alugrid_fem_istl.cc deleted file mode 100644 index 4d996e9ec5a488dcb420323c9fa3cc96a2e76ee9..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic__cg_discretization__alugrid_fem_istl.cc +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING -#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 -#endif - -#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! - -#include "linearelliptic/cg-discretization.hh" -#include "linearelliptic/cg-testcases.hh" - -using namespace Dune; -using namespace Dune::GDT; - - -#if HAVE_DUNE_FEM && HAVE_DUNE_ISTL && HAVE_ALUGRID - -TYPED_TEST_CASE(linearelliptic_CG_discretization, AluGridTestCases); -TYPED_TEST(linearelliptic_CG_discretization, eoc_study_using_fem_and_istl_and_alugrid) -{ - this->template eoc_study<ChooseSpaceBackend::fem, XT::LA::Backends::istl_sparse>(); -} - -#else - -TEST(DISABLED_linearelliptic_CG_discretization, eoc_study_using_fem_and_istl_and_alugrid) -{ -} - -#endif diff --git a/dune/gdt/test/linearelliptic__cg_discretization__alugrid_pdelab_eigen.cc b/dune/gdt/test/linearelliptic__cg_discretization__alugrid_pdelab_eigen.cc deleted file mode 100644 index cd9c7f6926a28127f03f1abaf6e62075cd40eed6..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic__cg_discretization__alugrid_pdelab_eigen.cc +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING -#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 -#endif - -#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! - -#include "linearelliptic/cg-discretization.hh" -#include "linearelliptic/cg-testcases.hh" - -using namespace Dune; -using namespace Dune::GDT; - - -#if HAVE_DUNE_PDELAB && HAVE_EIGEN && HAVE_ALUGRID - -TYPED_TEST_CASE(linearelliptic_CG_discretization, AluGridTestCases); -TYPED_TEST(linearelliptic_CG_discretization, eoc_study_using_pdelab_and_eigen_and_alugrid) -{ - this->template eoc_study<ChooseSpaceBackend::pdelab, XT::LA::Backends::eigen_sparse>(); -} - -#else - -TEST(DISABLED_linearelliptic_CG_discretization, eoc_study_using_pdelab_and_eigen_and_alugrid) -{ -} - -#endif diff --git a/dune/gdt/test/linearelliptic__cg_discretization__alugrid_pdelab_istl.cc b/dune/gdt/test/linearelliptic__cg_discretization__alugrid_pdelab_istl.cc deleted file mode 100644 index 5406a8e6d46892bb27c8697bfe3c520f957bdbcd..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic__cg_discretization__alugrid_pdelab_istl.cc +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING -#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 -#endif - -#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! - -#include "linearelliptic/cg-discretization.hh" -#include "linearelliptic/cg-testcases.hh" - -using namespace Dune; -using namespace Dune::GDT; - - -#if HAVE_DUNE_PDELAB && HAVE_DUNE_ISTL && HAVE_ALUGRID - -TYPED_TEST_CASE(linearelliptic_CG_discretization, AluGridTestCases); -TYPED_TEST(linearelliptic_CG_discretization, eoc_study_using_pdelab_and_istl_and_alugrid) -{ - this->template eoc_study<ChooseSpaceBackend::pdelab, XT::LA::Backends::istl_sparse>(); -} - -#else - -TEST(DISABLED_linearelliptic_CG_discretization, eoc_study_using_pdelab_and_istl_and_alugrid) -{ -} - -#endif diff --git a/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_fem_eigen.cc b/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_fem_eigen.cc deleted file mode 100644 index 606bbdd9a30aa82148f4e4cd5726e16281d411e3..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_fem_eigen.cc +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING -#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 -#endif - -#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! - -#include "linearelliptic/cg-discretization.hh" -#include "linearelliptic/cg-testcases.hh" - -using namespace Dune; -using namespace Dune::GDT; - - -#if HAVE_DUNE_FEM && HAVE_EIGEN - -TYPED_TEST_CASE(linearelliptic_CG_discretization, YaspGridTestCases); -TYPED_TEST(linearelliptic_CG_discretization, eoc_study_using_fem_and_eigen_and_sgrid) -{ - this->template eoc_study<ChooseSpaceBackend::fem, XT::LA::Backends::eigen_sparse>(); -} - -#else - -TEST(DISABLED_linearelliptic_CG_discretization, eoc_study_using_fem_and_eigen_and_sgrid) -{ -} - -#endif diff --git a/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_fem_istl.cc b/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_fem_istl.cc deleted file mode 100644 index 35efede0ebc2dafdc5d7b9fae70d5b4036a4c78b..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_fem_istl.cc +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING -#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 -#endif - -#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! - -#include "linearelliptic/cg-discretization.hh" -#include "linearelliptic/cg-testcases.hh" - -using namespace Dune; -using namespace Dune::GDT; - - -#if HAVE_DUNE_FEM && HAVE_DUNE_ISTL - -TYPED_TEST_CASE(linearelliptic_CG_discretization, YaspGridTestCases); -TYPED_TEST(linearelliptic_CG_discretization, eoc_study_using_fem_and_istl_and_sgrid) -{ - this->template eoc_study<ChooseSpaceBackend::fem, XT::LA::Backends::istl_sparse>(); -} - -#else - -TEST(DISABLED_linearelliptic_CG_discretization, eoc_study_using_fem_and_istl_and_sgrid) -{ -} - -#endif diff --git a/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_pdelab_eigen.cc b/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_pdelab_eigen.cc deleted file mode 100644 index bc117be991ecf7edb8c320fa900e88c91f46331b..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_pdelab_eigen.cc +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING -#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 -#endif - -#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! - -#include "linearelliptic/cg-discretization.hh" -#include "linearelliptic/cg-testcases.hh" - -using namespace Dune; -using namespace Dune::GDT; - - -#if HAVE_DUNE_PDELAB && HAVE_EIGEN - -TYPED_TEST_CASE(linearelliptic_CG_discretization, YaspGridTestCases); -TYPED_TEST(linearelliptic_CG_discretization, eoc_study_using_pdelab_and_eigen_and_sgrid) -{ - this->template eoc_study<ChooseSpaceBackend::pdelab, XT::LA::Backends::eigen_sparse>(); -} - -#else - -TEST(DISABLED_linearelliptic_CG_discretization, eoc_study_using_pdelab_and_eigen_and_sgrid) -{ -} - -#endif diff --git a/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_pdelab_istl.cc b/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_pdelab_istl.cc deleted file mode 100644 index 1417e22c39345485d9c70e3edcef4fc23d9a685f..0000000000000000000000000000000000000000 --- a/dune/gdt/test/linearelliptic__cg_discretization__yaspgrid_pdelab_istl.cc +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the dune-gdt project: -// https://github.com/dune-community/dune-gdt -// Copyright 2010-2016 dune-gdt developers and contributors. All rights reserved. -// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -// Authors: -// Felix Schindler (2015 - 2016) - -#ifndef DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING -#define DUNE_STUFF_TEST_MAIN_ENABLE_INFO_LOGGING 1 -#endif - -#include <dune/xt/common/test/main.hxx> // <- This one has to come first (includes the config.h)! - -#include "linearelliptic/cg-discretization.hh" -#include "linearelliptic/cg-testcases.hh" - -using namespace Dune; -using namespace Dune::GDT; - - -#if HAVE_DUNE_PDELAB && HAVE_DUNE_ISTL - -TYPED_TEST_CASE(linearelliptic_CG_discretization, YaspGridTestCases); -TYPED_TEST(linearelliptic_CG_discretization, eoc_study_using_pdelab_and_istl_and_sgrid) -{ - this->template eoc_study<ChooseSpaceBackend::pdelab, XT::LA::Backends::istl_sparse>(); -} - -#else - -TEST(DISABLED_linearelliptic_CG_discretization, eoc_study_using_pdelab_and_istl_and_sgrid) -{ -} - -#endif diff --git a/dune/gdt/test/stationary-testcase.hh b/dune/gdt/test/stationary-testcase.hh index 51d96d526ac9f413a885fa946cb39f92957b0378..ebd8a180f1dcdf72c2328e52757acd5bf00358c9 100644 --- a/dune/gdt/test/stationary-testcase.hh +++ b/dune/gdt/test/stationary-testcase.hh @@ -59,7 +59,7 @@ public: { out << "+==============================================================+\n" << "|+============================================================+|\n" - << "|| This is a GDT::Tests::StationaryTestCase, please provide ||\n" + << "|| This is a GDT::Test::StationaryTestCase, please provide ||\n" << "|| a meaningful message by implementing `print_header()` ||\n" << "|+============================================================+|\n" << "+==============================================================+" << std::endl;