]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test: grid_in.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 14 Jun 2002 12:24:13 +0000 (12:24 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 14 Jun 2002 12:24:13 +0000 (12:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@6121 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/Makefile
tests/deal.II/grid_in.cc [new file with mode: 0644]
tests/deal.II/grid_in.checked [new file with mode: 0644]
tests/deal.II/grid_in.in [new file with mode: 0644]

index 4111b8b0a3733323a6ae59a1231c8a2e806fd4a5..c093527845a41772234bc1d41ae8393167e75de5 100644 (file)
@@ -48,6 +48,7 @@ sparsity_pattern.exe         : sparsity_pattern.go         $(lib-1d) $(lib-2d) $
 grid_tools.exe               : grid_tools.go               $(lib-1d) $(lib-2d) $(lib-3d) $(libraries)
 subdomain_ids.exe            : subdomain_ids.go            $(lib-1d) $(lib-2d) $(lib-3d) $(libraries)
 filtered_iterator.exe        : filtered_iterator.go                  $(lib-2d)           $(libraries)
+grid_in.exe                  : grid_in.go                            $(lib-2d)           $(libraries)
 
 
 tests = grid_test grid_transform dof_test data_out derivatives gradients \
@@ -55,7 +56,7 @@ tests = grid_test grid_transform dof_test data_out derivatives gradients \
         matrices error_estimator intergrid_constraints intergrid_map \
         wave-test-3 dof_renumbering support_point_map filtered_matrix \
        boundaries sparsity_pattern grid_tools subdomain_ids \
-       filtered_iterator grid_out
+       filtered_iterator grid_out grid_in
 
 ############################################################
 
diff --git a/tests/deal.II/grid_in.cc b/tests/deal.II/grid_in.cc
new file mode 100644 (file)
index 0000000..8b964cc
--- /dev/null
@@ -0,0 +1,56 @@
+//----------------------------  constraints.cc  ---------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2002 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.
+//
+//----------------------------  constraints.cc  ---------------------------
+
+
+#include <dofs/dof_handler.h>
+#include <grid/tria.h>
+#include <grid/tria_boundary.h>
+#include <grid/tria_boundary_lib.h>
+#include <grid/grid_out.h>
+#include <grid/grid_in.h>
+#include <grid/grid_generator.h>
+#include <base/logstream.h>
+
+#include <fstream>
+
+
+std::ofstream logfile("grid_in.output");
+
+
+template <int dim>
+void test ()
+{  
+  Triangulation<dim> tria;
+  GridIn<dim> gi;
+  gi.attach_triangulation (tria);
+  std::ifstream in ("grid_in.in");
+  gi.read_ucd (in);
+  
+  static const HyperBallBoundary<dim> x;
+  tria.set_boundary (0, x);
+//  tria.refine_global(1);
+  
+  GridOut grid_out;
+  grid_out.write_ucd (tria, logfile);
+};
+
+
+int main ()
+{
+  logfile.precision (2);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  test<2> ();
+};
+
diff --git a/tests/deal.II/grid_in.checked b/tests/deal.II/grid_in.checked
new file mode 100644 (file)
index 0000000..01b578d
--- /dev/null
@@ -0,0 +1,34 @@
+
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the UCD format see the AVS Developer's guide.
+#
+16 10 0 0 0
+1  0.71 -0.71 0
+2  0.27 -0.27 0
+3  0.27 0.27 0
+4  0.71 0.71 0
+5  0.0 -1.0 0
+6  0.50 -0.50 0
+7  0.0 -0.31 0
+8  0.0 -0.66 0
+9  0.31 0.0 0
+10  0.0 0.31 0
+11  0.0 0.0 0
+12  1.0 0.0 0
+13  0.50 0.50 0
+14  0.66 0.0 0
+15  0.0 1.0 0
+16  0.0 0.66 0
+1 0 quad    5 1 6 8 
+2 0 quad    8 6 2 7 
+3 0 quad    7 2 9 11 
+4 0 quad    11 9 3 10 
+5 0 quad    1 12 14 6 
+6 0 quad    12 4 13 14 
+7 0 quad    14 13 3 9 
+8 0 quad    6 14 9 2 
+9 0 quad    16 10 3 13 
+10 0 quad    15 16 13 4 
diff --git a/tests/deal.II/grid_in.in b/tests/deal.II/grid_in.in
new file mode 100644 (file)
index 0000000..ed4ed25
--- /dev/null
@@ -0,0 +1,27 @@
+16 10 0 0 0
+1  0.7071 -0.7071 0
+2  0.2668 -0.2668 0
+3  0.2668 0.2668 0
+4  0.7071 0.7071 0
+5  0 -1 0
+6  0.5 -0.5 0
+7  0 -0.3139 0
+8  0 -0.6621 0
+9  0.3139 0 0
+10  0 0.3139 0
+11  0 0 0
+12  1 0 0
+13  0.5 0.5 0
+14  0.6621 0 0
+15  0 1 0
+16  0 0.6621 0
+1  0 quad    5 1  6  8 
+2  0 quad     8  6 2  7 
+3  0 quad     7 2  9 11 
+4  0 quad    11  9 3 10 
+5  0 quad    1 12 14  6 
+6  0 quad    12 4 13 14 
+7  0 quad    14 13 3  9 
+8  0 quad     6 14  9 2 
+9  0 quad    16 10  3 13 
+10 0 quad    15 16 13 4 

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.