]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 6 Dec 2010 00:34:04 +0000 (00:34 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 6 Dec 2010 00:34:04 +0000 (00:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@22922 0785d39b-7218-0410-832d-ea1e28bc413d

tests/codim_one/extract_boundary_mesh_05.cc [new file with mode: 0644]
tests/codim_one/extract_boundary_mesh_05/cmp/generic [new file with mode: 0644]

diff --git a/tests/codim_one/extract_boundary_mesh_05.cc b/tests/codim_one/extract_boundary_mesh_05.cc
new file mode 100644 (file)
index 0000000..ffd07a5
--- /dev/null
@@ -0,0 +1,77 @@
+//----------------------------  extract_boundary_mesh_03.cc  ---------------------------
+//    $Id: bem.cc 22693 2010-11-11 20:11:47Z kanschat $
+//    Version: $Name$
+//
+//    Copyright (C) 2010 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.
+//
+//----------------------------  extract_boundary_mesh_03.cc  ---------------------------
+
+
+#include "../tests.h"
+
+#include <grid/tria.h>
+#include <grid/grid_generator.h>
+#include <grid/tria_boundary_lib.h>
+#include <grid/grid_out.h>
+#include <grid/grid_tools.h>
+#include <fe/fe_system.h>
+#include <fe/fe_q.h>
+
+#include <dofs/dof_handler.h>
+#include <dofs/dof_accessor.h>
+
+using namespace std;
+
+
+void test ()
+{
+  const unsigned int dim=2;
+
+  Triangulation<dim-1,dim> boundary_mesh;
+  map<Triangulation<dim-1,dim>::cell_iterator,Triangulation<dim,dim>::face_iterator >
+    surface_to_volume_mapping;
+  Triangulation<dim> volume_mesh;
+  GridGenerator::hyper_cube(volume_mesh);
+
+  GridTools::extract_boundary_mesh (volume_mesh, boundary_mesh,
+                                   surface_to_volume_mapping);
+
+  FE_Q <dim-1,dim>  boundary_fe (1);
+  DoFHandler<dim-1,dim> boundary_dh(boundary_mesh);
+  boundary_dh.distribute_dofs (boundary_fe);
+
+  deallog << "n_dofs=" << boundary_dh.n_dofs() << std::endl;
+
+  for (DoFHandler<dim-1,dim>::active_cell_iterator
+        cell = boundary_dh.begin_active(),
+        endc = boundary_dh.end(); cell!=endc; ++cell)
+    {
+      deallog << "Cell: " << cell << std::endl;
+      for (unsigned int v=0; v<GeometryInfo<dim-1>::vertices_per_cell; ++v)
+       {
+         unsigned int index = cell->vertex_dof_index(v,0);
+         deallog << "vertex: " << v
+                 << ", global: " << cell->vertex_index(v)
+                 << " index: " << index << std::endl;
+       }
+
+      deallog << std::endl;
+    }
+}
+
+
+
+int main ()
+{
+
+  ofstream logfile("extract_boundary_mesh_05/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  test ();
+ }
diff --git a/tests/codim_one/extract_boundary_mesh_05/cmp/generic b/tests/codim_one/extract_boundary_mesh_05/cmp/generic
new file mode 100644 (file)
index 0000000..b66eda8
--- /dev/null
@@ -0,0 +1,18 @@
+
+DEAL::n_dofs=4
+DEAL::Cell: 0.0
+DEAL::vertex: 0, global: 0 index: 0
+DEAL::vertex: 1, global: 1 index: 1
+DEAL::
+DEAL::Cell: 0.1
+DEAL::vertex: 0, global: 2 index: 2
+DEAL::vertex: 1, global: 3 index: 3
+DEAL::
+DEAL::Cell: 0.2
+DEAL::vertex: 0, global: 0 index: 0
+DEAL::vertex: 1, global: 2 index: 2
+DEAL::
+DEAL::Cell: 0.3
+DEAL::vertex: 0, global: 1 index: 1
+DEAL::vertex: 1, global: 3 index: 3
+DEAL::

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.