--- /dev/null
+Improved: MGTransferMF now also supports FE_DGP.
+<br>
+(Peter Munch, Nils Margenberg, 2024/09/24)
* refined meshes.
*
* This class currently only works for the tensor-product finite elements
- * FE_Q and FE_DGQ and simplex elements FE_SimplexP and FE_SimplexDGP as well as
- * for systems involving multiple components of one of these elements. Other
- * elements are currently not implemented.
+ * FE_Q, FE_DGQ, and FE_DGP and simplex elements FE_SimplexP and FE_SimplexDGP
+ * as well as for systems involving multiple components of one of these
+ * elements. Other elements are currently not implemented.
*
* The implementation of this class is explained in detail in @cite munch2022gc.
*/
+ template <int dim>
+ bool
+ fe_has_tp_structure(const FiniteElement<dim> &fe)
+ {
+ return fe.n_base_elements() == 1 &&
+ ((dynamic_cast<const FE_Q<dim> *>(&fe.base_element(0)) != nullptr) ||
+ (dynamic_cast<const FE_DGQ<dim> *>(&fe.base_element(0)) !=
+ nullptr) ||
+ (dynamic_cast<const FE_Q_iso_Q1<dim> *>(&fe.base_element(0)) !=
+ nullptr));
+ }
+
+
+
class MGTwoLevelTransferImplementation
{
/**
((dynamic_cast<const FE_Q<dim> *>(
&fe_fine.base_element(0)) != nullptr));
+ const bool has_tp_structure = fe_has_tp_structure(fe_fine);
+
for (auto &scheme : transfer.schemes)
{
// number of dofs on coarse and fine cells
const auto cell_local_children_indices =
- (reference_cell == ReferenceCells::get_hypercube<dim>()) ?
+ (has_tp_structure) ?
get_child_offsets<dim>(transfer.schemes[0].n_dofs_per_cell_coarse,
is_feq ? fe_fine.degree : (fe_fine.degree + 1),
fe_fine.degree) :
// ---------------------- lexicographic_numbering ----------------------
std::vector<unsigned int> lexicographic_numbering_fine;
std::vector<unsigned int> lexicographic_numbering_coarse;
- if (reference_cell == ReferenceCells::get_hypercube<dim>())
+ if (has_tp_structure)
{
const Quadrature<1> dummy_quadrature(
std::vector<Point<1>>(1, Point<1>()));
transfer_scheme_index < transfer.schemes.size();
++transfer_scheme_index)
{
- if (reference_cell == ReferenceCells::get_hypercube<dim>())
+ if (has_tp_structure)
{
const auto fe = create_1D_fe(fe_fine.base_element(0));
AssertDimension(fe_fine.n_base_elements(), 1);
AssertDimension(fe_coarse.n_base_elements(), 1);
+ const bool has_tp_structure = fe_has_tp_structure(fe_fine);
+
const FiniteElement<dim> &fe_fine_scalar = fe_fine.base_element(0);
const FiniteElement<dim> &fe_coarse_scalar = fe_coarse.base_element(0);
- const auto reference_cell = fe_fine.reference_cell();
-
- Assert(reference_cell == fe_coarse.reference_cell(), ExcNotImplemented());
+ Assert(fe_fine.reference_cell() == fe_coarse.reference_cell(),
+ ExcNotImplemented());
- if (reference_cell == ReferenceCells::get_hypercube<dim>() &&
- (fe_coarse != fe_fine) &&
+ if (has_tp_structure && (fe_coarse != fe_fine) &&
(fe_coarse.n_dofs_per_cell() != 0 && fe_fine.n_dofs_per_cell() != 0))
{
const auto fe_fine_1d = create_1D_fe(fe_fine_scalar);
scheme.restriction_matrix[k] =
matrix(renumbering_coarse[i], renumbering_fine[j]);
}
- else if (reference_cell != ReferenceCells::get_hypercube<dim>() &&
- (fe_fine != fe_coarse) &&
+ else if ((!has_tp_structure) && (fe_fine != fe_coarse) &&
(fe_fine.n_dofs_per_cell() != 0 &&
fe_coarse.n_dofs_per_cell() != 0))
{
&fe.base_element(0)) != nullptr);
});
+ const bool has_tp_structure =
+ std::all_of(dof_handler_fine.get_fe_collection().begin(),
+ dof_handler_fine.get_fe_collection().end(),
+ [](const auto &fe) { return fe_has_tp_structure(fe); });
const auto process_cells = [&](const auto &fu) {
loop_over_active_or_level_cells(
ExcNotImplemented());
// ------------------- lexicographic_numbering --------------------
- if (reference_cell == ReferenceCells::get_hypercube<dim>())
+ if (has_tp_structure)
{
const Quadrature<1> dummy_quadrature(
std::vector<Point<1>>(1, Point<1>()));
--- /dev/null
+// ------------------------------------------------------------------------
+//
+// SPDX-License-Identifier: LGPL-2.1-or-later
+// Copyright (C) 2020 - 2024 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// Part of the source code is dual licensed under Apache-2.0 WITH
+// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
+// governing the source code and code contributions can be found in
+// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
+//
+// ------------------------------------------------------------------------
+
+
+/**
+ * Test MGTwoLevelTransfer for FE_DGP.
+ */
+
+#include <deal.II/base/conditional_ostream.h>
+#include <deal.II/base/function.h>
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/mpi.h>
+#include <deal.II/base/quadrature_lib.h>
+
+#include <deal.II/distributed/tria.h>
+
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_tools.h>
+
+#include <deal.II/fe/fe_dgp.h>
+#include <deal.II/fe/fe_simplex_p.h>
+#include <deal.II/fe/fe_tools.h>
+#include <deal.II/fe/mapping_q.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+
+#include <deal.II/matrix_free/fe_evaluation.h>
+#include <deal.II/matrix_free/matrix_free.h>
+
+#include <deal.II/multigrid/mg_constrained_dofs.h>
+#include <deal.II/multigrid/mg_transfer_global_coarsening.h>
+
+#include "mg_transfer_util.h"
+
+using namespace dealii;
+
+template <int dim>
+class RightHandSideFunction : public Function<dim>
+{
+public:
+ RightHandSideFunction()
+ : Function<dim>(1)
+ {}
+
+ virtual double
+ value(const Point<dim> &p, const unsigned int component = 0) const
+ {
+ (void)component;
+ return p[0];
+ }
+};
+
+template <int dim, typename Number, typename MeshType>
+void
+test_interpolation(
+ const MGTwoLevelTransferBase<LinearAlgebra::distributed::Vector<Number>>
+ &transfer,
+ const MeshType &dof_handler_fine,
+ const MeshType &dof_handler_coarse,
+ const Function<dim, Number> &function,
+ const unsigned int mg_level_fine = numbers::invalid_unsigned_int,
+ const unsigned int mg_level_coarse = numbers::invalid_unsigned_int)
+{
+ AffineConstraints<Number> constraint_fine(
+ dof_handler_fine.locally_owned_dofs(),
+ DoFTools::extract_locally_relevant_dofs(dof_handler_fine));
+ DoFTools::make_hanging_node_constraints(dof_handler_fine, constraint_fine);
+ constraint_fine.close();
+
+ // perform interpolation
+ LinearAlgebra::distributed::Vector<Number> src, dst;
+
+ initialize_dof_vector(dst, dof_handler_fine, mg_level_fine);
+ initialize_dof_vector(src, dof_handler_coarse, mg_level_coarse);
+
+ // test interpolate
+ AffineConstraints<Number> dummy;
+ dummy.close();
+ VectorTools::project(dof_handler_fine, dummy, QGauss<dim>(4), function, dst);
+
+ transfer.interpolate(src, dst);
+ print_if_non_zero(dst, 1e-7);
+ print_if_non_zero(src, 1e-7);
+
+ // prolongate back
+ dst = 0.0;
+ transfer.prolongate_and_add(dst, src);
+ print_if_non_zero(dst, 1e-7);
+ deallog << std::endl;
+}
+
+template <int dim, typename Number>
+void
+do_test(const FiniteElement<dim> &fe_fine,
+ const FiniteElement<dim> &fe_coarse,
+ const Function<dim, Number> &function,
+ const bool refine_fine_mesh)
+{
+ // create coarse grid
+ Triangulation<dim> tria_coarse;
+ GridGenerator::hyper_cube(tria_coarse);
+
+ // create fine grid
+ Triangulation<dim> tria_fine;
+ GridGenerator::hyper_cube(tria_fine);
+
+ if (refine_fine_mesh)
+ tria_fine.refine_global();
+
+ // setup dof-handlers
+ DoFHandler<dim> dof_handler_fine(tria_fine);
+ dof_handler_fine.distribute_dofs(fe_fine);
+
+ DoFHandler<dim> dof_handler_coarse(tria_coarse);
+ dof_handler_coarse.distribute_dofs(fe_coarse);
+
+ // setup constraint matrix
+ AffineConstraints<Number> constraint_coarse;
+ constraint_coarse.close();
+
+ AffineConstraints<Number> constraint_fine;
+ constraint_fine.close();
+
+ // setup transfer operator
+ MGTwoLevelTransfer<dim, LinearAlgebra::distributed::Vector<Number>> transfer;
+
+ transfer.reinit(dof_handler_fine,
+ dof_handler_coarse,
+ constraint_fine,
+ constraint_coarse);
+
+ test_interpolation(transfer, dof_handler_fine, dof_handler_coarse, function);
+}
+
+template <int dim, typename Number>
+void
+test(int fe_degree, const Function<dim, Number> &function)
+{
+ const auto str_fine = std::to_string(fe_degree);
+ const auto str_coarse = std::to_string(fe_degree);
+ const auto str_dim = std::to_string(dim);
+
+ deallog.push("FE_DGP<" + str_dim + ">(" + str_fine + ")");
+ do_test<dim, double>(FE_DGP<dim>(fe_degree),
+ FE_DGP<dim>(fe_degree),
+ function,
+ true);
+ do_test<dim, double>(FE_DGP<dim>(fe_degree + 1),
+ FE_DGP<dim>(fe_degree),
+ function,
+ false);
+ deallog.pop();
+}
+
+template <int dim>
+void
+test()
+{
+ for (unsigned int i = 0; i <= 3; ++i)
+ test<dim, double>(i, Functions::ConstantFunction<dim, double>(1.));
+
+ deallog << std::endl << std::endl << std::endl;
+
+ for (unsigned int i = 0; i <= 3; ++i)
+ test<dim, double>(i, RightHandSideFunction<dim>());
+}
+
+int
+main(int argc, char **argv)
+{
+ Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
+ MPILogInitAll all;
+
+ deallog.precision(8);
+
+ test<1>();
+ test<2>();
+}
--- /dev/null
+
+DEAL:0:FE_DGP<1>(0)::1.0000000 1.0000000
+DEAL:0:FE_DGP<1>(0)::1.0000000
+DEAL:0:FE_DGP<1>(0)::1.0000000 1.0000000
+DEAL:0:FE_DGP<1>(0)::
+DEAL:0:FE_DGP<1>(0)::1.0000000 0.0000000
+DEAL:0:FE_DGP<1>(0)::1.0000000
+DEAL:0:FE_DGP<1>(0)::1.0000000 0.0000000
+DEAL:0:FE_DGP<1>(0)::
+DEAL:0:FE_DGP<1>(1)::1.0000000 0.0000000 1.0000000 0.0000000
+DEAL:0:FE_DGP<1>(1)::1.0000000 0.0000000
+DEAL:0:FE_DGP<1>(1)::1.0000000 0.0000000 1.0000000 0.0000000
+DEAL:0:FE_DGP<1>(1)::
+DEAL:0:FE_DGP<1>(1)::1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(1)::1.0000000 0.0000000
+DEAL:0:FE_DGP<1>(1)::1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(1)::
+DEAL:0:FE_DGP<1>(2)::1.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(2)::1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(2)::1.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(2)::
+DEAL:0:FE_DGP<1>(2)::1.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(2)::1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(2)::1.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(2)::
+DEAL:0:FE_DGP<1>(3)::1.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::1.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::1.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::
+DEAL:0:FE_DGP<1>(3)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::1.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::
+DEAL:0::
+DEAL:0::
+DEAL:0::
+DEAL:0:FE_DGP<1>(0)::0.25000000 0.75000000
+DEAL:0:FE_DGP<1>(0)::0.50000000
+DEAL:0:FE_DGP<1>(0)::0.50000000 0.50000000
+DEAL:0:FE_DGP<1>(0)::
+DEAL:0:FE_DGP<1>(0)::0.50000000 0.28867513
+DEAL:0:FE_DGP<1>(0)::0.50000000
+DEAL:0:FE_DGP<1>(0)::0.50000000 0.0000000
+DEAL:0:FE_DGP<1>(0)::
+DEAL:0:FE_DGP<1>(1)::0.25000000 0.14433757 0.75000000 0.14433757
+DEAL:0:FE_DGP<1>(1)::0.50000000 0.28867513
+DEAL:0:FE_DGP<1>(1)::0.25000000 0.14433757 0.75000000 0.14433757
+DEAL:0:FE_DGP<1>(1)::
+DEAL:0:FE_DGP<1>(1)::0.50000000 0.28867513 0.0000000
+DEAL:0:FE_DGP<1>(1)::0.50000000 0.28867513
+DEAL:0:FE_DGP<1>(1)::0.50000000 0.28867513 0.0000000
+DEAL:0:FE_DGP<1>(1)::
+DEAL:0:FE_DGP<1>(2)::0.25000000 0.14433757 0.0000000 0.75000000 0.14433757 0.0000000
+DEAL:0:FE_DGP<1>(2)::0.50000000 0.28867513 0.0000000
+DEAL:0:FE_DGP<1>(2)::0.25000000 0.14433757 0.0000000 0.75000000 0.14433757 0.0000000
+DEAL:0:FE_DGP<1>(2)::
+DEAL:0:FE_DGP<1>(2)::0.50000000 0.28867513 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(2)::0.50000000 0.28867513 0.0000000
+DEAL:0:FE_DGP<1>(2)::0.50000000 0.28867513 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(2)::
+DEAL:0:FE_DGP<1>(3)::0.25000000 0.14433757 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::0.50000000 0.28867513 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::0.25000000 0.14433757 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::
+DEAL:0:FE_DGP<1>(3)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::0.50000000 0.28867513 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<1>(3)::
+DEAL:0:FE_DGP<2>(0)::1.0000000 1.0000000 1.0000000 1.0000000
+DEAL:0:FE_DGP<2>(0)::1.0000000
+DEAL:0:FE_DGP<2>(0)::1.0000000 1.0000000 1.0000000 1.0000000
+DEAL:0:FE_DGP<2>(0)::
+DEAL:0:FE_DGP<2>(0)::1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(0)::1.0000000
+DEAL:0:FE_DGP<2>(0)::1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(0)::
+DEAL:0:FE_DGP<2>(1)::1.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(1)::1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(1)::1.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(1)::
+DEAL:0:FE_DGP<2>(1)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(1)::1.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(1)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(1)::
+DEAL:0:FE_DGP<2>(2)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::
+DEAL:0:FE_DGP<2>(2)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::
+DEAL:0:FE_DGP<2>(3)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::
+DEAL:0:FE_DGP<2>(3)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::
+DEAL:0::
+DEAL:0::
+DEAL:0::
+DEAL:0:FE_DGP<2>(0)::0.25000000 0.75000000 0.25000000 0.75000000
+DEAL:0:FE_DGP<2>(0)::0.50000000
+DEAL:0:FE_DGP<2>(0)::0.50000000 0.50000000 0.50000000 0.50000000
+DEAL:0:FE_DGP<2>(0)::
+DEAL:0:FE_DGP<2>(0)::0.50000000 0.28867513 0.0000000
+DEAL:0:FE_DGP<2>(0)::0.50000000
+DEAL:0:FE_DGP<2>(0)::0.50000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(0)::
+DEAL:0:FE_DGP<2>(1)::0.25000000 0.14433757 0.0000000 0.75000000 0.14433757 0.0000000 0.25000000 0.14433757 0.0000000 0.75000000 0.14433757 0.0000000
+DEAL:0:FE_DGP<2>(1)::0.50000000 0.28867513 0.0000000
+DEAL:0:FE_DGP<2>(1)::0.25000000 0.14433757 0.0000000 0.75000000 0.14433757 0.0000000 0.25000000 0.14433757 0.0000000 0.75000000 0.14433757 0.0000000
+DEAL:0:FE_DGP<2>(1)::
+DEAL:0:FE_DGP<2>(1)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(1)::0.50000000 0.28867513 0.0000000
+DEAL:0:FE_DGP<2>(1)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(1)::
+DEAL:0:FE_DGP<2>(2)::0.25000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.25000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::0.25000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.25000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::
+DEAL:0:FE_DGP<2>(2)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(2)::
+DEAL:0:FE_DGP<2>(3)::0.25000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.25000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::0.25000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.25000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.75000000 0.14433757 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::
+DEAL:0:FE_DGP<2>(3)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::0.50000000 0.28867513 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
+DEAL:0:FE_DGP<2>(3)::
deallog << std::endl;
}
+template <typename Number>
+void
+print_if_non_zero(const LinearAlgebra::distributed::Vector<Number> &vec,
+ const Number tolerance)
+{
+ for (const auto &v : vec)
+ if (std::abs(v) > tolerance)
+ deallog << v << " ";
+ else
+ deallog << 0.0 << " ";
+ deallog << std::endl;
+}
+
template <int dim, typename Number, typename MeshType>
void