]> https://gitweb.dealii.org/ - dealii.git/commitdiff
new file type selection in GridIn
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 28 Feb 2005 01:07:17 +0000 (01:07 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 28 Feb 2005 01:07:17 +0000 (01:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@9911 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/grid_in.cc

index 5394745daa2e3fec52d9741c159d80c0e07caadf..5e209ae7a74491e7a7c792a1b509e72ecc97450c 100644 (file)
@@ -70,19 +70,25 @@ void test2 ()
 }
 
 
-// void filename_resolution()
-// {
-//   Triangulation<2> tria;
-//   GridIn<2> gi;
+template<int dim>
+void check_file (const std::string name,
+                typename GridIn<dim>::Format format)
+{
+  Triangulation<dim> tria;
+  GridIn<dim> gi;
+  gi.attach_triangulation (tria);
+  gi.read(name, format);
+  deallog << name
+         << '\t' << tria.n_vertices()
+         << '\t' << tria.n_cells()
+         << std::endl;
+}
 
-//   gi.attach_triangulation (tria);
-//   gi.read(std::string("grid_in_2d"), GridIn<2>::ucd);
-//   deallog << tria.n_vertices() << '\t' << tria.n_cells()
-//       << std::endl;
-//   gi.read(std::string("grid_in_2d"), GridIn<2>::xda);
-//   deallog << tria.n_vertices() << '\t' << tria.n_cells()
-//       << std::endl;
-// }
+void filename_resolution()
+{
+  check_file<2> (std::string("grid_in_2d.inp"), GridIn<2>::ucd);
+  check_file<2> (std::string("grid_in_2d.xda"), GridIn<2>::xda);
+}
 
 
 int main ()
@@ -94,6 +100,6 @@ int main ()
   test1<2> ();
   test2<2> ();
   
-//  filename_resolution();
+  filename_resolution();
 }
 

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.