]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
new test: read in tecplot grid files
authorleicht <leicht@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 14 Dec 2006 10:59:21 +0000 (10:59 +0000)
committerleicht <leicht@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 14 Dec 2006 10:59:21 +0000 (10:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@14239 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/grid_in_tecplot.cc [new file with mode: 0644]
tests/deal.II/grid_in_tecplot/cmp/generic [new file with mode: 0644]
tests/deal.II/grid_tec_1.dat [new file with mode: 0644]
tests/deal.II/grid_tec_2.dat [new file with mode: 0644]
tests/deal.II/grid_tec_3.dat [new file with mode: 0644]
tests/deal.II/grid_tec_4.dat [new file with mode: 0644]

diff --git a/tests/deal.II/grid_in_tecplot.cc b/tests/deal.II/grid_in_tecplot.cc
new file mode 100644 (file)
index 0000000..ce8f985
--- /dev/null
@@ -0,0 +1,49 @@
+//------------------------  grid_in_tecplot.cc  -----------------------
+//    $Id: grid_in.cc 11749 2005-11-09 19:11:20Z wolf $
+//    Version: $Name$ 
+//
+//    Copyright (C) 2002, 2003, 2004, 2005 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.
+//
+//------------------------  grid_in_tecplot.cc  -----------------------
+
+#include "../tests.h"
+#include <dofs/dof_handler.h>
+#include <grid/tria.h>
+#include <grid/grid_out.h>
+#include <grid/grid_in.h>
+#include <base/logstream.h>
+
+#include <fstream>
+#include <string>
+
+std::ofstream logfile("grid_in_tecplot/output");
+
+
+template <int dim>
+void test (const std::string &infilename)
+{  
+  Triangulation<dim> tria;
+  GridIn<dim> gi;
+  gi.attach_triangulation (tria);
+  gi.read (infilename);
+
+  logfile<<"------------------------------------------"<<std::endl
+        <<"output for grid in "<<infilename<<std::endl;
+  
+  GridOut grid_out;
+  grid_out.write_ucd (tria, logfile);
+}
+
+int main ()
+{
+  test<2> ("grid_tec_1.dat");
+  test<2> ("grid_tec_2.dat");
+  test<2> ("grid_tec_3.dat");
+  test<2> ("grid_tec_4.dat");
+}
+
diff --git a/tests/deal.II/grid_in_tecplot/cmp/generic b/tests/deal.II/grid_in_tecplot/cmp/generic
new file mode 100644 (file)
index 0000000..bb090e9
--- /dev/null
@@ -0,0 +1,84 @@
+------------------------------------------
+output for grid in grid_tec_1.dat
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the UCD format see the AVS Developer's guide.
+#
+8 4 0 0 0
+1  1 0 0
+2  0 1 0
+3  -1 0 0
+4  0 -1 0
+5  2 0 0
+6  0 2 0
+7  -2 0 0
+8  0 -2 0
+1 0 quad    1 5 6 2 
+2 0 quad    2 6 7 3 
+3 0 quad    3 7 8 4 
+4 0 quad    4 8 5 1 
+------------------------------------------
+output for grid in grid_tec_2.dat
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the UCD format see the AVS Developer's guide.
+#
+8 4 0 0 0
+1  1 0 0
+2  0 1 0
+3  -1 0 0
+4  0 -1 0
+5  2 0 0
+6  0 2 0
+7  -2 0 0
+8  0 -2 0
+1 0 quad    1 5 6 2 
+2 0 quad    2 6 7 3 
+3 0 quad    3 7 8 4 
+4 0 quad    4 8 5 1 
+------------------------------------------
+output for grid in grid_tec_3.dat
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the UCD format see the AVS Developer's guide.
+#
+8 4 0 0 0
+1  1 0 0
+2  0 1 0
+3  -1 0 0
+4  0 -1 0
+5  2 0 0
+6  0 2 0
+7  -2 0 0
+8  0 -2 0
+1 0 quad    1 5 6 2 
+2 0 quad    2 6 7 3 
+3 0 quad    3 7 8 4 
+4 0 quad    4 8 5 1 
+------------------------------------------
+output for grid in grid_tec_4.dat
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the UCD format see the AVS Developer's guide.
+#
+8 4 0 0 0
+1  1 0 0
+2  0 1 0
+3  -1 0 0
+4  0 -1 0
+5  2 0 0
+6  0 2 0
+7  -2 0 0
+8  0 -2 0
+1 0 quad    1 5 6 2 
+2 0 quad    2 6 7 3 
+3 0 quad    3 7 8 4 
+4 0 quad    4 8 5 1 
diff --git a/tests/deal.II/grid_tec_1.dat b/tests/deal.II/grid_tec_1.dat
new file mode 100644 (file)
index 0000000..56951b0
--- /dev/null
@@ -0,0 +1,21 @@
+# coordinates x and y
+# new format of keys
+# unstructured data
+
+TITLE = "quad Mesh File"
+VARIABLES = "X", "Y"
+ZONE T="Zone-4" N=8 E=4 C=BLACK DATAPACKING=POINT ZONETYPE=FEQUADRILATERAL
+DT=(SINGLE SINGLE)
+1 0
+0 1
+-1 0
+0 -1
+2 0
+0 2
+-2 0
+0 -2
+
+1 5 6 2
+2 6 7 3
+3 7 8 4
+4 8 5 1
diff --git a/tests/deal.II/grid_tec_2.dat b/tests/deal.II/grid_tec_2.dat
new file mode 100644 (file)
index 0000000..8b63364
--- /dev/null
@@ -0,0 +1,21 @@
+# coordinates to use: x and z
+# old format of keys
+# unstructured data, point format
+TITLE = "quad Mesh File"
+VARIABLES = "X", "Y",
+ "Z"
+ZONE T="Zone-4" N=             8 E=4 C=BLACK F=FEPOINT 
+DT=(SINGLE SINGLE SINGLE )
+1 0 0
+0 0 1
+-1 0 0
+0 0 -1
+2 0 0
+0 0 2
+-2 0 0
+0 0 -2
+
+1 5 6 2
+2 6 7 3
+3 7 8 4
+4 8 5 1
diff --git a/tests/deal.II/grid_tec_3.dat b/tests/deal.II/grid_tec_3.dat
new file mode 100644 (file)
index 0000000..9dd69e3
--- /dev/null
@@ -0,0 +1,19 @@
+# coordinates x and y
+# new format of keys
+# structured data (duplicated vertices), block format
+
+TITLE = "quad Mesh File"
+VARIABLES = "X", "Y"
+ZONE T="Zone-4" I=5 J=2 C=BLACK DATAPACKING=BLOCK ZONETYPE=ORDERED
+DT=(SINGLE SINGLE)
+1 0 -1 0 1 
+2 
+0 
+-2
+0 2
+
+0 1 0 -1 0
+0 
+2 
+ 0 -2
+0
diff --git a/tests/deal.II/grid_tec_4.dat b/tests/deal.II/grid_tec_4.dat
new file mode 100644 (file)
index 0000000..859d61d
--- /dev/null
@@ -0,0 +1,18 @@
+# coordinates to use: x and z
+# old format of keys
+# unstructured data, block format
+TITLE = "quad Mesh File"
+VARIABLES = "X", "Y",
+ "Z"
+ZONE T="Zone-4" N=             8 E=4 C=BLACK F=FEBlock 
+DT=(SINGLE SINGLE SINGLE )
+1 0 -1 0 
+2 0 -2 0 
+0 0 0 0 0 0 0 0
+0 1 0 -1
+0 2 0 -2
+
+1 5 6 2
+2 6 7 3
+3 7 8 4
+4 8 5 1

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.