Skip to content
Snippets Groups Projects
Unverified Commit 119873b3 authored by René Fritze's avatar René Fritze
Browse files

[tests] fix build for integrands_{laplace,product}

parent 05aa8124
No related branches found
No related tags found
1 merge request!10Draft: consolidate refactoring work
Pipeline #135523 failed
...@@ -119,11 +119,14 @@ struct LaplaceIntegrandTest : public IntegrandTest<G> ...@@ -119,11 +119,14 @@ struct LaplaceIntegrandTest : public IntegrandTest<G>
// std::string grid_name = XT::Common::Typename<G>::value(); // std::string grid_name = XT::Common::Typename<G>::value();
const auto space = make_continuous_lagrange_space<1>(grid_view, /*polorder=*/2); const auto space = make_continuous_lagrange_space<1>(grid_view, /*polorder=*/2);
const auto n = space.mapper().size(); const auto n = space.mapper().size();
MatrixType stiffness_matrix(n, n, make_element_sparsity_pattern(space, space, grid_view)); BilinearForm<GV, 1> laplace_form(grid_view);
MatrixOperator<GV, 1> laplace_operator(grid_view, space, space, stiffness_matrix); laplace_form += LocalElementIntegralBilinearForm<E, 1>(integrand);
laplace_operator.append(LocalElementIntegralBilinearForm<E, 1>(integrand)); auto laplace_op = laplace_form.template with<MatrixType>(space, space);
laplace_operator.assemble(true); auto walker = XT::Grid::make_walker(grid_view);
const auto mat_data_ptr = XT::Common::serialize_rowwise(stiffness_matrix); walker.append(laplace_op);
walker.walk(DXTC_TEST_CONFIG_GET("setup.use_tbb", true));
const auto mat_data_ptr = XT::Common::serialize_rowwise(laplace_op.matrix());
const auto min_entry = *std::min_element(mat_data_ptr.begin(), mat_data_ptr.begin() + n * n); const auto min_entry = *std::min_element(mat_data_ptr.begin(), mat_data_ptr.begin() + n * n);
const auto max_entry = *std::max_element(mat_data_ptr.begin(), mat_data_ptr.begin() + n * n); const auto max_entry = *std::max_element(mat_data_ptr.begin(), mat_data_ptr.begin() + n * n);
const auto square_sum = std::accumulate( const auto square_sum = std::accumulate(
......
...@@ -110,11 +110,15 @@ struct ProductIntegrandTest : public IntegrandTest<G> ...@@ -110,11 +110,15 @@ struct ProductIntegrandTest : public IntegrandTest<G>
const auto& grid_view = grid_provider_->leaf_view(); const auto& grid_view = grid_provider_->leaf_view();
const auto space = make_continuous_lagrange_space<1>(grid_view, /*polorder=*/2); const auto space = make_continuous_lagrange_space<1>(grid_view, /*polorder=*/2);
const auto n = space.mapper().size(); const auto n = space.mapper().size();
MatrixType mass_matrix(n, n, make_element_sparsity_pattern(space, space, grid_view));
MatrixOperator<GV, 1> product_operator(grid_view, space, space, mass_matrix); BilinearForm<GV, 1> product_form(grid_view);
product_operator.append(LocalElementIntegralBilinearForm<E, 1>(integrand)); product_form += LocalElementIntegralBilinearForm<E, 1>(integrand);
product_operator.assemble(true); auto product_op = product_form.template with<MatrixType>(space, space);
const auto mat_data_ptr = XT::Common::serialize_rowwise(mass_matrix); auto walker = XT::Grid::make_walker(grid_view);
walker.append(product_op);
walker.walk(DXTC_TEST_CONFIG_GET("setup.use_tbb", true));
const auto mat_data_ptr = XT::Common::serialize_rowwise(product_op.matrix());
const auto min_entry = *std::min_element(mat_data_ptr.begin(), mat_data_ptr.begin() + n * n); const auto min_entry = *std::min_element(mat_data_ptr.begin(), mat_data_ptr.begin() + n * n);
const auto max_entry = *std::max_element(mat_data_ptr.begin(), mat_data_ptr.begin() + n * n); const auto max_entry = *std::max_element(mat_data_ptr.begin(), mat_data_ptr.begin() + n * n);
const auto square_sum = std::accumulate( const auto square_sum = std::accumulate(
......
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