--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Tests CellwiseInverseMassMatrix::transform_from_q_points_to_basis
+
+#include <deal.II/base/function_lib.h>
+
+#include <deal.II/dofs/dof_handler.h>
+
+#include <deal.II/fe/fe_dgq.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria.h>
+
+#include <deal.II/lac/vector.h>
+
+#include <deal.II/matrix_free/fe_evaluation.h>
+#include <deal.II/matrix_free/matrix_free.h>
+#include <deal.II/matrix_free/operators.h>
+
+#include <deal.II/numerics/vector_tools.h>
+
+#include "../tests.h"
+
+
+
+template <int dim, int fe_degree>
+void
+test()
+{
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube(tria, 0.2, 0.8);
+
+ const unsigned int degree = fe_degree;
+ FE_DGQ<dim> fe(degree);
+ deallog << "Testing " << fe.get_name() << std::endl;
+ DoFHandler<dim> dof(tria);
+ dof.distribute_dofs(fe);
+
+ Vector<double> vec(dof.n_dofs());
+ Functions::SquareFunction<dim> function;
+ VectorTools::interpolate(dof, function, vec);
+
+ MatrixFree<dim> matrix_free;
+ AffineConstraints<double> dummy;
+ typename MatrixFree<dim>::AdditionalData additional_data;
+ additional_data.mapping_update_flags |= update_quadrature_points;
+ matrix_free.reinit(dof, dummy, QGauss<1>(degree + 1), additional_data);
+
+ FEEvaluation<dim, degree> fe_eval(matrix_free);
+ FEEvaluation<dim, degree> fe_eval_default(matrix_free);
+ MatrixFreeOperators::CellwiseInverseMassMatrix<dim, degree> inverse_mass(
+ fe_eval);
+
+ fe_eval.reinit(0);
+ fe_eval_default.reinit(0);
+ fe_eval_default.read_dof_values(vec);
+ for (unsigned int q = 0; q < fe_eval.n_q_points; ++q)
+ {
+ Point<dim> p;
+ for (unsigned int d = 0; d < dim; ++d)
+ p[d] = fe_eval.quadrature_point(q)[d][0];
+ fe_eval.begin_values()[q] = function.value(p);
+ }
+ inverse_mass.transform_from_q_points_to_basis(1,
+ fe_eval.begin_values(),
+ fe_eval.begin_dof_values());
+ for (unsigned int q = 0; q < fe_eval.dofs_per_cell; ++q)
+ deallog << "Value reference / actual: "
+ << fe_eval_default.begin_dof_values()[q][0] << " / "
+ << fe_eval.begin_dof_values()[q][0] << std::endl;
+
+ deallog << std::endl;
+}
+
+
+
+int
+main()
+{
+ initlog();
+
+ deallog << std::setprecision(10);
+
+ {
+ deallog.push("2d");
+ test<2, 2>();
+ test<2, 4>();
+ deallog.pop();
+ deallog.push("3d");
+ test<3, 2>();
+ test<3, 3>();
+ deallog.pop();
+ }
+}
--- /dev/null
+
+DEAL:2d::Testing FE_DGQ<2>(2)
+DEAL:2d::Value reference / actual: 0.08000000000 / 0.08000000000
+DEAL:2d::Value reference / actual: 0.2900000000 / 0.2900000000
+DEAL:2d::Value reference / actual: 0.6800000000 / 0.6800000000
+DEAL:2d::Value reference / actual: 0.2900000000 / 0.2900000000
+DEAL:2d::Value reference / actual: 0.5000000000 / 0.5000000000
+DEAL:2d::Value reference / actual: 0.8900000000 / 0.8900000000
+DEAL:2d::Value reference / actual: 0.6800000000 / 0.6800000000
+DEAL:2d::Value reference / actual: 0.8900000000 / 0.8900000000
+DEAL:2d::Value reference / actual: 1.280000000 / 1.280000000
+DEAL:2d::
+DEAL:2d::Testing FE_DGQ<2>(4)
+DEAL:2d::Value reference / actual: 0.08000000000 / 0.08000000000
+DEAL:2d::Value reference / actual: 0.1321753274 / 0.1321753274
+DEAL:2d::Value reference / actual: 0.2900000000 / 0.2900000000
+DEAL:2d::Value reference / actual: 0.5249675298 / 0.5249675298
+DEAL:2d::Value reference / actual: 0.6800000000 / 0.6800000000
+DEAL:2d::Value reference / actual: 0.1321753274 / 0.1321753274
+DEAL:2d::Value reference / actual: 0.1843506547 / 0.1843506547
+DEAL:2d::Value reference / actual: 0.3421753274 / 0.3421753274
+DEAL:2d::Value reference / actual: 0.5771428571 / 0.5771428571
+DEAL:2d::Value reference / actual: 0.7321753274 / 0.7321753274
+DEAL:2d::Value reference / actual: 0.2900000000 / 0.2900000000
+DEAL:2d::Value reference / actual: 0.3421753274 / 0.3421753274
+DEAL:2d::Value reference / actual: 0.5000000000 / 0.5000000000
+DEAL:2d::Value reference / actual: 0.7349675298 / 0.7349675298
+DEAL:2d::Value reference / actual: 0.8900000000 / 0.8900000000
+DEAL:2d::Value reference / actual: 0.5249675298 / 0.5249675298
+DEAL:2d::Value reference / actual: 0.5771428571 / 0.5771428571
+DEAL:2d::Value reference / actual: 0.7349675298 / 0.7349675298
+DEAL:2d::Value reference / actual: 0.9699350596 / 0.9699350596
+DEAL:2d::Value reference / actual: 1.124967530 / 1.124967530
+DEAL:2d::Value reference / actual: 0.6800000000 / 0.6800000000
+DEAL:2d::Value reference / actual: 0.7321753274 / 0.7321753274
+DEAL:2d::Value reference / actual: 0.8900000000 / 0.8900000000
+DEAL:2d::Value reference / actual: 1.124967530 / 1.124967530
+DEAL:2d::Value reference / actual: 1.280000000 / 1.280000000
+DEAL:2d::
+DEAL:3d::Testing FE_DGQ<3>(2)
+DEAL:3d::Value reference / actual: 0.1200000000 / 0.1200000000
+DEAL:3d::Value reference / actual: 0.3300000000 / 0.3300000000
+DEAL:3d::Value reference / actual: 0.7200000000 / 0.7200000000
+DEAL:3d::Value reference / actual: 0.3300000000 / 0.3300000000
+DEAL:3d::Value reference / actual: 0.5400000000 / 0.5400000000
+DEAL:3d::Value reference / actual: 0.9300000000 / 0.9300000000
+DEAL:3d::Value reference / actual: 0.7200000000 / 0.7200000000
+DEAL:3d::Value reference / actual: 0.9300000000 / 0.9300000000
+DEAL:3d::Value reference / actual: 1.320000000 / 1.320000000
+DEAL:3d::Value reference / actual: 0.3300000000 / 0.3300000000
+DEAL:3d::Value reference / actual: 0.5400000000 / 0.5400000000
+DEAL:3d::Value reference / actual: 0.9300000000 / 0.9300000000
+DEAL:3d::Value reference / actual: 0.5400000000 / 0.5400000000
+DEAL:3d::Value reference / actual: 0.7500000000 / 0.7500000000
+DEAL:3d::Value reference / actual: 1.140000000 / 1.140000000
+DEAL:3d::Value reference / actual: 0.9300000000 / 0.9300000000
+DEAL:3d::Value reference / actual: 1.140000000 / 1.140000000
+DEAL:3d::Value reference / actual: 1.530000000 / 1.530000000
+DEAL:3d::Value reference / actual: 0.7200000000 / 0.7200000000
+DEAL:3d::Value reference / actual: 0.9300000000 / 0.9300000000
+DEAL:3d::Value reference / actual: 1.320000000 / 1.320000000
+DEAL:3d::Value reference / actual: 0.9300000000 / 0.9300000000
+DEAL:3d::Value reference / actual: 1.140000000 / 1.140000000
+DEAL:3d::Value reference / actual: 1.530000000 / 1.530000000
+DEAL:3d::Value reference / actual: 1.320000000 / 1.320000000
+DEAL:3d::Value reference / actual: 1.530000000 / 1.530000000
+DEAL:3d::Value reference / actual: 1.920000000 / 1.920000000
+DEAL:3d::
+DEAL:3d::Testing FE_DGQ<3>(3)
+DEAL:3d::Value reference / actual: 0.1200000000 / 0.1200000000
+DEAL:3d::Value reference / actual: 0.2138359214 / 0.2138359214
+DEAL:3d::Value reference / actual: 0.4821640786 / 0.4821640786
+DEAL:3d::Value reference / actual: 0.7200000000 / 0.7200000000
+DEAL:3d::Value reference / actual: 0.2138359214 / 0.2138359214
+DEAL:3d::Value reference / actual: 0.3076718427 / 0.3076718427
+DEAL:3d::Value reference / actual: 0.5760000000 / 0.5760000000
+DEAL:3d::Value reference / actual: 0.8138359214 / 0.8138359214
+DEAL:3d::Value reference / actual: 0.4821640786 / 0.4821640786
+DEAL:3d::Value reference / actual: 0.5760000000 / 0.5760000000
+DEAL:3d::Value reference / actual: 0.8443281573 / 0.8443281573
+DEAL:3d::Value reference / actual: 1.082164079 / 1.082164079
+DEAL:3d::Value reference / actual: 0.7200000000 / 0.7200000000
+DEAL:3d::Value reference / actual: 0.8138359214 / 0.8138359214
+DEAL:3d::Value reference / actual: 1.082164079 / 1.082164079
+DEAL:3d::Value reference / actual: 1.320000000 / 1.320000000
+DEAL:3d::Value reference / actual: 0.2138359214 / 0.2138359214
+DEAL:3d::Value reference / actual: 0.3076718427 / 0.3076718427
+DEAL:3d::Value reference / actual: 0.5760000000 / 0.5760000000
+DEAL:3d::Value reference / actual: 0.8138359214 / 0.8138359214
+DEAL:3d::Value reference / actual: 0.3076718427 / 0.3076718427
+DEAL:3d::Value reference / actual: 0.4015077641 / 0.4015077641
+DEAL:3d::Value reference / actual: 0.6698359214 / 0.6698359214
+DEAL:3d::Value reference / actual: 0.9076718427 / 0.9076718427
+DEAL:3d::Value reference / actual: 0.5760000000 / 0.5760000000
+DEAL:3d::Value reference / actual: 0.6698359214 / 0.6698359214
+DEAL:3d::Value reference / actual: 0.9381640786 / 0.9381640786
+DEAL:3d::Value reference / actual: 1.176000000 / 1.176000000
+DEAL:3d::Value reference / actual: 0.8138359214 / 0.8138359214
+DEAL:3d::Value reference / actual: 0.9076718427 / 0.9076718427
+DEAL:3d::Value reference / actual: 1.176000000 / 1.176000000
+DEAL:3d::Value reference / actual: 1.413835921 / 1.413835921
+DEAL:3d::Value reference / actual: 0.4821640786 / 0.4821640786
+DEAL:3d::Value reference / actual: 0.5760000000 / 0.5760000000
+DEAL:3d::Value reference / actual: 0.8443281573 / 0.8443281573
+DEAL:3d::Value reference / actual: 1.082164079 / 1.082164079
+DEAL:3d::Value reference / actual: 0.5760000000 / 0.5760000000
+DEAL:3d::Value reference / actual: 0.6698359214 / 0.6698359214
+DEAL:3d::Value reference / actual: 0.9381640786 / 0.9381640786
+DEAL:3d::Value reference / actual: 1.176000000 / 1.176000000
+DEAL:3d::Value reference / actual: 0.8443281573 / 0.8443281573
+DEAL:3d::Value reference / actual: 0.9381640786 / 0.9381640786
+DEAL:3d::Value reference / actual: 1.206492236 / 1.206492236
+DEAL:3d::Value reference / actual: 1.444328157 / 1.444328157
+DEAL:3d::Value reference / actual: 1.082164079 / 1.082164079
+DEAL:3d::Value reference / actual: 1.176000000 / 1.176000000
+DEAL:3d::Value reference / actual: 1.444328157 / 1.444328157
+DEAL:3d::Value reference / actual: 1.682164079 / 1.682164079
+DEAL:3d::Value reference / actual: 0.7200000000 / 0.7200000000
+DEAL:3d::Value reference / actual: 0.8138359214 / 0.8138359214
+DEAL:3d::Value reference / actual: 1.082164079 / 1.082164079
+DEAL:3d::Value reference / actual: 1.320000000 / 1.320000000
+DEAL:3d::Value reference / actual: 0.8138359214 / 0.8138359214
+DEAL:3d::Value reference / actual: 0.9076718427 / 0.9076718427
+DEAL:3d::Value reference / actual: 1.176000000 / 1.176000000
+DEAL:3d::Value reference / actual: 1.413835921 / 1.413835921
+DEAL:3d::Value reference / actual: 1.082164079 / 1.082164079
+DEAL:3d::Value reference / actual: 1.176000000 / 1.176000000
+DEAL:3d::Value reference / actual: 1.444328157 / 1.444328157
+DEAL:3d::Value reference / actual: 1.682164079 / 1.682164079
+DEAL:3d::Value reference / actual: 1.320000000 / 1.320000000
+DEAL:3d::Value reference / actual: 1.413835921 / 1.413835921
+DEAL:3d::Value reference / actual: 1.682164079 / 1.682164079
+DEAL:3d::Value reference / actual: 1.920000000 / 1.920000000
+DEAL:3d::