]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add test for FEFieldFunction with hp::DoFHandler.
authorbuerg <buerg@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 27 May 2012 13:41:15 +0000 (13:41 +0000)
committerbuerg <buerg@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 27 May 2012 13:41:15 +0000 (13:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@25550 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/fe_field.cc [new file with mode: 0644]
tests/deal.II/fe_field/cmp/generic [new file with mode: 0644]

diff --git a/tests/deal.II/fe_field.cc b/tests/deal.II/fe_field.cc
new file mode 100644 (file)
index 0000000..4ea7c54
--- /dev/null
@@ -0,0 +1,95 @@
+//------------------------------  fe_field.cc  ----------------------------
+//    $Id: boundaries.cc 24689 2011-10-29 15:28:46Z kanschat $
+//    Version: $Name$ 
+//
+//    Copyright (C) 2012 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//------------------------------ fe_field.cc  -----------------------------
+
+
+/* Author: Markus Buerg, 2012 */
+/* Purpose: Check FEFieldFunction for hp::DoFHandler. */
+
+
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/quadrature_lib.h>
+#include <deal.II/lac/vector.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/hp/fe_collection.h>
+#include <deal.II/numerics/fe_field_function.h>
+
+#include <fstream>
+
+
+
+template <int dim>
+void
+check ()
+{
+  Triangulation<dim> triangulation;
+  
+  GridGenerator::subdivided_hyper_cube (triangulation, 2);
+  hp::FECollection<dim> fe_collection;
+  
+  for (unsigned int i = 1; i <= triangulation.n_active_cells (); ++i)
+    fe_collection.push_back (FE_Q<dim> (i));
+  
+  hp::DoFHandler<dim> dof_handler (triangulation);
+  
+  dof_handler.distribute_dofs (fe_collection);
+  
+  Vector<double> vector (dof_handler.n_dofs ());
+  
+  for (unsigned int i = 0; i < dof_handler.n_dofs (); ++i)
+    vector (i) = i;
+  
+  Functions::FEFieldFunction<dim, hp::DoFHandler<dim> >
+    fe_field (dof_handler, vector);
+  QGauss<dim> quadrature (5);
+  
+  deallog << "values:" <<std::endl;
+  
+  std::vector<double> values (quadrature.size ());
+  
+  fe_field.value_list (quadrature.get_points (), values);
+  
+  for (unsigned int q_point = 0; q_point < quadrature.size (); ++q_point)
+    deallog << values[q_point] << std::endl;
+  
+  deallog << "gradients:" <<std::endl;
+  
+  std::vector<Tensor<1, dim> > gradients (quadrature.size ());
+  
+  fe_field.gradient_list (quadrature.get_points (), gradients);
+  
+  for (unsigned int q_point = 0; q_point < quadrature.size (); ++q_point)
+    deallog << gradients[q_point] << std::endl;
+}
+
+
+int main ()
+{
+  initlog(__FILE__);  
+  deallog << std::setprecision (2);
+  deallog << std::fixed;  
+
+  deallog.push ("1d");
+  check<1> ();
+  deallog.pop ();
+  deallog.push ("2d");
+  check<2> ();
+  deallog.pop ();
+  deallog.push ("3d");
+  check<3> ();
+  deallog.pop ();
+}
diff --git a/tests/deal.II/fe_field/cmp/generic b/tests/deal.II/fe_field/cmp/generic
new file mode 100644 (file)
index 0000000..6e47fe8
--- /dev/null
@@ -0,0 +1,317 @@
+
+DEAL:1d::values:
+DEAL:1d::0.09
+DEAL:1d::0.46
+DEAL:1d::1.00
+DEAL:1d::1.54
+DEAL:1d::1.91
+DEAL:1d::gradients:
+DEAL:1d::2.00
+DEAL:1d::2.00
+DEAL:1d::2.00
+DEAL:1d::2.00
+DEAL:1d::2.00
+DEAL:2d::values:
+DEAL:2d::0.28
+DEAL:2d::0.65
+DEAL:2d::1.19
+DEAL:2d::2.75
+DEAL:2d::3.82
+DEAL:2d::1.02
+DEAL:2d::1.38
+DEAL:2d::1.92
+DEAL:2d::3.29
+DEAL:2d::4.22
+DEAL:2d::2.09
+DEAL:2d::2.46
+DEAL:2d::3.00
+DEAL:2d::4.08
+DEAL:2d::4.81
+DEAL:2d::4.25
+DEAL:2d::4.62
+DEAL:2d::5.15
+DEAL:2d::5.94
+DEAL:2d::6.48
+DEAL:2d::5.72
+DEAL:2d::6.09
+DEAL:2d::6.62
+DEAL:2d::7.21
+DEAL:2d::7.62
+DEAL:2d::gradients:
+DEAL:2d::2.00 4.00
+DEAL:2d::2.00 4.00
+DEAL:2d::2.00 4.00
+DEAL:2d::5.81 2.92
+DEAL:2d::5.81 2.19
+DEAL:2d::2.00 4.00
+DEAL:2d::2.00 4.00
+DEAL:2d::2.00 4.00
+DEAL:2d::5.08 2.92
+DEAL:2d::5.08 2.19
+DEAL:2d::2.00 4.00
+DEAL:2d::2.00 4.00
+DEAL:2d::2.00 4.00
+DEAL:2d::4.00 2.92
+DEAL:2d::4.00 2.19
+DEAL:2d::2.00 8.00
+DEAL:2d::2.00 8.00
+DEAL:2d::2.00 8.00
+DEAL:2d::2.92 6.92
+DEAL:2d::2.92 6.19
+DEAL:2d::2.00 8.00
+DEAL:2d::2.00 8.00
+DEAL:2d::2.00 8.00
+DEAL:2d::2.19 6.92
+DEAL:2d::2.19 6.19
+DEAL:3d::values:
+DEAL:3d::0.66
+DEAL:3d::1.02
+DEAL:3d::1.56
+DEAL:3d::5.18
+DEAL:3d::7.65
+DEAL:3d::1.39
+DEAL:3d::1.76
+DEAL:3d::2.30
+DEAL:3d::5.72
+DEAL:3d::8.05
+DEAL:3d::2.47
+DEAL:3d::2.84
+DEAL:3d::3.38
+DEAL:3d::6.51
+DEAL:3d::8.64
+DEAL:3d::7.75
+DEAL:3d::8.12
+DEAL:3d::8.66
+DEAL:3d::10.95
+DEAL:3d::12.51
+DEAL:3d::11.36
+DEAL:3d::11.73
+DEAL:3d::12.27
+DEAL:3d::13.98
+DEAL:3d::15.15
+DEAL:3d::2.13
+DEAL:3d::2.50
+DEAL:3d::3.03
+DEAL:3d::6.26
+DEAL:3d::8.46
+DEAL:3d::2.86
+DEAL:3d::3.23
+DEAL:3d::3.77
+DEAL:3d::6.79
+DEAL:3d::8.86
+DEAL:3d::3.94
+DEAL:3d::4.31
+DEAL:3d::4.85
+DEAL:3d::7.58
+DEAL:3d::9.45
+DEAL:3d::8.83
+DEAL:3d::9.20
+DEAL:3d::9.73
+DEAL:3d::11.73
+DEAL:3d::13.10
+DEAL:3d::12.17
+DEAL:3d::12.53
+DEAL:3d::13.07
+DEAL:3d::14.57
+DEAL:3d::15.59
+DEAL:3d::4.28
+DEAL:3d::4.65
+DEAL:3d::5.19
+DEAL:3d::7.83
+DEAL:3d::9.63
+DEAL:3d::5.02
+DEAL:3d::5.38
+DEAL:3d::5.92
+DEAL:3d::8.37
+DEAL:3d::10.04
+DEAL:3d::6.09
+DEAL:3d::6.46
+DEAL:3d::7.00
+DEAL:3d::9.15
+DEAL:3d::10.62
+DEAL:3d::10.40
+DEAL:3d::10.77
+DEAL:3d::11.31
+DEAL:3d::12.88
+DEAL:3d::13.96
+DEAL:3d::13.34
+DEAL:3d::13.71
+DEAL:3d::14.25
+DEAL:3d::15.43
+DEAL:3d::16.23
+DEAL:3d::11.82
+DEAL:3d::12.19
+DEAL:3d::12.73
+DEAL:3d::14.79
+DEAL:3d::16.20
+DEAL:3d::12.56
+DEAL:3d::12.92
+DEAL:3d::13.46
+DEAL:3d::15.33
+DEAL:3d::16.60
+DEAL:3d::13.63
+DEAL:3d::14.00
+DEAL:3d::14.54
+DEAL:3d::16.11
+DEAL:3d::17.19
+DEAL:3d::16.78
+DEAL:3d::17.15
+DEAL:3d::17.69
+DEAL:3d::18.84
+DEAL:3d::19.62
+DEAL:3d::18.93
+DEAL:3d::19.30
+DEAL:3d::19.84
+DEAL:3d::20.70
+DEAL:3d::21.28
+DEAL:3d::16.97
+DEAL:3d::17.34
+DEAL:3d::17.87
+DEAL:3d::19.54
+DEAL:3d::20.68
+DEAL:3d::17.70
+DEAL:3d::18.07
+DEAL:3d::18.61
+DEAL:3d::20.08
+DEAL:3d::21.08
+DEAL:3d::18.78
+DEAL:3d::19.15
+DEAL:3d::19.69
+DEAL:3d::20.86
+DEAL:3d::21.67
+DEAL:3d::21.14
+DEAL:3d::21.50
+DEAL:3d::22.04
+DEAL:3d::22.90
+DEAL:3d::23.49
+DEAL:3d::22.75
+DEAL:3d::23.11
+DEAL:3d::23.65
+DEAL:3d::24.30
+DEAL:3d::24.74
+DEAL:3d::gradients:
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::13.44 2.92 5.85
+DEAL:3d::13.44 2.19 4.38
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::12.70 2.92 5.85
+DEAL:3d::12.70 2.19 4.38
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::11.62 2.92 5.85
+DEAL:3d::11.62 2.19 4.38
+DEAL:3d::2.00 19.62 5.85
+DEAL:3d::2.00 19.62 5.85
+DEAL:3d::2.00 19.62 5.85
+DEAL:3d::8.49 16.49 4.27
+DEAL:3d::8.49 14.36 3.20
+DEAL:3d::2.00 19.62 4.38
+DEAL:3d::2.00 19.62 4.38
+DEAL:3d::2.00 19.62 4.38
+DEAL:3d::6.36 16.49 3.20
+DEAL:3d::6.36 14.36 2.39
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::11.97 2.92 5.85
+DEAL:3d::11.97 2.19 4.38
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::11.23 2.92 5.85
+DEAL:3d::11.23 2.19 4.38
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::10.15 2.92 5.85
+DEAL:3d::10.15 2.19 4.38
+DEAL:3d::2.00 18.15 5.85
+DEAL:3d::2.00 18.15 5.85
+DEAL:3d::2.00 18.15 5.85
+DEAL:3d::7.42 15.42 4.27
+DEAL:3d::7.42 13.55 3.20
+DEAL:3d::2.00 18.15 4.38
+DEAL:3d::2.00 18.15 4.38
+DEAL:3d::2.00 18.15 4.38
+DEAL:3d::5.55 15.42 3.20
+DEAL:3d::5.55 13.55 2.39
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::9.81 2.92 5.85
+DEAL:3d::9.81 2.19 4.38
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::9.08 2.92 5.85
+DEAL:3d::9.08 2.19 4.38
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::2.00 4.00 8.00
+DEAL:3d::8.00 2.92 5.85
+DEAL:3d::8.00 2.19 4.38
+DEAL:3d::2.00 16.00 5.85
+DEAL:3d::2.00 16.00 5.85
+DEAL:3d::2.00 16.00 5.85
+DEAL:3d::5.85 13.85 4.27
+DEAL:3d::5.85 12.38 3.20
+DEAL:3d::2.00 16.00 4.38
+DEAL:3d::2.00 16.00 4.38
+DEAL:3d::2.00 16.00 4.38
+DEAL:3d::4.38 13.85 3.20
+DEAL:3d::4.38 12.38 2.39
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::7.66 2.92 25.85
+DEAL:3d::7.66 2.19 24.38
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::6.92 2.92 25.85
+DEAL:3d::6.92 2.19 24.38
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::5.85 2.92 25.85
+DEAL:3d::5.85 2.19 24.38
+DEAL:3d::2.00 11.69 23.69
+DEAL:3d::2.00 11.69 23.69
+DEAL:3d::2.00 11.69 23.69
+DEAL:3d::4.27 10.12 22.12
+DEAL:3d::4.27 9.04 21.04
+DEAL:3d::2.00 11.69 20.75
+DEAL:3d::2.00 11.69 20.75
+DEAL:3d::2.00 11.69 20.75
+DEAL:3d::3.20 10.12 19.57
+DEAL:3d::3.20 9.04 18.77
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::6.19 2.92 25.85
+DEAL:3d::6.19 2.19 24.38
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::5.45 2.92 25.85
+DEAL:3d::5.45 2.19 24.38
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::2.00 4.00 28.00
+DEAL:3d::4.38 2.92 25.85
+DEAL:3d::4.38 2.19 24.38
+DEAL:3d::2.00 8.75 23.69
+DEAL:3d::2.00 8.75 23.69
+DEAL:3d::2.00 8.75 23.69
+DEAL:3d::3.20 7.57 22.12
+DEAL:3d::3.20 6.77 21.04
+DEAL:3d::2.00 8.75 20.75
+DEAL:3d::2.00 8.75 20.75
+DEAL:3d::2.00 8.75 20.75
+DEAL:3d::2.39 7.57 19.57
+DEAL:3d::2.39 6.77 18.77

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.