From: Martin Kronbichler Date: Sun, 11 Oct 2020 20:36:19 +0000 (+0200) Subject: Test cases X-Git-Tag: v9.3.0-rc1~1005^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11034%2Fhead;p=dealii.git Test cases --- diff --git a/tests/matrix_free/tensor_product_evaluate_01.cc b/tests/matrix_free/tensor_product_evaluate_01.cc new file mode 100644 index 0000000000..8e251844f3 --- /dev/null +++ b/tests/matrix_free/tensor_product_evaluate_01.cc @@ -0,0 +1,109 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2020 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 point-wise evaluation of functions with +// evaluate_tensor_product_value_and_gradient for a scalar function +// represented by a linear function and comparing to the analytical value + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "../tests.h" + +template +void +test(const unsigned int degree) +{ + FE_Q fe(degree); + + Tensor<2, dim> matrix = unit_symmetric_tensor(); + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < dim; ++e) + matrix[d][e] += 0.1 * (d + 1 + 2 * e); + Tensor<1, dim> offset; + for (unsigned int d = 0; d < dim; ++d) + offset[d] = 2 + 0.7 * d; + + Tensor<1, dim> transform; + for (unsigned int d = 0; d < dim; ++d) + transform[d] = -0.2 + 1.25 * d; + + std::vector coefficients(fe.dofs_per_cell); + for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + coefficients[i] = + transform * (matrix * fe.get_unit_support_points()[i] + offset); + + const std::vector> polynomials = + Polynomials::generate_complete_Lagrange_basis( + QGaussLobatto<1>(degree + 1).get_points()); + + const std::vector renumbering = + FETools::lexicographic_to_hierarchic_numbering(degree); + + const std::vector> evaluation_points = + dim == 3 ? QGauss(2).get_points() : + QIterated(QTrapez<1>(), 3).get_points(); + + deallog << "Evaluate in " << dim << "d with polynomial degree " << degree + << std::endl; + for (const auto &p : evaluation_points) + { + const auto val = internal::evaluate_tensor_product_value_and_gradient( + polynomials, coefficients, p, false, renumbering); + deallog << "Value " << val.first << " vs " + << transform * (matrix * p + offset) << " ; gradient " + << val.second << " vs " << transform * matrix << std::endl; + } + + if (degree == 1) + { + deallog << "Evaluate d-linear shortcut in " << dim << "d" << std::endl; + for (const auto &p : evaluation_points) + { + const auto val = internal::evaluate_tensor_product_value_and_gradient( + polynomials, coefficients, p, true, renumbering); + deallog << "Value " << val.first << " vs " + << transform * (matrix * p + offset) << " ; gradient " + << val.second << " vs " << transform * matrix << std::endl; + } + } +} + + + +int +main() +{ + initlog(); + deallog << std::setprecision(9); + + for (unsigned int degree = 1; degree < 5; ++degree) + test<1>(degree); + for (unsigned int degree = 1; degree < 5; ++degree) + test<2>(degree); + for (unsigned int degree = 1; degree < 5; ++degree) + test<3>(degree); +} diff --git a/tests/matrix_free/tensor_product_evaluate_01.output b/tests/matrix_free/tensor_product_evaluate_01.output new file mode 100644 index 0000000000..dc7b68b96d --- /dev/null +++ b/tests/matrix_free/tensor_product_evaluate_01.output @@ -0,0 +1,156 @@ + +DEAL::Evaluate in 1d with polynomial degree 1 +DEAL::Value -0.400000000 vs -0.400000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.473333333 vs -0.473333333 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.546666667 vs -0.546666667 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.620000000 vs -0.620000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Evaluate d-linear shortcut in 1d +DEAL::Value -0.400000000 vs -0.400000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.473333333 vs -0.473333333 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.546666667 vs -0.546666667 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.620000000 vs -0.620000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Evaluate in 1d with polynomial degree 2 +DEAL::Value -0.400000000 vs -0.400000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.473333333 vs -0.473333333 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.546666667 vs -0.546666667 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.620000000 vs -0.620000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Evaluate in 1d with polynomial degree 3 +DEAL::Value -0.400000000 vs -0.400000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.473333333 vs -0.473333333 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.546666667 vs -0.546666667 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.620000000 vs -0.620000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Evaluate in 1d with polynomial degree 4 +DEAL::Value -0.400000000 vs -0.400000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.473333333 vs -0.473333333 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.546666667 vs -0.546666667 ; gradient -0.220000000 vs -0.220000000 +DEAL::Value -0.620000000 vs -0.620000000 ; gradient -0.220000000 vs -0.220000000 +DEAL::Evaluate in 2d with polynomial degree 1 +DEAL::Value 2.43500000 vs 2.43500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.43166667 vs 2.43166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42833333 vs 2.42833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42500000 vs 2.42500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90500000 vs 2.90500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90166667 vs 2.90166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89833333 vs 2.89833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89500000 vs 2.89500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37500000 vs 3.37500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37166667 vs 3.37166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36833333 vs 3.36833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36500000 vs 3.36500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84500000 vs 3.84500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84166667 vs 3.84166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83833333 vs 3.83833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83500000 vs 3.83500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Evaluate d-linear shortcut in 2d +DEAL::Value 2.43500000 vs 2.43500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.43166667 vs 2.43166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42833333 vs 2.42833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42500000 vs 2.42500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90500000 vs 2.90500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90166667 vs 2.90166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89833333 vs 2.89833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89500000 vs 2.89500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37500000 vs 3.37500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37166667 vs 3.37166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36833333 vs 3.36833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36500000 vs 3.36500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84500000 vs 3.84500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84166667 vs 3.84166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83833333 vs 3.83833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83500000 vs 3.83500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Evaluate in 2d with polynomial degree 2 +DEAL::Value 2.43500000 vs 2.43500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.43166667 vs 2.43166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42833333 vs 2.42833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42500000 vs 2.42500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90500000 vs 2.90500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90166667 vs 2.90166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89833333 vs 2.89833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89500000 vs 2.89500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37500000 vs 3.37500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37166667 vs 3.37166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36833333 vs 3.36833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36500000 vs 3.36500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84500000 vs 3.84500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84166667 vs 3.84166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83833333 vs 3.83833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83500000 vs 3.83500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Evaluate in 2d with polynomial degree 3 +DEAL::Value 2.43500000 vs 2.43500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.43166667 vs 2.43166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42833333 vs 2.42833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42500000 vs 2.42500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90500000 vs 2.90500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90166667 vs 2.90166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89833333 vs 2.89833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89500000 vs 2.89500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37500000 vs 3.37500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37166667 vs 3.37166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36833333 vs 3.36833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36500000 vs 3.36500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84500000 vs 3.84500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84166667 vs 3.84166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83833333 vs 3.83833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83500000 vs 3.83500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Evaluate in 2d with polynomial degree 4 +DEAL::Value 2.43500000 vs 2.43500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.43166667 vs 2.43166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42833333 vs 2.42833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.42500000 vs 2.42500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90500000 vs 2.90500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.90166667 vs 2.90166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89833333 vs 2.89833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 2.89500000 vs 2.89500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37500000 vs 3.37500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.37166667 vs 3.37166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36833333 vs 3.36833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.36500000 vs 3.36500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84500000 vs 3.84500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.84166667 vs 3.84166667 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83833333 vs 3.83833333 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Value 3.83500000 vs 3.83500000 ; gradient -0.0100000000 1.41000000 vs -0.0100000000 1.41000000 +DEAL::Evaluate in 3d with polynomial degree 1 +DEAL::Value 11.8779750 vs 11.8779750 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 12.2705731 vs 12.2705731 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.3559917 vs 13.3559917 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.7485898 vs 13.7485898 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.4414102 vs 14.4414102 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.8340083 vs 14.8340083 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 15.9194269 vs 15.9194269 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 16.3120250 vs 16.3120250 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Evaluate d-linear shortcut in 3d +DEAL::Value 11.8779750 vs 11.8779750 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 12.2705731 vs 12.2705731 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.3559917 vs 13.3559917 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.7485898 vs 13.7485898 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.4414102 vs 14.4414102 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.8340083 vs 14.8340083 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 15.9194269 vs 15.9194269 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 16.3120250 vs 16.3120250 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Evaluate in 3d with polynomial degree 2 +DEAL::Value 11.8779750 vs 11.8779750 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 12.2705731 vs 12.2705731 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.3559917 vs 13.3559917 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.7485898 vs 13.7485898 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.4414102 vs 14.4414102 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.8340083 vs 14.8340083 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 15.9194269 vs 15.9194269 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 16.3120250 vs 16.3120250 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Evaluate in 3d with polynomial degree 3 +DEAL::Value 11.8779750 vs 11.8779750 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 12.2705731 vs 12.2705731 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.3559917 vs 13.3559917 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.7485898 vs 13.7485898 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.4414102 vs 14.4414102 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.8340083 vs 14.8340083 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 15.9194269 vs 15.9194269 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 16.3120250 vs 16.3120250 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Evaluate in 3d with polynomial degree 4 +DEAL::Value 11.8779750 vs 11.8779750 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 12.2705731 vs 12.2705731 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.3559917 vs 13.3559917 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 13.7485898 vs 13.7485898 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.4414102 vs 14.4414102 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 14.8340083 vs 14.8340083 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 15.9194269 vs 15.9194269 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 +DEAL::Value 16.3120250 vs 16.3120250 ; gradient 0.680000000 2.56000000 4.44000000 vs 0.680000000 2.56000000 4.44000000 diff --git a/tests/matrix_free/tensor_product_evaluate_02.cc b/tests/matrix_free/tensor_product_evaluate_02.cc new file mode 100644 index 0000000000..34effebf09 --- /dev/null +++ b/tests/matrix_free/tensor_product_evaluate_02.cc @@ -0,0 +1,106 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2020 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 point-wise evaluation of functions with +// evaluate_tensor_product_value_and_gradient for a vector-valued function +// represented by a linear function and comparing to the analytical value + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "../tests.h" + +template +void +test(const unsigned int degree) +{ + FE_Q fe(degree); + + Tensor<2, dim> matrix = unit_symmetric_tensor(); + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < dim; ++e) + matrix[d][e] += 0.1 * (d + 1 + 2 * e); + Tensor<1, dim> offset; + for (unsigned int d = 0; d < dim; ++d) + offset[d] = 2 + 0.7 * d; + + std::vector> coefficients(fe.dofs_per_cell); + for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + coefficients[i] = matrix * fe.get_unit_support_points()[i] + offset; + + const std::vector> polynomials = + Polynomials::generate_complete_Lagrange_basis( + QGaussLobatto<1>(degree + 1).get_points()); + + const std::vector renumbering = + FETools::lexicographic_to_hierarchic_numbering(degree); + + const std::vector> evaluation_points = + dim == 3 ? QGauss(2).get_points() : + QIterated(QTrapez<1>(), 3).get_points(); + + deallog << "Evaluate in " << dim << "d with polynomial degree " << degree + << std::endl; + for (const auto &p : evaluation_points) + { + const auto val = internal::evaluate_tensor_product_value_and_gradient( + polynomials, coefficients, p, false, renumbering); + deallog << "Value " << val.first << " vs " << matrix * p + offset + << std::endl; + deallog << "Gradient " << val.second << " vs " << transpose(matrix) + << std::endl; + } + + if (degree == 1) + { + deallog << "Evaluate d-linear shortcut in " << dim << "d" << std::endl; + for (const auto &p : evaluation_points) + { + const auto val = internal::evaluate_tensor_product_value_and_gradient( + polynomials, coefficients, p, true, renumbering); + deallog << "Value " << val.first << " vs " << matrix * p + offset + << std::endl; + deallog << "Gradient " << val.second << " vs " << transpose(matrix) + << std::endl; + } + } +} + + + +int +main() +{ + initlog(); + deallog << std::setprecision(9); + + for (unsigned int degree = 1; degree < 5; ++degree) + test<1>(degree); + for (unsigned int degree = 1; degree < 5; ++degree) + test<2>(degree); + for (unsigned int degree = 1; degree < 5; ++degree) + test<3>(degree); +} diff --git a/tests/matrix_free/tensor_product_evaluate_02.output b/tests/matrix_free/tensor_product_evaluate_02.output new file mode 100644 index 0000000000..65d8c5ba31 --- /dev/null +++ b/tests/matrix_free/tensor_product_evaluate_02.output @@ -0,0 +1,296 @@ + +DEAL::Evaluate in 1d with polynomial degree 1 +DEAL::Value 2.00000000 vs 2.00000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.36666667 vs 2.36666667 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.73333333 vs 2.73333333 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 3.10000000 vs 3.10000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Evaluate d-linear shortcut in 1d +DEAL::Value 2.00000000 vs 2.00000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.36666667 vs 2.36666667 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.73333333 vs 2.73333333 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 3.10000000 vs 3.10000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Evaluate in 1d with polynomial degree 2 +DEAL::Value 2.00000000 vs 2.00000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.36666667 vs 2.36666667 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.73333333 vs 2.73333333 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 3.10000000 vs 3.10000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Evaluate in 1d with polynomial degree 3 +DEAL::Value 2.00000000 vs 2.00000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.36666667 vs 2.36666667 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.73333333 vs 2.73333333 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 3.10000000 vs 3.10000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Evaluate in 1d with polynomial degree 4 +DEAL::Value 2.00000000 vs 2.00000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.36666667 vs 2.36666667 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 2.73333333 vs 2.73333333 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Value 3.10000000 vs 3.10000000 +DEAL::Gradient 1.10000000 vs 1.10000000 +DEAL::Evaluate in 2d with polynomial degree 1 +DEAL::Value 2.00000000 2.70000000 vs 2.00000000 2.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.36666667 2.76666667 vs 2.36666667 2.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.73333333 2.83333333 vs 2.73333333 2.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.10000000 2.90000000 vs 3.10000000 2.90000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.10000000 3.16666667 vs 2.10000000 3.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.46666667 3.23333333 vs 2.46666667 3.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.83333333 3.30000000 vs 2.83333333 3.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.20000000 3.36666667 vs 3.20000000 3.36666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.20000000 3.63333333 vs 2.20000000 3.63333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.56666667 3.70000000 vs 2.56666667 3.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.93333333 3.76666667 vs 2.93333333 3.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.30000000 3.83333333 vs 3.30000000 3.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.30000000 4.10000000 vs 2.30000000 4.10000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.66666667 4.16666667 vs 2.66666667 4.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.03333333 4.23333333 vs 3.03333333 4.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.40000000 4.30000000 vs 3.40000000 4.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Evaluate d-linear shortcut in 2d +DEAL::Value 2.00000000 2.70000000 vs 2.00000000 2.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.36666667 2.76666667 vs 2.36666667 2.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.73333333 2.83333333 vs 2.73333333 2.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.10000000 2.90000000 vs 3.10000000 2.90000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.10000000 3.16666667 vs 2.10000000 3.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.46666667 3.23333333 vs 2.46666667 3.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.83333333 3.30000000 vs 2.83333333 3.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.20000000 3.36666667 vs 3.20000000 3.36666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.20000000 3.63333333 vs 2.20000000 3.63333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.56666667 3.70000000 vs 2.56666667 3.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.93333333 3.76666667 vs 2.93333333 3.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.30000000 3.83333333 vs 3.30000000 3.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.30000000 4.10000000 vs 2.30000000 4.10000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.66666667 4.16666667 vs 2.66666667 4.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.03333333 4.23333333 vs 3.03333333 4.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.40000000 4.30000000 vs 3.40000000 4.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Evaluate in 2d with polynomial degree 2 +DEAL::Value 2.00000000 2.70000000 vs 2.00000000 2.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.36666667 2.76666667 vs 2.36666667 2.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.73333333 2.83333333 vs 2.73333333 2.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.10000000 2.90000000 vs 3.10000000 2.90000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.10000000 3.16666667 vs 2.10000000 3.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.46666667 3.23333333 vs 2.46666667 3.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.83333333 3.30000000 vs 2.83333333 3.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.20000000 3.36666667 vs 3.20000000 3.36666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.20000000 3.63333333 vs 2.20000000 3.63333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.56666667 3.70000000 vs 2.56666667 3.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.93333333 3.76666667 vs 2.93333333 3.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.30000000 3.83333333 vs 3.30000000 3.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.30000000 4.10000000 vs 2.30000000 4.10000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.66666667 4.16666667 vs 2.66666667 4.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.03333333 4.23333333 vs 3.03333333 4.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.40000000 4.30000000 vs 3.40000000 4.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Evaluate in 2d with polynomial degree 3 +DEAL::Value 2.00000000 2.70000000 vs 2.00000000 2.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.36666667 2.76666667 vs 2.36666667 2.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.73333333 2.83333333 vs 2.73333333 2.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.10000000 2.90000000 vs 3.10000000 2.90000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.10000000 3.16666667 vs 2.10000000 3.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.46666667 3.23333333 vs 2.46666667 3.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.83333333 3.30000000 vs 2.83333333 3.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.20000000 3.36666667 vs 3.20000000 3.36666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.20000000 3.63333333 vs 2.20000000 3.63333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.56666667 3.70000000 vs 2.56666667 3.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.93333333 3.76666667 vs 2.93333333 3.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.30000000 3.83333333 vs 3.30000000 3.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.30000000 4.10000000 vs 2.30000000 4.10000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.66666667 4.16666667 vs 2.66666667 4.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.03333333 4.23333333 vs 3.03333333 4.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.40000000 4.30000000 vs 3.40000000 4.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Evaluate in 2d with polynomial degree 4 +DEAL::Value 2.00000000 2.70000000 vs 2.00000000 2.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.36666667 2.76666667 vs 2.36666667 2.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.73333333 2.83333333 vs 2.73333333 2.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.10000000 2.90000000 vs 3.10000000 2.90000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.10000000 3.16666667 vs 2.10000000 3.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.46666667 3.23333333 vs 2.46666667 3.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.83333333 3.30000000 vs 2.83333333 3.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.20000000 3.36666667 vs 3.20000000 3.36666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.20000000 3.63333333 vs 2.20000000 3.63333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.56666667 3.70000000 vs 2.56666667 3.70000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.93333333 3.76666667 vs 2.93333333 3.76666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.30000000 3.83333333 vs 3.30000000 3.83333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.30000000 4.10000000 vs 2.30000000 4.10000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 2.66666667 4.16666667 vs 2.66666667 4.16666667 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.03333333 4.23333333 vs 3.03333333 4.23333333 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Value 3.40000000 4.30000000 vs 3.40000000 4.30000000 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 1.40000000 vs 1.10000000 0.200000000 0.300000000 1.40000000 +DEAL::Evaluate in 3d with polynomial degree 1 +DEAL::Value 2.40151724 3.16491470 3.92831216 vs 2.40151724 3.16491470 3.92831216 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.03660254 3.28038476 4.10151724 vs 3.03660254 3.28038476 4.10151724 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.57472233 3.97320508 4.21698730 vs 2.57472233 3.97320508 4.21698730 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.20980762 4.08867513 4.39019238 vs 3.20980762 4.08867513 4.39019238 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.69019238 3.51132487 4.90980762 vs 2.69019238 3.51132487 4.90980762 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.32527767 3.62679492 5.08301270 vs 3.32527767 3.62679492 5.08301270 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.86339746 4.31961524 5.19848276 vs 2.86339746 4.31961524 5.19848276 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.49848276 4.43508530 5.37168784 vs 3.49848276 4.43508530 5.37168784 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Evaluate d-linear shortcut in 3d +DEAL::Value 2.40151724 3.16491470 3.92831216 vs 2.40151724 3.16491470 3.92831216 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.03660254 3.28038476 4.10151724 vs 3.03660254 3.28038476 4.10151724 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.57472233 3.97320508 4.21698730 vs 2.57472233 3.97320508 4.21698730 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.20980762 4.08867513 4.39019238 vs 3.20980762 4.08867513 4.39019238 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.69019238 3.51132487 4.90980762 vs 2.69019238 3.51132487 4.90980762 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.32527767 3.62679492 5.08301270 vs 3.32527767 3.62679492 5.08301270 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.86339746 4.31961524 5.19848276 vs 2.86339746 4.31961524 5.19848276 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.49848276 4.43508530 5.37168784 vs 3.49848276 4.43508530 5.37168784 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Evaluate in 3d with polynomial degree 2 +DEAL::Value 2.40151724 3.16491470 3.92831216 vs 2.40151724 3.16491470 3.92831216 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.03660254 3.28038476 4.10151724 vs 3.03660254 3.28038476 4.10151724 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.57472233 3.97320508 4.21698730 vs 2.57472233 3.97320508 4.21698730 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.20980762 4.08867513 4.39019238 vs 3.20980762 4.08867513 4.39019238 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.69019238 3.51132487 4.90980762 vs 2.69019238 3.51132487 4.90980762 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.32527767 3.62679492 5.08301270 vs 3.32527767 3.62679492 5.08301270 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.86339746 4.31961524 5.19848276 vs 2.86339746 4.31961524 5.19848276 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.49848276 4.43508530 5.37168784 vs 3.49848276 4.43508530 5.37168784 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Evaluate in 3d with polynomial degree 3 +DEAL::Value 2.40151724 3.16491470 3.92831216 vs 2.40151724 3.16491470 3.92831216 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.03660254 3.28038476 4.10151724 vs 3.03660254 3.28038476 4.10151724 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.57472233 3.97320508 4.21698730 vs 2.57472233 3.97320508 4.21698730 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.20980762 4.08867513 4.39019238 vs 3.20980762 4.08867513 4.39019238 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.69019238 3.51132487 4.90980762 vs 2.69019238 3.51132487 4.90980762 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.32527767 3.62679492 5.08301270 vs 3.32527767 3.62679492 5.08301270 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.86339746 4.31961524 5.19848276 vs 2.86339746 4.31961524 5.19848276 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.49848276 4.43508530 5.37168784 vs 3.49848276 4.43508530 5.37168784 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Evaluate in 3d with polynomial degree 4 +DEAL::Value 2.40151724 3.16491470 3.92831216 vs 2.40151724 3.16491470 3.92831216 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.03660254 3.28038476 4.10151724 vs 3.03660254 3.28038476 4.10151724 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.57472233 3.97320508 4.21698730 vs 2.57472233 3.97320508 4.21698730 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.20980762 4.08867513 4.39019238 vs 3.20980762 4.08867513 4.39019238 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.69019238 3.51132487 4.90980762 vs 2.69019238 3.51132487 4.90980762 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.32527767 3.62679492 5.08301270 vs 3.32527767 3.62679492 5.08301270 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 2.86339746 4.31961524 5.19848276 vs 2.86339746 4.31961524 5.19848276 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 +DEAL::Value 3.49848276 4.43508530 5.37168784 vs 3.49848276 4.43508530 5.37168784 +DEAL::Gradient 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 vs 1.10000000 0.200000000 0.300000000 0.300000000 1.40000000 0.500000000 0.500000000 0.600000000 1.70000000 diff --git a/tests/matrix_free/tensor_product_evaluate_03.cc b/tests/matrix_free/tensor_product_evaluate_03.cc new file mode 100644 index 0000000000..908cc45bd7 --- /dev/null +++ b/tests/matrix_free/tensor_product_evaluate_03.cc @@ -0,0 +1,137 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2020 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 point-wise evaluation of functions with +// evaluate_tensor_product_value_and_gradient for a vector-valued function +// represented by a linear function with vectorized data types + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "../tests.h" + +template +void +test(const unsigned int degree) +{ + FE_Q fe(degree); + + Tensor<2, dim> matrix = unit_symmetric_tensor(); + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < dim; ++e) + matrix[d][e] += 0.1 * (d + 1 + 2 * e); + Tensor<1, dim> offset; + for (unsigned int d = 0; d < dim; ++d) + offset[d] = 2 + 0.7 * d; + + std::vector> coefficients(fe.dofs_per_cell); + for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + coefficients[i] = matrix * fe.get_unit_support_points()[i] + offset; + + const std::vector> polynomials = + Polynomials::generate_complete_Lagrange_basis( + QGaussLobatto<1>(degree + 1).get_points()); + + const std::vector renumbering = + FETools::lexicographic_to_hierarchic_numbering(degree); + + const std::vector> evaluation_points = + dim == 3 ? QGauss(2).get_points() : + QIterated(QTrapez<1>(), 3).get_points(); + + deallog << "Evaluate in " << dim << "d with polynomial degree " << degree + << std::endl; + for (const auto &p : evaluation_points) + { + Point> p_vec; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + p_vec[d][v] = p[d] + 0.01 * v; + + const auto val = internal::evaluate_tensor_product_value_and_gradient( + polynomials, coefficients, p_vec, false, renumbering); + + const auto error_vec = val.first - matrix * p_vec; + double error = 0; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + error += std::abs(error_vec[d][v] - offset[d]); + double gradient_error = 0; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < dim; ++e) + gradient_error += std::abs(val.second[d][e][v] - matrix[e][d]); + + deallog << "Value error " << error << " , gradient error " + << gradient_error << std::endl; + } + + if (degree == 1) + { + deallog << "Evaluate d-linear shortcut in " << dim << "d" << std::endl; + for (const auto &p : evaluation_points) + { + Point> p_vec; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + p_vec[d][v] = p[d] + 0.01 * v; + + const auto val = internal::evaluate_tensor_product_value_and_gradient( + polynomials, coefficients, p_vec, true, renumbering); + + const auto error_vec = val.first - matrix * p_vec; + double error = 0; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + error += std::abs(error_vec[d][v] - offset[d]); + double gradient_error = 0; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < dim; ++e) + gradient_error += std::abs(val.second[d][e][v] - matrix[e][d]); + + deallog << "Value error " << error << " , gradient error " + << gradient_error << std::endl; + } + } +} + + + +int +main() +{ + initlog(); + deallog << std::setprecision(9); + + for (unsigned int degree = 1; degree < 5; ++degree) + test<1>(degree); + for (unsigned int degree = 1; degree < 5; ++degree) + test<2>(degree); + for (unsigned int degree = 1; degree < 5; ++degree) + test<3>(degree); +} diff --git a/tests/matrix_free/tensor_product_evaluate_03.output b/tests/matrix_free/tensor_product_evaluate_03.output new file mode 100644 index 0000000000..cfb70be8c1 --- /dev/null +++ b/tests/matrix_free/tensor_product_evaluate_03.output @@ -0,0 +1,156 @@ + +DEAL::Evaluate in 1d with polynomial degree 1 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Value error 4.44089210e-16 , gradient error 0.00000000 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Evaluate d-linear shortcut in 1d +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Value error 4.44089210e-16 , gradient error 0.00000000 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Evaluate in 1d with polynomial degree 2 +DEAL::Value error 4.44089210e-16 , gradient error 2.66453526e-15 +DEAL::Value error 6.66133815e-16 , gradient error 2.22044605e-16 +DEAL::Value error 6.66133815e-16 , gradient error 1.77635684e-15 +DEAL::Value error 2.22044605e-16 , gradient error 5.32907052e-15 +DEAL::Evaluate in 1d with polynomial degree 3 +DEAL::Value error 1.11022302e-15 , gradient error 1.64313008e-14 +DEAL::Value error 8.88178420e-16 , gradient error 1.77635684e-15 +DEAL::Value error 8.88178420e-16 , gradient error 3.99680289e-15 +DEAL::Value error 4.44089210e-16 , gradient error 2.66453526e-14 +DEAL::Evaluate in 1d with polynomial degree 4 +DEAL::Value error 8.88178420e-16 , gradient error 1.08801856e-14 +DEAL::Value error 1.77635684e-15 , gradient error 5.10702591e-15 +DEAL::Value error 1.55431223e-15 , gradient error 7.10542736e-15 +DEAL::Value error 1.77635684e-15 , gradient error 2.66453526e-14 +DEAL::Evaluate in 2d with polynomial degree 1 +DEAL::Value error 1.55431223e-15 , gradient error 4.21884749e-15 +DEAL::Value error 2.22044605e-16 , gradient error 4.21884749e-15 +DEAL::Value error 8.88178420e-16 , gradient error 4.21884749e-15 +DEAL::Value error 6.66133815e-16 , gradient error 3.77475828e-15 +DEAL::Value error 6.66133815e-16 , gradient error 4.66293670e-15 +DEAL::Value error 1.77635684e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.33226763e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.99840144e-15 , gradient error 4.21884749e-15 +DEAL::Value error 1.77635684e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.55431223e-15 , gradient error 4.66293670e-15 +DEAL::Value error 2.44249065e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.33226763e-15 , gradient error 4.21884749e-15 +DEAL::Value error 3.33066907e-15 , gradient error 5.55111512e-15 +DEAL::Value error 2.22044605e-15 , gradient error 5.55111512e-15 +DEAL::Value error 1.99840144e-15 , gradient error 5.55111512e-15 +DEAL::Value error 1.77635684e-15 , gradient error 5.10702591e-15 +DEAL::Evaluate d-linear shortcut in 2d +DEAL::Value error 1.55431223e-15 , gradient error 4.21884749e-15 +DEAL::Value error 2.22044605e-16 , gradient error 4.21884749e-15 +DEAL::Value error 8.88178420e-16 , gradient error 4.21884749e-15 +DEAL::Value error 6.66133815e-16 , gradient error 3.77475828e-15 +DEAL::Value error 6.66133815e-16 , gradient error 4.66293670e-15 +DEAL::Value error 1.77635684e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.33226763e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.99840144e-15 , gradient error 4.21884749e-15 +DEAL::Value error 1.77635684e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.55431223e-15 , gradient error 4.66293670e-15 +DEAL::Value error 2.44249065e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.33226763e-15 , gradient error 4.21884749e-15 +DEAL::Value error 3.33066907e-15 , gradient error 5.55111512e-15 +DEAL::Value error 2.22044605e-15 , gradient error 5.55111512e-15 +DEAL::Value error 1.99840144e-15 , gradient error 5.55111512e-15 +DEAL::Value error 1.77635684e-15 , gradient error 5.10702591e-15 +DEAL::Evaluate in 2d with polynomial degree 2 +DEAL::Value error 2.22044605e-15 , gradient error 9.65894031e-15 +DEAL::Value error 6.66133815e-16 , gradient error 1.46271883e-14 +DEAL::Value error 2.22044605e-15 , gradient error 1.23234756e-14 +DEAL::Value error 1.55431223e-15 , gradient error 1.75415238e-14 +DEAL::Value error 1.33226763e-15 , gradient error 1.01030295e-14 +DEAL::Value error 3.55271368e-15 , gradient error 6.91113833e-15 +DEAL::Value error 2.22044605e-15 , gradient error 9.29811783e-15 +DEAL::Value error 3.10862447e-15 , gradient error 1.09079412e-14 +DEAL::Value error 2.44249065e-15 , gradient error 1.38500322e-14 +DEAL::Value error 2.22044605e-15 , gradient error 7.99360578e-15 +DEAL::Value error 1.33226763e-15 , gradient error 1.02973186e-14 +DEAL::Value error 3.10862447e-15 , gradient error 9.27036226e-15 +DEAL::Value error 5.32907052e-15 , gradient error 2.32591724e-14 +DEAL::Value error 1.11022302e-15 , gradient error 1.20181642e-14 +DEAL::Value error 3.33066907e-15 , gradient error 1.64868119e-14 +DEAL::Value error 3.33066907e-15 , gradient error 2.72282197e-14 +DEAL::Evaluate in 2d with polynomial degree 3 +DEAL::Value error 5.32907052e-15 , gradient error 6.20614671e-14 +DEAL::Value error 1.99840144e-15 , gradient error 5.44286838e-14 +DEAL::Value error 5.32907052e-15 , gradient error 6.64190924e-14 +DEAL::Value error 3.10862447e-15 , gradient error 8.79851747e-14 +DEAL::Value error 2.44249065e-15 , gradient error 5.07927034e-14 +DEAL::Value error 7.10542736e-15 , gradient error 1.16850973e-14 +DEAL::Value error 3.99680289e-15 , gradient error 1.24622535e-14 +DEAL::Value error 4.21884749e-15 , gradient error 8.30446822e-14 +DEAL::Value error 2.22044605e-15 , gradient error 7.99915689e-14 +DEAL::Value error 6.66133815e-15 , gradient error 1.99285033e-14 +DEAL::Value error 2.22044605e-15 , gradient error 1.63480340e-14 +DEAL::Value error 3.10862447e-15 , gradient error 1.11577414e-13 +DEAL::Value error 7.54951657e-15 , gradient error 1.08912879e-13 +DEAL::Value error 4.44089210e-15 , gradient error 6.30884234e-14 +DEAL::Value error 6.66133815e-15 , gradient error 1.01835207e-13 +DEAL::Value error 4.44089210e-15 , gradient error 1.10522702e-13 +DEAL::Evaluate in 2d with polynomial degree 4 +DEAL::Value error 3.99680289e-15 , gradient error 6.13675777e-14 +DEAL::Value error 3.77475828e-15 , gradient error 6.25888230e-14 +DEAL::Value error 2.66453526e-15 , gradient error 7.74658115e-14 +DEAL::Value error 4.44089210e-15 , gradient error 8.65973959e-14 +DEAL::Value error 3.77475828e-15 , gradient error 4.48252546e-14 +DEAL::Value error 1.02140518e-14 , gradient error 3.19466675e-14 +DEAL::Value error 4.88498131e-15 , gradient error 5.03208586e-14 +DEAL::Value error 5.55111512e-15 , gradient error 6.98052727e-14 +DEAL::Value error 4.44089210e-15 , gradient error 5.92026428e-14 +DEAL::Value error 4.44089210e-15 , gradient error 4.30766534e-14 +DEAL::Value error 3.99680289e-15 , gradient error 5.62050406e-14 +DEAL::Value error 2.22044605e-15 , gradient error 8.15736367e-14 +DEAL::Value error 4.44089210e-15 , gradient error 1.41248124e-13 +DEAL::Value error 6.66133815e-15 , gradient error 7.69939668e-14 +DEAL::Value error 4.44089210e-15 , gradient error 1.48603352e-13 +DEAL::Value error 6.66133815e-15 , gradient error 1.47271084e-13 +DEAL::Evaluate in 3d with polynomial degree 1 +DEAL::Value error 5.99520433e-15 , gradient error 9.27036226e-15 +DEAL::Value error 2.88657986e-15 , gradient error 1.02695630e-14 +DEAL::Value error 5.55111512e-15 , gradient error 1.12687637e-14 +DEAL::Value error 4.88498131e-15 , gradient error 9.60342916e-15 +DEAL::Value error 7.54951657e-15 , gradient error 1.04083409e-14 +DEAL::Value error 2.66453526e-15 , gradient error 1.07969189e-14 +DEAL::Value error 5.55111512e-15 , gradient error 1.21846977e-14 +DEAL::Value error 4.21884749e-15 , gradient error 9.90874049e-15 +DEAL::Evaluate d-linear shortcut in 3d +DEAL::Value error 5.99520433e-15 , gradient error 9.27036226e-15 +DEAL::Value error 2.88657986e-15 , gradient error 1.02695630e-14 +DEAL::Value error 5.55111512e-15 , gradient error 1.12687637e-14 +DEAL::Value error 4.88498131e-15 , gradient error 9.60342916e-15 +DEAL::Value error 7.54951657e-15 , gradient error 1.04083409e-14 +DEAL::Value error 2.66453526e-15 , gradient error 1.07969189e-14 +DEAL::Value error 5.55111512e-15 , gradient error 1.21846977e-14 +DEAL::Value error 4.21884749e-15 , gradient error 9.90874049e-15 +DEAL::Evaluate in 3d with polynomial degree 2 +DEAL::Value error 5.99520433e-15 , gradient error 2.73947531e-14 +DEAL::Value error 5.99520433e-15 , gradient error 2.94764213e-14 +DEAL::Value error 5.55111512e-15 , gradient error 2.58681965e-14 +DEAL::Value error 3.55271368e-15 , gradient error 3.04478665e-14 +DEAL::Value error 7.32747196e-15 , gradient error 3.69704267e-14 +DEAL::Value error 3.77475828e-15 , gradient error 3.39173134e-14 +DEAL::Value error 3.33066907e-15 , gradient error 4.14390744e-14 +DEAL::Value error 5.77315973e-15 , gradient error 3.51108032e-14 +DEAL::Evaluate in 3d with polynomial degree 3 +DEAL::Value error 9.32587341e-15 , gradient error 5.29853939e-14 +DEAL::Value error 1.24344979e-14 , gradient error 4.81281681e-14 +DEAL::Value error 1.11022302e-14 , gradient error 7.01383396e-14 +DEAL::Value error 1.86517468e-14 , gradient error 5.53723734e-14 +DEAL::Value error 1.08801856e-14 , gradient error 5.74817971e-14 +DEAL::Value error 1.86517468e-14 , gradient error 6.38378239e-14 +DEAL::Value error 1.13242749e-14 , gradient error 6.07014439e-14 +DEAL::Value error 2.90878432e-14 , gradient error 6.61970478e-14 +DEAL::Evaluate in 3d with polynomial degree 4 +DEAL::Value error 9.76996262e-15 , gradient error 9.72555370e-14 +DEAL::Value error 5.77315973e-15 , gradient error 1.07552856e-13 +DEAL::Value error 7.54951657e-15 , gradient error 1.25399691e-13 +DEAL::Value error 7.32747196e-15 , gradient error 1.04943831e-13 +DEAL::Value error 8.43769499e-15 , gradient error 1.16739951e-13 +DEAL::Value error 6.66133815e-15 , gradient error 1.23123733e-13 +DEAL::Value error 7.54951657e-15 , gradient error 1.46632706e-13 +DEAL::Value error 1.88737914e-14 , gradient error 1.28480560e-13 diff --git a/tests/matrix_free/tensor_product_evaluate_04.cc b/tests/matrix_free/tensor_product_evaluate_04.cc new file mode 100644 index 0000000000..506f1d36c6 --- /dev/null +++ b/tests/matrix_free/tensor_product_evaluate_04.cc @@ -0,0 +1,134 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2020 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 point-wise evaluation of functions with +// evaluate_tensor_product_value_and_gradient for a vector-valued function +// represented by a linear function with vectorized data types and no +// renumbering (FE_DGQ) + +#include +#include +#include +#include +#include + +#include + +#include + +#include + +#include "../tests.h" + +template +void +test(const unsigned int degree) +{ + FE_DGQ fe(degree); + + Tensor<2, dim> matrix = unit_symmetric_tensor(); + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < dim; ++e) + matrix[d][e] += 0.1 * (d + 1 + 2 * e); + Tensor<1, dim> offset; + for (unsigned int d = 0; d < dim; ++d) + offset[d] = 2 + 0.7 * d; + + std::vector> coefficients(fe.dofs_per_cell); + for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + coefficients[i] = matrix * fe.get_unit_support_points()[i] + offset; + + const std::vector> polynomials = + Polynomials::generate_complete_Lagrange_basis( + QGaussLobatto<1>(degree + 1).get_points()); + + const std::vector> evaluation_points = + dim == 3 ? QGauss(2).get_points() : + QIterated(QTrapez<1>(), 3).get_points(); + + deallog << "Evaluate in " << dim << "d with polynomial degree " << degree + << std::endl; + for (const auto &p : evaluation_points) + { + Point> p_vec; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + p_vec[d][v] = p[d] + 0.01 * v; + + const auto val = internal::evaluate_tensor_product_value_and_gradient( + polynomials, coefficients, p_vec, false); + + const auto error_vec = val.first - matrix * p_vec; + double error = 0; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + error += std::abs(error_vec[d][v] - offset[d]); + double gradient_error = 0; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < dim; ++e) + gradient_error += std::abs(val.second[d][e][v] - matrix[e][d]); + + deallog << "Value error " << error << " , gradient error " + << gradient_error << std::endl; + } + + if (degree == 1) + { + deallog << "Evaluate d-linear shortcut in " << dim << "d" << std::endl; + for (const auto &p : evaluation_points) + { + Point> p_vec; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + p_vec[d][v] = p[d] + 0.01 * v; + + const auto val = internal::evaluate_tensor_product_value_and_gradient( + polynomials, coefficients, p_vec, true); + + const auto error_vec = val.first - matrix * p_vec; + double error = 0; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + error += std::abs(error_vec[d][v] - offset[d]); + double gradient_error = 0; + for (unsigned int v = 0; v < VectorizedArray::size(); ++v) + for (unsigned int d = 0; d < dim; ++d) + for (unsigned int e = 0; e < dim; ++e) + gradient_error += std::abs(val.second[d][e][v] - matrix[e][d]); + + deallog << "Value error " << error << " , gradient error " + << gradient_error << std::endl; + } + } +} + + + +int +main() +{ + initlog(); + deallog << std::setprecision(9); + + for (unsigned int degree = 1; degree < 5; ++degree) + test<1>(degree); + for (unsigned int degree = 1; degree < 5; ++degree) + test<2>(degree); + for (unsigned int degree = 1; degree < 5; ++degree) + test<3>(degree); +} diff --git a/tests/matrix_free/tensor_product_evaluate_04.output b/tests/matrix_free/tensor_product_evaluate_04.output new file mode 100644 index 0000000000..cfb70be8c1 --- /dev/null +++ b/tests/matrix_free/tensor_product_evaluate_04.output @@ -0,0 +1,156 @@ + +DEAL::Evaluate in 1d with polynomial degree 1 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Value error 4.44089210e-16 , gradient error 0.00000000 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Evaluate d-linear shortcut in 1d +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Value error 4.44089210e-16 , gradient error 0.00000000 +DEAL::Value error 2.22044605e-16 , gradient error 0.00000000 +DEAL::Evaluate in 1d with polynomial degree 2 +DEAL::Value error 4.44089210e-16 , gradient error 2.66453526e-15 +DEAL::Value error 6.66133815e-16 , gradient error 2.22044605e-16 +DEAL::Value error 6.66133815e-16 , gradient error 1.77635684e-15 +DEAL::Value error 2.22044605e-16 , gradient error 5.32907052e-15 +DEAL::Evaluate in 1d with polynomial degree 3 +DEAL::Value error 1.11022302e-15 , gradient error 1.64313008e-14 +DEAL::Value error 8.88178420e-16 , gradient error 1.77635684e-15 +DEAL::Value error 8.88178420e-16 , gradient error 3.99680289e-15 +DEAL::Value error 4.44089210e-16 , gradient error 2.66453526e-14 +DEAL::Evaluate in 1d with polynomial degree 4 +DEAL::Value error 8.88178420e-16 , gradient error 1.08801856e-14 +DEAL::Value error 1.77635684e-15 , gradient error 5.10702591e-15 +DEAL::Value error 1.55431223e-15 , gradient error 7.10542736e-15 +DEAL::Value error 1.77635684e-15 , gradient error 2.66453526e-14 +DEAL::Evaluate in 2d with polynomial degree 1 +DEAL::Value error 1.55431223e-15 , gradient error 4.21884749e-15 +DEAL::Value error 2.22044605e-16 , gradient error 4.21884749e-15 +DEAL::Value error 8.88178420e-16 , gradient error 4.21884749e-15 +DEAL::Value error 6.66133815e-16 , gradient error 3.77475828e-15 +DEAL::Value error 6.66133815e-16 , gradient error 4.66293670e-15 +DEAL::Value error 1.77635684e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.33226763e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.99840144e-15 , gradient error 4.21884749e-15 +DEAL::Value error 1.77635684e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.55431223e-15 , gradient error 4.66293670e-15 +DEAL::Value error 2.44249065e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.33226763e-15 , gradient error 4.21884749e-15 +DEAL::Value error 3.33066907e-15 , gradient error 5.55111512e-15 +DEAL::Value error 2.22044605e-15 , gradient error 5.55111512e-15 +DEAL::Value error 1.99840144e-15 , gradient error 5.55111512e-15 +DEAL::Value error 1.77635684e-15 , gradient error 5.10702591e-15 +DEAL::Evaluate d-linear shortcut in 2d +DEAL::Value error 1.55431223e-15 , gradient error 4.21884749e-15 +DEAL::Value error 2.22044605e-16 , gradient error 4.21884749e-15 +DEAL::Value error 8.88178420e-16 , gradient error 4.21884749e-15 +DEAL::Value error 6.66133815e-16 , gradient error 3.77475828e-15 +DEAL::Value error 6.66133815e-16 , gradient error 4.66293670e-15 +DEAL::Value error 1.77635684e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.33226763e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.99840144e-15 , gradient error 4.21884749e-15 +DEAL::Value error 1.77635684e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.55431223e-15 , gradient error 4.66293670e-15 +DEAL::Value error 2.44249065e-15 , gradient error 4.66293670e-15 +DEAL::Value error 1.33226763e-15 , gradient error 4.21884749e-15 +DEAL::Value error 3.33066907e-15 , gradient error 5.55111512e-15 +DEAL::Value error 2.22044605e-15 , gradient error 5.55111512e-15 +DEAL::Value error 1.99840144e-15 , gradient error 5.55111512e-15 +DEAL::Value error 1.77635684e-15 , gradient error 5.10702591e-15 +DEAL::Evaluate in 2d with polynomial degree 2 +DEAL::Value error 2.22044605e-15 , gradient error 9.65894031e-15 +DEAL::Value error 6.66133815e-16 , gradient error 1.46271883e-14 +DEAL::Value error 2.22044605e-15 , gradient error 1.23234756e-14 +DEAL::Value error 1.55431223e-15 , gradient error 1.75415238e-14 +DEAL::Value error 1.33226763e-15 , gradient error 1.01030295e-14 +DEAL::Value error 3.55271368e-15 , gradient error 6.91113833e-15 +DEAL::Value error 2.22044605e-15 , gradient error 9.29811783e-15 +DEAL::Value error 3.10862447e-15 , gradient error 1.09079412e-14 +DEAL::Value error 2.44249065e-15 , gradient error 1.38500322e-14 +DEAL::Value error 2.22044605e-15 , gradient error 7.99360578e-15 +DEAL::Value error 1.33226763e-15 , gradient error 1.02973186e-14 +DEAL::Value error 3.10862447e-15 , gradient error 9.27036226e-15 +DEAL::Value error 5.32907052e-15 , gradient error 2.32591724e-14 +DEAL::Value error 1.11022302e-15 , gradient error 1.20181642e-14 +DEAL::Value error 3.33066907e-15 , gradient error 1.64868119e-14 +DEAL::Value error 3.33066907e-15 , gradient error 2.72282197e-14 +DEAL::Evaluate in 2d with polynomial degree 3 +DEAL::Value error 5.32907052e-15 , gradient error 6.20614671e-14 +DEAL::Value error 1.99840144e-15 , gradient error 5.44286838e-14 +DEAL::Value error 5.32907052e-15 , gradient error 6.64190924e-14 +DEAL::Value error 3.10862447e-15 , gradient error 8.79851747e-14 +DEAL::Value error 2.44249065e-15 , gradient error 5.07927034e-14 +DEAL::Value error 7.10542736e-15 , gradient error 1.16850973e-14 +DEAL::Value error 3.99680289e-15 , gradient error 1.24622535e-14 +DEAL::Value error 4.21884749e-15 , gradient error 8.30446822e-14 +DEAL::Value error 2.22044605e-15 , gradient error 7.99915689e-14 +DEAL::Value error 6.66133815e-15 , gradient error 1.99285033e-14 +DEAL::Value error 2.22044605e-15 , gradient error 1.63480340e-14 +DEAL::Value error 3.10862447e-15 , gradient error 1.11577414e-13 +DEAL::Value error 7.54951657e-15 , gradient error 1.08912879e-13 +DEAL::Value error 4.44089210e-15 , gradient error 6.30884234e-14 +DEAL::Value error 6.66133815e-15 , gradient error 1.01835207e-13 +DEAL::Value error 4.44089210e-15 , gradient error 1.10522702e-13 +DEAL::Evaluate in 2d with polynomial degree 4 +DEAL::Value error 3.99680289e-15 , gradient error 6.13675777e-14 +DEAL::Value error 3.77475828e-15 , gradient error 6.25888230e-14 +DEAL::Value error 2.66453526e-15 , gradient error 7.74658115e-14 +DEAL::Value error 4.44089210e-15 , gradient error 8.65973959e-14 +DEAL::Value error 3.77475828e-15 , gradient error 4.48252546e-14 +DEAL::Value error 1.02140518e-14 , gradient error 3.19466675e-14 +DEAL::Value error 4.88498131e-15 , gradient error 5.03208586e-14 +DEAL::Value error 5.55111512e-15 , gradient error 6.98052727e-14 +DEAL::Value error 4.44089210e-15 , gradient error 5.92026428e-14 +DEAL::Value error 4.44089210e-15 , gradient error 4.30766534e-14 +DEAL::Value error 3.99680289e-15 , gradient error 5.62050406e-14 +DEAL::Value error 2.22044605e-15 , gradient error 8.15736367e-14 +DEAL::Value error 4.44089210e-15 , gradient error 1.41248124e-13 +DEAL::Value error 6.66133815e-15 , gradient error 7.69939668e-14 +DEAL::Value error 4.44089210e-15 , gradient error 1.48603352e-13 +DEAL::Value error 6.66133815e-15 , gradient error 1.47271084e-13 +DEAL::Evaluate in 3d with polynomial degree 1 +DEAL::Value error 5.99520433e-15 , gradient error 9.27036226e-15 +DEAL::Value error 2.88657986e-15 , gradient error 1.02695630e-14 +DEAL::Value error 5.55111512e-15 , gradient error 1.12687637e-14 +DEAL::Value error 4.88498131e-15 , gradient error 9.60342916e-15 +DEAL::Value error 7.54951657e-15 , gradient error 1.04083409e-14 +DEAL::Value error 2.66453526e-15 , gradient error 1.07969189e-14 +DEAL::Value error 5.55111512e-15 , gradient error 1.21846977e-14 +DEAL::Value error 4.21884749e-15 , gradient error 9.90874049e-15 +DEAL::Evaluate d-linear shortcut in 3d +DEAL::Value error 5.99520433e-15 , gradient error 9.27036226e-15 +DEAL::Value error 2.88657986e-15 , gradient error 1.02695630e-14 +DEAL::Value error 5.55111512e-15 , gradient error 1.12687637e-14 +DEAL::Value error 4.88498131e-15 , gradient error 9.60342916e-15 +DEAL::Value error 7.54951657e-15 , gradient error 1.04083409e-14 +DEAL::Value error 2.66453526e-15 , gradient error 1.07969189e-14 +DEAL::Value error 5.55111512e-15 , gradient error 1.21846977e-14 +DEAL::Value error 4.21884749e-15 , gradient error 9.90874049e-15 +DEAL::Evaluate in 3d with polynomial degree 2 +DEAL::Value error 5.99520433e-15 , gradient error 2.73947531e-14 +DEAL::Value error 5.99520433e-15 , gradient error 2.94764213e-14 +DEAL::Value error 5.55111512e-15 , gradient error 2.58681965e-14 +DEAL::Value error 3.55271368e-15 , gradient error 3.04478665e-14 +DEAL::Value error 7.32747196e-15 , gradient error 3.69704267e-14 +DEAL::Value error 3.77475828e-15 , gradient error 3.39173134e-14 +DEAL::Value error 3.33066907e-15 , gradient error 4.14390744e-14 +DEAL::Value error 5.77315973e-15 , gradient error 3.51108032e-14 +DEAL::Evaluate in 3d with polynomial degree 3 +DEAL::Value error 9.32587341e-15 , gradient error 5.29853939e-14 +DEAL::Value error 1.24344979e-14 , gradient error 4.81281681e-14 +DEAL::Value error 1.11022302e-14 , gradient error 7.01383396e-14 +DEAL::Value error 1.86517468e-14 , gradient error 5.53723734e-14 +DEAL::Value error 1.08801856e-14 , gradient error 5.74817971e-14 +DEAL::Value error 1.86517468e-14 , gradient error 6.38378239e-14 +DEAL::Value error 1.13242749e-14 , gradient error 6.07014439e-14 +DEAL::Value error 2.90878432e-14 , gradient error 6.61970478e-14 +DEAL::Evaluate in 3d with polynomial degree 4 +DEAL::Value error 9.76996262e-15 , gradient error 9.72555370e-14 +DEAL::Value error 5.77315973e-15 , gradient error 1.07552856e-13 +DEAL::Value error 7.54951657e-15 , gradient error 1.25399691e-13 +DEAL::Value error 7.32747196e-15 , gradient error 1.04943831e-13 +DEAL::Value error 8.43769499e-15 , gradient error 1.16739951e-13 +DEAL::Value error 6.66133815e-15 , gradient error 1.23123733e-13 +DEAL::Value error 7.54951657e-15 , gradient error 1.46632706e-13 +DEAL::Value error 1.88737914e-14 , gradient error 1.28480560e-13