]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add an interpolation test for FE_Nedelec 5005/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 1 Sep 2017 03:09:55 +0000 (22:09 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 8 Sep 2017 02:57:09 +0000 (21:57 -0500)
tests/fe/interpolate_nedelec.cc [new file with mode: 0644]
tests/fe/interpolate_nedelec.output [new file with mode: 0644]

diff --git a/tests/fe/interpolate_nedelec.cc b/tests/fe/interpolate_nedelec.cc
new file mode 100644 (file)
index 0000000..a98aa45
--- /dev/null
@@ -0,0 +1,70 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2017 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 at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+#include "interpolate_common.h"
+#include <deal.II/base/quadrature_lib.h>
+
+#include <deal.II/fe/fe_nedelec.h>
+
+
+// FE_Nedelec<dim>::interpolate(...)
+
+template <int dim>
+void check1(const Function<dim> &f,
+            const unsigned int degree)
+{
+  FE_Nedelec<dim> fe(degree);
+  deallog << fe.get_name() << ' ';
+  deallog << fe.get_generalized_support_points().size() << ' ';
+
+  std::vector<double> dofs(fe.dofs_per_cell);
+
+  std::vector<Vector<double> > values (fe.get_generalized_support_points().size(),
+                                       Vector<double>(dim));
+  f.vector_value_list(fe.get_generalized_support_points(), values);
+  fe.convert_generalized_support_point_values_to_dof_values(values, dofs);
+  deallog << " vector " << vector_difference(fe,dofs,f,0) << std::endl;
+}
+
+int main()
+{
+  std::ofstream logfile ("output");
+  deallog.attach(logfile);
+
+  {
+    Q1WedgeFunction<2, 0, 2> w20;
+    check1(w20, 0);
+    check1(w20, 1);
+    check1(w20, 2);
+    Q1WedgeFunction<2, 1, 2> w21;
+    check1(w21, 2);
+    Q1WedgeFunction<2, 2, 2> w22;
+    check1(w22, 2);
+    Q1WedgeFunction<2, 3, 2> w23;
+    check1(w23, 3);
+  }
+
+  {
+    Q1WedgeFunction<3, 1, 3> w21;
+    check1(w21, 1);
+    check1(w21, 2);
+    // FIXME - higher order interpolation is currently broken
+    // Q1WedgeFunction<3, 2, 3> w22;
+    // check1(w22, 2);
+    // Q1WedgeFunction<3, 3, 3> w23;
+    // check1(w23, 3);
+  }
+}
diff --git a/tests/fe/interpolate_nedelec.output b/tests/fe/interpolate_nedelec.output
new file mode 100644 (file)
index 0000000..aeb8cd5
--- /dev/null
@@ -0,0 +1,9 @@
+
+DEAL::FE_Nedelec<2>(0) 4  vector 0.00000
+DEAL::FE_Nedelec<2>(1) 12  vector 0.00000
+DEAL::FE_Nedelec<2>(2) 21  vector 5.55112e-17
+DEAL::FE_Nedelec<2>(2) 21  vector 1.11022e-16
+DEAL::FE_Nedelec<2>(2) 21  vector 1.58727e-16
+DEAL::FE_Nedelec<2>(3) 32  vector 1.17788e-15
+DEAL::FE_Nedelec<3>(1) 56  vector 5.55112e-17
+DEAL::FE_Nedelec<3>(2) 117  vector 1.11022e-16

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.