From: Timo Heister Date: Tue, 14 Mar 2023 01:22:30 +0000 (-0400) Subject: clean up a test X-Git-Tag: v9.5.0-rc1~482^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14883%2Fhead;p=dealii.git clean up a test --- diff --git a/tests/sparsity/flux_sparsity_pattern_visiting_once.cc b/tests/sparsity/flux_sparsity_pattern_visiting_once.cc index 649019513a..6689c36546 100644 --- a/tests/sparsity/flux_sparsity_pattern_visiting_once.cc +++ b/tests/sparsity/flux_sparsity_pattern_visiting_once.cc @@ -14,11 +14,11 @@ * --------------------------------------------------------------------- */ -// @sect3{This test considers two elements which share a common, regular face. +// This test considers two elements which share a common, regular face. // The logic of make_flux_sparsity_pattern() loops over all faces and filters // some of them according to a predicate face_has_flux_coupling(). We check // that the only internal face in the current setup is visited exactly once and -// that the predicate face_has_flux_coupling() is evaluated once for this face.} +// that the predicate face_has_flux_coupling() is evaluated once for this face. #include @@ -63,18 +63,21 @@ create_and_output_flux_sparsity_with_filter( std::function::active_cell_iterator, const unsigned int)> filter) { - DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_flux_sparsity_pattern( - dof_handler, - dsp, - AffineConstraints(), - true, - Table<2, DoFTools::Coupling>(1, 1, new auto(DoFTools::always)), - Table<2, DoFTools::Coupling>(1, 1, new auto(DoFTools::always)), - numbers::invalid_subdomain_id, - [&](const auto &cell, const unsigned int face_index) { - return filter(cell, face_index); - }); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); + Table<2, DoFTools::Coupling> coupling(1, 1); + coupling.fill(DoFTools::always); + + DoFTools::make_flux_sparsity_pattern(dof_handler, + dsp, + AffineConstraints(), + true, + coupling, + coupling, + numbers::invalid_subdomain_id, + [&](const auto & cell, + const unsigned int face_index) { + return filter(cell, face_index); + }); dsp.print(deallog.get_file_stream()); } @@ -82,12 +85,11 @@ template void check() { - // create a square with two elements const Triangulation tria = make_two_elements(); - // Generate Q1 dofs for the mesh grid + DoFHandler dof_handler(tria); dof_handler.distribute_dofs(FE_Q(1)); - // create and output the sparsity pattern by using a filter + create_and_output_flux_sparsity_with_filter(dof_handler, is_face_on_OY); }