Skip to content
Snippets Groups Projects
Commit 452783a6 authored by Tobias Leibner's avatar Tobias Leibner
Browse files

Merge branch 'refactor_operators_and_products' of...

Merge branch 'refactor_operators_and_products' of https://github.com/dune-community/dune-gdt into refactor_operators_and_products

Conflicts:
	dune/gdt/test/CMakeLists.txt
parents 1b79ac14 a4f192c4
No related branches found
No related tags found
No related merge requests found
Showing
with 31 additions and 15 deletions
......@@ -13,8 +13,25 @@ foreach (test ${testnames})
add_dune_alugrid_flags(${test})
TARGET_LINK_LIBRARIES(${test} ${COMMON_LIBS})
set_tests_properties(${test} PROPERTIES TIMEOUT 360)
if (${test} MATCHES spaces)
list(APPEND spaces_test_binaries ${test})
endif (${test})
if (${test} MATCHES operators)
list(APPEND operators_test_binaries ${test})
endif (${test})
if (${test} MATCHES linearelliptic AND ${test} MATCHES alugrid)
list(APPEND linearelliptic_alugrid_test_binaries ${test})
endif (${test})
if (${test} MATCHES linearelliptic AND ${test} MATCHES sgrid)
list(APPEND linearelliptic_sgrid_test_binaries ${test})
endif (${test})
endforeach (test ${testnames})
add_custom_target(test_binaries_space DEPENDS ${spaces_test_binaries})
add_custom_target(test_binaries_operator DEPENDS ${operators_test_binaries})
add_custom_target(test_binaries_linearelliptic_cg_discretization_alugrid DEPENDS ${linearelliptic_alugrid_test_binaries})
add_custom_target(test_binaries_linearelliptic_cg_discretization_sgrid DEPENDS ${linearelliptic_sgrid_test_binaries})
# link spe10 data file if present
if (NOT ${SPE10MODEL1DATA} STREQUAL "SPE10MODEL1DATA-NOTFOUND")
set (SPE10MODEL1DATA_TARGET_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/perm_case1.dat")
......@@ -26,13 +43,13 @@ endif (NOT ${SPE10MODEL1DATA} STREQUAL "SPE10MODEL1DATA-NOTFOUND")
add_subdirectory(linearelliptic)
add_subdirectory(hyperbolic)
target_link_libraries(test_linearelliptic_cg_discretization_fem_eigen_alugrid lib_test_linearelliptic_cg_discretizations_alugrid)
target_link_libraries(test_linearelliptic_cg_discretization_fem_eigen_sgrid lib_test_linearelliptic_cg_discretizations_sgrid)
target_link_libraries(test_linearelliptic_cg_discretization_fem_istl_alugrid lib_test_linearelliptic_cg_discretizations_alugrid)
target_link_libraries(test_linearelliptic_cg_discretization_fem_istl_sgrid lib_test_linearelliptic_cg_discretizations_sgrid)
target_link_libraries(test_linearelliptic_cg_discretization_pdelab_eigen_alugrid lib_test_linearelliptic_cg_discretizations_alugrid)
target_link_libraries(test_linearelliptic_cg_discretization_pdelab_eigen_sgrid lib_test_linearelliptic_cg_discretizations_sgrid)
target_link_libraries(test_linearelliptic_cg_discretization_pdelab_istl_alugrid lib_test_linearelliptic_cg_discretizations_alugrid)
target_link_libraries(test_linearelliptic_cg_discretization_pdelab_istl_sgrid lib_test_linearelliptic_cg_discretizations_sgrid)
target_link_libraries(test_hyperbolic-fv-discretization_yaspgrid lib_test_hyperbolic_fv_discretizations_yaspgrid)
target_link_libraries(test_linearelliptic_cg_discretization_alugrid_fem_eigen lib_test_linearelliptic_cg_discretizations_alugrid)
target_link_libraries(test_linearelliptic_cg_discretization_sgrid_fem_eigen lib_test_linearelliptic_cg_discretizations_sgrid)
target_link_libraries(test_linearelliptic_cg_discretization_alugrid_fem_istl lib_test_linearelliptic_cg_discretizations_alugrid)
target_link_libraries(test_linearelliptic_cg_discretization_sgrid_fem_istl lib_test_linearelliptic_cg_discretizations_sgrid)
target_link_libraries(test_linearelliptic_cg_discretization_alugrid_pdelab_eigen lib_test_linearelliptic_cg_discretizations_alugrid)
target_link_libraries(test_linearelliptic_cg_discretization_sgrid_pdelab_eigen lib_test_linearelliptic_cg_discretizations_sgrid)
target_link_libraries(test_linearelliptic_cg_discretization_alugrid_pdelab_istl lib_test_linearelliptic_cg_discretizations_alugrid)
target_link_libraries(test_linearelliptic_cg_discretization_sgrid_pdelab_istl lib_test_linearelliptic_cg_discretizations_sgrid)
target_link_libraries(test_hyperbolic_fv_discretization_yaspgrid lib_test_hyperbolic_fv_discretizations_yaspgrid)
......@@ -557,7 +557,7 @@ struct EllipticMatrixOperatorTest : public EllipticProductBase<SpaceType>, publi
auto op = make_elliptic_matrix_operator<MatrixType>(diffusion_factor, diffusion_tensor, space);
// project the function
DiscreteFunctionType discrete_function(space);
project(space.grid_view(), function, discrete_function);
project(space.grid_view(), function, discrete_function, 2);
// compute product
const auto result = op->apply2(discrete_function, discrete_function);
auto op_tbb = make_elliptic_matrix_operator<MatrixType>(diffusion_factor, diffusion_tensor, space);
......@@ -573,7 +573,7 @@ struct EllipticMatrixOperatorTest : public EllipticProductBase<SpaceType>, publi
void correct_for_constant_arguments() const
{
const ExpressionFunctionType constant_gradient("x", "x[0]", 1, "constant gradient", {{"1.0", "0.0", "0.0"}});
this->check(compute(constant_gradient), factor_value_ * 1.0, 5.76e-13);
this->check(compute(constant_gradient), factor_value_ * 1.0, 5.05e-13);
}
/**
......@@ -583,7 +583,7 @@ struct EllipticMatrixOperatorTest : public EllipticProductBase<SpaceType>, publi
{
const ExpressionFunctionType linear_gradient(
"x", "0.5 * x[0] * x[0] - x[0]", 2, "affine gradient", {{"x[0] - 1.0", "0.0", "0.0"}});
this->check(compute(linear_gradient), factor_value_ * 1.0 / 3.0, 1.92e-13);
this->check(compute(linear_gradient), factor_value_ * 1.0 / 3.0, 1.71e-13);
}
/**
......@@ -593,7 +593,7 @@ struct EllipticMatrixOperatorTest : public EllipticProductBase<SpaceType>, publi
{
const ExpressionFunctionType quadratic_gradient(
"x", "(1.0/3.0) * x[0] * x[0] * x[0]", 3, ", quadratic gradient", {{"x[0]*x[0]", "0.0", "0.0"}});
this->check(compute(quadratic_gradient), factor_value_ * 1.0 / 5.0, 6.04e-14);
this->check(compute(quadratic_gradient), factor_value_ * 1.0 / 5.0, 5.33e-13);
}
void is_matrix_operator()
......
......@@ -63,8 +63,7 @@ struct WeightedL2ProductBase
check(compute(quadratic_), weight_value_ * (1.0 / 5.0));
}
void check(const RangeFieldType& result, const RangeFieldType& expected,
const RangeFieldType epsilon = 2.14e-14) const
void check(const RangeFieldType& result, const RangeFieldType& expected, const RangeFieldType epsilon = 2.5e-14) const
{
const auto error = std::abs(expected - result);
EXPECT_LE(error, epsilon) << "result: " << result << "\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment