--- /dev/null
+// ---------------------------------------------------------------------
+//
+// 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.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Check the CellSimilarity with MappingFEField - since the field can be
+// arbitrarily deformed, we should not get any similarity.
+
+#include <deal.II/base/multithread_info.h>
+#include <deal.II/base/quadrature_lib.h>
+
+#include <deal.II/dofs/dof_handler.h>
+
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/mapping_fe_field.h>
+
+#include <deal.II/grid/grid_generator.h>
+
+#include <deal.II/numerics/vector_tools.h>
+
+#include "../tests.h"
+
+
+
+template <int dim>
+void
+test(const unsigned int degree)
+{
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube(tria);
+ tria.refine_global(1);
+
+ FESystem<dim> fe_grid(FE_Q<dim>(degree), dim);
+ DoFHandler<dim> dof_grid(tria);
+ dof_grid.distribute_dofs(fe_grid);
+ Vector<double> euler;
+ euler.reinit(dof_grid.n_dofs());
+ const ComponentMask mask(dim, true);
+ VectorTools::get_position_vector(dof_grid, euler, mask);
+
+ FE_Q<dim> fe(1);
+ deallog << "FE=" << fe.get_name() << std::endl;
+
+ MappingFEField<dim> mapping(dof_grid, euler, mask);
+ deallog << "Mapping=MappingFEField(FE_Q(" << degree << "))" << std::endl;
+
+ DoFHandler<dim> dof(tria);
+ dof.distribute_dofs(fe);
+
+ std::vector<Point<dim>> points(2);
+ for (unsigned int d = 0; d < dim; ++d)
+ points[0][d] = 0.1;
+ for (unsigned int d = 0; d < dim; ++d)
+ points[1][d] = 0.85;
+
+ const Quadrature<dim> quadrature(points);
+ FEValues<dim> fe_values(mapping,
+ fe,
+ quadrature,
+ update_gradients | update_jacobians);
+
+ const auto check = [&]() {
+ for (const auto &cell : dof.active_cell_iterators())
+ {
+ fe_values.reinit(cell);
+
+ deallog << "Jacobians: ";
+ for (unsigned int q = 0; q < fe_values.n_quadrature_points; ++q)
+ {
+ deallog << "[ ";
+ for (unsigned int d = 0; d < dim; ++d)
+ for (unsigned int e = 0; e < dim; ++e)
+ deallog << fe_values.jacobian(q)[d][e] << " ";
+ deallog << " ] ";
+ }
+ deallog << std::endl;
+ deallog << "Derivatives of shape function: ";
+ for (unsigned int q = 0; q < fe_values.n_quadrature_points; ++q)
+ {
+ deallog << "[ ";
+ for (unsigned int d = 0; d < dim; ++d)
+ deallog << fe_values.shape_grad(fe.dofs_per_cell / 2, q)[d]
+ << " ";
+ deallog << " ] ";
+ }
+ deallog << std::endl;
+ }
+ };
+
+ deallog << "Undeformed configuration" << std::endl;
+ check();
+
+ euler(euler.size() - 1) += 0.01;
+ deallog << "Last Euler point deformed" << std::endl;
+ check();
+
+ euler(0) += 0.01;
+ deallog << "First and last Euler points deformed" << std::endl;
+ check();
+}
+
+
+
+int
+main()
+{
+ initlog();
+ deallog << std::setprecision(8);
+ MultithreadInfo::set_thread_limit(1);
+
+ test<2>(1);
+ test<2>(2);
+ test<3>(1);
+}
--- /dev/null
+
+DEAL::FE=FE_Q<2>(1)
+DEAL::Mapping=MappingFEField(FE_Q(1))
+DEAL::Undeformed configuration
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -2.7755576e-17 0.0000000 0.50000000 ] [ 0.50000000 -1.1102230e-16 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -2.7755576e-17 0.0000000 0.50000000 ] [ 0.50000000 -1.1102230e-16 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Last Euler point deformed
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -2.7755576e-17 0.0000000 0.50000000 ] [ 0.50000000 -1.1102230e-16 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -2.7755576e-17 0.0010000000 0.50100000 ] [ 0.50000000 -1.1102230e-16 0.0085000000 0.50850000 ]
+DEAL::Derivatives of shape function: [ -0.20359281 1.7964072 ] [ -1.7050147 0.29498525 ]
+DEAL::First and last Euler points deformed
+DEAL::Jacobians: [ 0.49100000 -0.0090000000 0.0000000 0.50000000 ] [ 0.49850000 -0.0015000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20366599 1.7963340 ] [ -1.7051153 0.29488465 ]
+DEAL::Jacobians: [ 0.50000000 -2.7755576e-17 0.0000000 0.50000000 ] [ 0.50000000 -1.1102230e-16 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -2.7755576e-17 0.0010000000 0.50100000 ] [ 0.50000000 -1.1102230e-16 0.0085000000 0.50850000 ]
+DEAL::Derivatives of shape function: [ -0.20359281 1.7964072 ] [ -1.7050147 0.29498525 ]
+DEAL::FE=FE_Q<2>(1)
+DEAL::Mapping=MappingFEField(FE_Q(2))
+DEAL::Undeformed configuration
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.1102230e-16 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 -2.2204460e-16 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.1102230e-16 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 -2.2204460e-16 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Last Euler point deformed
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.1102230e-16 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 -2.2204460e-16 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.1102230e-16 0.011520000 0.51152000 ] [ 0.50000000 0.0000000 -0.014280000 0.48572000 ]
+DEAL::Derivatives of shape function: [ -0.24053800 1.7594620 ] [ -1.6911801 0.30881990 ]
+DEAL::First and last Euler points deformed
+DEAL::Jacobians: [ 0.48128000 -0.018720000 0.0000000 0.50000000 ] [ 0.49958000 -0.00042000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20777926 1.7922207 ] [ -1.7014292 0.29857080 ]
+DEAL::Jacobians: [ 0.50000000 -1.1102230e-16 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 0.0000000 0.50000000 ] [ 0.50000000 0.0000000 -2.2204460e-16 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.20000000 1.8000000 ] [ -1.7000000 0.30000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.1102230e-16 0.011520000 0.51152000 ] [ 0.50000000 0.0000000 -0.014280000 0.48572000 ]
+DEAL::Derivatives of shape function: [ -0.24053800 1.7594620 ] [ -1.6911801 0.30881990 ]
+DEAL::FE=FE_Q<3>(1)
+DEAL::Mapping=MappingFEField(FE_Q(1))
+DEAL::Undeformed configuration
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 3.4694470e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 3.4694470e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 6.9388939e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 6.9388939e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 3.4694470e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 3.4694470e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 6.9388939e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 6.9388939e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Last Euler point deformed
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 3.4694470e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 3.4694470e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 6.9388939e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 6.9388939e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 3.4694470e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 3.4694470e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 6.9388939e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 6.9388939e-18 0.00010000000 0.00010000000 0.50010000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0072250000 0.0072250000 0.50722500 ]
+DEAL::Derivatives of shape function: [ -0.18032394 -0.18032394 1.6196761 ] [ -0.25564099 -0.25564099 0.044359012 ]
+DEAL::First and last Euler points deformed
+DEAL::Jacobians: [ 0.49190000 -0.0081000000 -0.0081000000 0.0000000 0.50000000 3.4694470e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.49977500 -0.00022500000 -0.00022500000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18296402 -0.18296402 1.6170360 ] [ -0.25511480 -0.25511480 0.044885198 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 3.4694470e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 6.9388939e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 6.9388939e-18 0.0000000 3.4694470e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 3.4694470e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 3.4694470e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 0.0000000 3.4694470e-18 0.0000000 0.50000000 6.9388939e-18 0.0000000 6.9388939e-18 0.50000000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 ]
+DEAL::Derivatives of shape function: [ -0.18000000 -0.18000000 1.6200000 ] [ -0.25500000 -0.25500000 0.045000000 ]
+DEAL::Jacobians: [ 0.50000000 -1.3877788e-17 0.0000000 0.0000000 0.50000000 6.9388939e-18 0.00010000000 0.00010000000 0.50010000 ] [ 0.50000000 0.0000000 0.0000000 0.0000000 0.50000000 0.0000000 0.0072250000 0.0072250000 0.50722500 ]
+DEAL::Derivatives of shape function: [ -0.18032394 -0.18032394 1.6196761 ] [ -0.25564099 -0.25564099 0.044359012 ]