From: bangerth
Date: Wed, 5 Nov 2008 19:20:38 +0000 (+0000)
Subject: Fix a problem in the GMSH reader with type-15 cells (nodes) where we failed to read...
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e158587a01050a1c4a7848bb9a864a5793519f32;p=dealii-svn.git
Fix a problem in the GMSH reader with type-15 cells (nodes) where we failed to read the vertices.
git-svn-id: https://svn.dealii.org/trunk@17477 0785d39b-7218-0410-832d-ea1e28bc413d
---
diff --git a/deal.II/deal.II/source/grid/grid_in.cc b/deal.II/deal.II/source/grid/grid_in.cc
index ad0c805f71..90b9098225 100644
--- a/deal.II/deal.II/source/grid/grid_in.cc
+++ b/deal.II/deal.II/source/grid/grid_in.cc
@@ -802,6 +802,11 @@ void GridIn::read_msh (std::istream &in)
if (cell_type == 15)
{
// Ignore vertices
+ // but read the
+ // number of nodes
+ // given
+ for (unsigned int i=0; i> dummy;
}
else
// cannot read this
diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h
index 0b0fcb4bf2..30edd5512c 100644
--- a/deal.II/doc/news/changes.h
+++ b/deal.II/doc/news/changes.h
@@ -152,7 +152,7 @@ inconvenience this causes.
-
+
Updated: The version of the BOOST
library that is in the contrib/
directory and is used in
@@ -422,6 +422,15 @@ inconvenience this causes.
deal.II
+ -
+
+ Fixed: The GridIn::read_msh function had a bug that made it reject
+ MSH input files if they contained type-15 cells with more than one
+ associated vertex.
+
+ (WB 2008/11/05)
+
+
-
Fixed: The DoFRenumbering::Cuthill_McKee algorithm had a bug when applied
diff --git a/tests/deal.II/grid_in_msh_02.cc b/tests/deal.II/grid_in_msh_02.cc
new file mode 100644
index 0000000000..17b7020bb3
--- /dev/null
+++ b/tests/deal.II/grid_in_msh_02.cc
@@ -0,0 +1,70 @@
+//---------------------------- grid_in_msh_02.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 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_msh_02.cc ---------------------------
+
+// read a file in the MSH format used by the GMSH program. this
+// particular mesh has type-15 cells (nodes) with more than one
+// associated vertex. we failed to read the vertices
+
+#include "../tests.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+std::ofstream logfile("grid_in_msh_02/output");
+
+
+template
+void check_file (const std::string name,
+ typename GridIn::Format format)
+{
+ Triangulation tria;
+ GridIn gi;
+ gi.attach_triangulation (tria);
+ gi.read(name, format);
+ deallog << name
+ << '\t' << tria.n_vertices()
+ << '\t' << tria.n_cells()
+ << std::endl;
+
+ GridOut grid_out;
+ grid_out.write_gnuplot (tria, deallog.get_file_stream());
+}
+
+void filename_resolution()
+{
+ check_file<2> (std::string("grid_in_msh_02/mesh"), GridIn<2>::msh);
+}
+
+
+int main ()
+{
+ deallog << std::setprecision (2);
+ logfile << std::setprecision (2);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ filename_resolution();
+}
+
diff --git a/tests/deal.II/grid_in_msh_02/cmp/generic b/tests/deal.II/grid_in_msh_02/cmp/generic
new file mode 100644
index 0000000000..e9630d833e
--- /dev/null
+++ b/tests/deal.II/grid_in_msh_02/cmp/generic
@@ -0,0 +1,128 @@
+
+DEAL::grid_in_msh_02/mesh 28 18
+2.0e+03 0.0 0 0
+2.0e+03 6.7e+02 0 0
+1.4e+03 5.0e+02 0 0
+1.5e+03 0.0 0 0
+2.0e+03 0.0 0 0
+
+
+1.5e+03 0.0 0 0
+1.4e+03 5.0e+02 0 0
+9.6e+02 4.0e+02 0 0
+1.0e+03 0.0 0 0
+1.5e+03 0.0 0 0
+
+
+1.0e+03 0.0 0 0
+9.6e+02 4.0e+02 0 0
+5.0e+02 3.3e+02 0 0
+5.0e+02 0.0 0 0
+1.0e+03 0.0 0 0
+
+
+2.0e+03 6.7e+02 0 0
+2.0e+03 1.3e+03 0 0
+1.4e+03 9.6e+02 0 0
+1.4e+03 5.0e+02 0 0
+2.0e+03 6.7e+02 0 0
+
+
+1.4e+03 5.0e+02 0 0
+1.4e+03 9.6e+02 0 0
+9.0e+02 7.8e+02 0 0
+9.6e+02 4.0e+02 0 0
+1.4e+03 5.0e+02 0 0
+
+
+9.6e+02 4.0e+02 0 0
+9.0e+02 7.8e+02 0 0
+5.0e+02 6.7e+02 0 0
+5.0e+02 3.3e+02 0 0
+9.6e+02 4.0e+02 0 0
+
+
+2.0e+03 1.3e+03 0 0
+2.0e+03 2.0e+03 0 0
+1.2e+03 1.3e+03 0 0
+1.4e+03 9.6e+02 0 0
+2.0e+03 1.3e+03 0 0
+
+
+1.4e+03 9.6e+02 0 0
+1.2e+03 1.3e+03 0 0
+7.9e+02 1.1e+03 0 0
+9.0e+02 7.8e+02 0 0
+1.4e+03 9.6e+02 0 0
+
+
+9.0e+02 7.8e+02 0 0
+7.9e+02 1.1e+03 0 0
+5.0e+02 1.0e+03 0 0
+5.0e+02 6.7e+02 0 0
+9.0e+02 7.8e+02 0 0
+
+
+2.0e+03 2.0e+03 0 0
+1.3e+03 2.0e+03 0 0
+8.4e+02 1.6e+03 0 0
+1.2e+03 1.3e+03 0 0
+2.0e+03 2.0e+03 0 0
+
+
+1.2e+03 1.3e+03 0 0
+8.4e+02 1.6e+03 0 0
+6.0e+02 1.4e+03 0 0
+7.9e+02 1.1e+03 0 0
+1.2e+03 1.3e+03 0 0
+
+
+7.9e+02 1.1e+03 0 0
+6.0e+02 1.4e+03 0 0
+4.3e+02 1.2e+03 0 0
+5.0e+02 1.0e+03 0 0
+7.9e+02 1.1e+03 0 0
+
+
+1.3e+03 2.0e+03 0 0
+6.7e+02 2.0e+03 0 0
+4.4e+02 1.8e+03 0 0
+8.4e+02 1.6e+03 0 0
+1.3e+03 2.0e+03 0 0
+
+
+8.4e+02 1.6e+03 0 0
+4.4e+02 1.8e+03 0 0
+3.3e+02 1.6e+03 0 0
+6.0e+02 1.4e+03 0 0
+8.4e+02 1.6e+03 0 0
+
+
+6.0e+02 1.4e+03 0 0
+3.3e+02 1.6e+03 0 0
+2.5e+02 1.4e+03 0 0
+4.3e+02 1.2e+03 0 0
+6.0e+02 1.4e+03 0 0
+
+
+6.7e+02 2.0e+03 0 0
+0.0 2.0e+03 0 0
+0.0 1.8e+03 0 0
+4.4e+02 1.8e+03 0 0
+6.7e+02 2.0e+03 0 0
+
+
+4.4e+02 1.8e+03 0 0
+0.0 1.8e+03 0 0
+0.0 1.7e+03 0 0
+3.3e+02 1.6e+03 0 0
+4.4e+02 1.8e+03 0 0
+
+
+3.3e+02 1.6e+03 0 0
+0.0 1.7e+03 0 0
+0.0 1.5e+03 0 0
+2.5e+02 1.4e+03 0 0
+3.3e+02 1.6e+03 0 0
+
+
diff --git a/tests/deal.II/grid_in_msh_02/mesh.msh b/tests/deal.II/grid_in_msh_02/mesh.msh
new file mode 100644
index 0000000000..7c5fc1fa45
--- /dev/null
+++ b/tests/deal.II/grid_in_msh_02/mesh.msh
@@ -0,0 +1,78 @@
+$NOD
+29
+1 0 1000 0
+2 500 1000 0
+3 500 0 0
+4 2000 0 0
+5 2000 2000 0
+6 0 2000 0
+7 0 1500 0
+8 249.9999999986911 1433.012701892975 0
+9 433.012701892244 1249.999999999957 0
+10 500 666.6666666667851 0
+11 500 333.3333333332149 0
+12 999.9999999971578 0 0
+13 1499.999999997632 0 0
+14 2000 666.6666666658045 0
+15 2000 1333.333333333021 0
+16 1333.33333333357 2000 0
+17 666.6666666664298 2000 0
+18 0 1833.333333333807 0
+19 0 1666.666666666193 0
+20 1448.855824064164 495.717915423294 0
+21 959.9856402214641 398.3668079907822 0
+22 1351.673876195213 956.2359119432751 0
+23 898.2810558340404 779.8687519422836 0
+24 1160.681109470998 1341.402689062506 0
+25 787.3265082283497 1124.849859227498 0
+26 835.3482117692673 1592.930027561749 0
+27 599.1617013501501 1393.190760419901 0
+28 444.6735536553252 1756.412694406243 0
+29 330.6069773257424 1578.577143704019 0
+$ENDNOD
+$ELM
+43
+1 15 0 1 1 1
+2 15 0 2 1 2
+3 15 0 3 1 3
+4 15 0 4 1 4
+5 15 0 5 1 5
+6 15 0 6 1 6
+7 15 0 7 1 7
+8 1 0 1 2 7 8
+9 1 0 1 2 8 9
+10 1 0 1 2 9 2
+11 1 0 2 2 2 10
+12 1 0 2 2 10 11
+13 1 0 2 2 11 3
+14 1 0 3 2 3 12
+15 1 0 3 2 12 13
+16 1 0 3 2 13 4
+17 1 0 4 2 4 14
+18 1 0 4 2 14 15
+19 1 0 4 2 15 5
+20 1 0 5 2 5 16
+21 1 0 5 2 16 17
+22 1 0 5 2 17 6
+23 1 0 6 2 6 18
+24 1 0 6 2 18 19
+25 1 0 6 2 19 7
+26 3 0 8 4 4 14 20 13
+27 3 0 8 4 13 20 21 12
+28 3 0 8 4 12 21 11 3
+29 3 0 8 4 14 15 22 20
+30 3 0 8 4 20 22 23 21
+31 3 0 8 4 21 23 10 11
+32 3 0 8 4 15 5 24 22
+33 3 0 8 4 22 24 25 23
+34 3 0 8 4 23 25 2 10
+35 3 0 8 4 5 16 26 24
+36 3 0 8 4 24 26 27 25
+37 3 0 8 4 25 27 9 2
+38 3 0 8 4 16 17 28 26
+39 3 0 8 4 26 28 29 27
+40 3 0 8 4 27 29 8 9
+41 3 0 8 4 17 6 18 28
+42 3 0 8 4 28 18 19 29
+43 3 0 8 4 29 19 7 8
+$ENDELM
\ No newline at end of file