#include <deal.II/grid/tria.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/constraint_matrix.h>
-#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
constraints);
constraints.close ();
- TrilinosWrappers::MPI::Vector projection_tmp (locally_owned_dofs,
- mpi_communicator);
- TrilinosWrappers::MPI::Vector projection (locally_owned_dofs,
- locally_relevant_dofs,
- mpi_communicator);
+ LinearAlgebra::distributed::Vector projection (locally_owned_dofs,
+ locally_relevant_dofs,
+ mpi_communicator);
Vector<float> error (triangulation.n_active_cells());
for (unsigned int q=0; q<=p+2-order_difference; ++q)
{
// project the function
VectorTools::project
(dof_handler, constraints, QGauss<dim>(p+2),
- F<dim> (q, fe.n_components()), projection_tmp);
+ F<dim> (q, fe.n_components()), projection);
// just to make sure it doesn't get
// forgotten: handle hanging node
// constraints
- constraints.distribute (projection_tmp);
- projection = projection_tmp;
+ constraints.distribute (projection);
// then compute the interpolation error
VectorTools::integrate_difference (dof_handler,
const double L2_error
= std::sqrt(Utilities::MPI::sum(L2_error_local * L2_error_local,
mpi_communicator));
- const double projection_l2_norm = projection_tmp.l2_norm();
+ const double projection_l2_norm = projection.l2_norm();
deallog << fe.get_name() << ", P_" << q
<< ", rel. error=" << L2_error / projection_l2_norm
<< std::endl;
+++ /dev/null
-
-DEAL::n_dofs=82
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_0, rel. error=5.06109e-17
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_1, rel. error=5.39290e-14
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_2, rel. error=0.000373967
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_3, rel. error=0.000951721
-DEAL::n_dofs=141
-DEAL::FESystem<2>[FE_Q<2>(2)], P_0, rel. error=1.74177e-17
-DEAL::FESystem<2>[FE_Q<2>(2)], P_1, rel. error=3.86131e-17
-DEAL::FESystem<2>[FE_Q<2>(2)], P_2, rel. error=1.22920e-13
-DEAL::FESystem<2>[FE_Q<2>(2)], P_3, rel. error=2.61058e-05
-DEAL::FESystem<2>[FE_Q<2>(2)], P_4, rel. error=7.91713e-05
-DEAL::n_dofs=446
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_0, rel. error=2.14261e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_1, rel. error=2.16569e-13
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_2, rel. error=0.000158305
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_3, rel. error=0.000390601
-DEAL::n_dofs=1375
-DEAL::FESystem<3>[FE_Q<3>(2)], P_0, rel. error=1.65385e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_1, rel. error=2.30619e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_2, rel. error=4.86253e-14
-DEAL::FESystem<3>[FE_Q<3>(2)], P_3, rel. error=8.13208e-06
-DEAL::FESystem<3>[FE_Q<3>(2)], P_4, rel. error=2.39265e-05
+++ /dev/null
-
-DEAL::n_dofs=70
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_0, rel. error=8.46380e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_1, rel. error=1.18133e-16
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_2, rel. error=0.0117673
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_3, rel. error=0.0111866
-DEAL::n_dofs=70
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_0, rel. error=5.48256e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_1, rel. error=2.07334e-13
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_2, rel. error=0.0121021
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_3, rel. error=0.0116930
-DEAL::n_dofs=70
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_0, rel. error=6.39446e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_1, rel. error=1.36014e-16
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_2, rel. error=0.00926848
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_3, rel. error=0.00926122
-DEAL::n_dofs=70
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_0, rel. error=7.42043e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_1, rel. error=7.71262e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_2, rel. error=0.0100923
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_3, rel. error=0.00943746
-DEAL::n_dofs=70
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_0, rel. error=6.73171e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_1, rel. error=3.49454e-14
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_2, rel. error=0.00984841
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_3, rel. error=0.00955841
-DEAL::n_dofs=70
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_0, rel. error=6.03815e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_1, rel. error=1.12255e-16
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_2, rel. error=0.0114470
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_3, rel. error=0.0108987
-DEAL::n_dofs=70
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_0, rel. error=6.84970e-17
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_1, rel. error=3.30955e-14
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_2, rel. error=0.0101389
-DEAL::FESystem<3>[FE_Q<3>(1)^2], P_3, rel. error=0.00977176
-DEAL::n_dofs=195
-DEAL::FESystem<3>[FE_Q<3>(2)], P_0, rel. error=3.63837e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_1, rel. error=2.80245e-14
-DEAL::FESystem<3>[FE_Q<3>(2)], P_2, rel. error=2.68796e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_3, rel. error=0.00312284
-DEAL::FESystem<3>[FE_Q<3>(2)], P_4, rel. error=0.00305022
-DEAL::n_dofs=194
-DEAL::FESystem<3>[FE_Q<3>(2)], P_0, rel. error=3.82484e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_1, rel. error=2.22128e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_2, rel. error=1.71631e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_3, rel. error=0.00316296
-DEAL::FESystem<3>[FE_Q<3>(2)], P_4, rel. error=0.00294735
-DEAL::n_dofs=194
-DEAL::FESystem<3>[FE_Q<3>(2)], P_0, rel. error=2.98728e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_1, rel. error=1.07050e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_2, rel. error=1.14817e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_3, rel. error=0.00234293
-DEAL::FESystem<3>[FE_Q<3>(2)], P_4, rel. error=0.00227309
-DEAL::n_dofs=194
-DEAL::FESystem<3>[FE_Q<3>(2)], P_0, rel. error=4.01977e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_1, rel. error=1.46250e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_2, rel. error=1.35756e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_3, rel. error=0.00210960
-DEAL::FESystem<3>[FE_Q<3>(2)], P_4, rel. error=0.00203856
-DEAL::n_dofs=194
-DEAL::FESystem<3>[FE_Q<3>(2)], P_0, rel. error=2.84169e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_1, rel. error=1.27722e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_2, rel. error=1.18704e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_3, rel. error=0.00267340
-DEAL::FESystem<3>[FE_Q<3>(2)], P_4, rel. error=0.00253077
-DEAL::n_dofs=194
-DEAL::FESystem<3>[FE_Q<3>(2)], P_0, rel. error=4.46008e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_1, rel. error=1.80346e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_2, rel. error=1.40395e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_3, rel. error=0.00288112
-DEAL::FESystem<3>[FE_Q<3>(2)], P_4, rel. error=0.00269959
-DEAL::n_dofs=194
-DEAL::FESystem<3>[FE_Q<3>(2)], P_0, rel. error=3.12696e-17
-DEAL::FESystem<3>[FE_Q<3>(2)], P_1, rel. error=1.40254e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_2, rel. error=1.10869e-13
-DEAL::FESystem<3>[FE_Q<3>(2)], P_3, rel. error=0.00220695
-DEAL::FESystem<3>[FE_Q<3>(2)], P_4, rel. error=0.00214412
+++ /dev/null
-
-DEAL::n_dofs=14
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_0, rel. error=5.44571e-17
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_1, rel. error=3.20140e-15
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_2, rel. error=0.00667964
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_3, rel. error=0.0144138
-DEAL::n_dofs=19
-DEAL::FESystem<2>[FE_Q<2>(2)], P_0, rel. error=8.95863e-17
-DEAL::FESystem<2>[FE_Q<2>(2)], P_1, rel. error=1.73057e-14
-DEAL::FESystem<2>[FE_Q<2>(2)], P_2, rel. error=1.35999e-16
-DEAL::FESystem<2>[FE_Q<2>(2)], P_3, rel. error=0.000954360
-DEAL::FESystem<2>[FE_Q<2>(2)], P_4, rel. error=0.00254228
+++ /dev/null
-
-DEAL::n_dofs=24
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_0, rel. error=5.89749e-17
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_1, rel. error=1.33525e-15
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_2, rel. error=0.00544145
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_3, rel. error=0.0123174
-DEAL::n_dofs=24
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_0, rel. error=8.00269e-17
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_1, rel. error=1.25939e-15
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_2, rel. error=0.00479825
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_3, rel. error=0.0101146
-DEAL::n_dofs=24
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_0, rel. error=5.80857e-17
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_1, rel. error=1.56761e-15
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_2, rel. error=0.00315064
-DEAL::FESystem<2>[FE_Q<2>(1)^2], P_3, rel. error=0.00683382
-DEAL::n_dofs=37
-DEAL::FESystem<2>[FE_Q<2>(2)], P_0, rel. error=3.61277e-17
-DEAL::FESystem<2>[FE_Q<2>(2)], P_1, rel. error=1.76493e-13
-DEAL::FESystem<2>[FE_Q<2>(2)], P_2, rel. error=1.60801e-13
-DEAL::FESystem<2>[FE_Q<2>(2)], P_3, rel. error=0.000777566
-DEAL::FESystem<2>[FE_Q<2>(2)], P_4, rel. error=0.00214199
-DEAL::n_dofs=37
-DEAL::FESystem<2>[FE_Q<2>(2)], P_0, rel. error=3.64108e-17
-DEAL::FESystem<2>[FE_Q<2>(2)], P_1, rel. error=8.55604e-14
-DEAL::FESystem<2>[FE_Q<2>(2)], P_2, rel. error=5.15666e-14
-DEAL::FESystem<2>[FE_Q<2>(2)], P_3, rel. error=0.000621354
-DEAL::FESystem<2>[FE_Q<2>(2)], P_4, rel. error=0.00166958
-DEAL::n_dofs=37
-DEAL::FESystem<2>[FE_Q<2>(2)], P_0, rel. error=8.21833e-17
-DEAL::FESystem<2>[FE_Q<2>(2)], P_1, rel. error=4.54279e-14
-DEAL::FESystem<2>[FE_Q<2>(2)], P_2, rel. error=1.11092e-13
-DEAL::FESystem<2>[FE_Q<2>(2)], P_3, rel. error=0.000395444
-DEAL::FESystem<2>[FE_Q<2>(2)], P_4, rel. error=0.00105516