[Dune] GMSH reader fails in reading the same file for ALUSimplexGrid<2, 3> and not ALUSimplexGrid<3, 3>

Martin Nolte nolte at mathematik.uni-freiburg.de
Thu Jun 7 11:34:50 CEST 2012

Hi Andrea,

it seems your grid actually models a sphere, i.e., a borderless surface. 
Therefore, the output you provide actually shows the error: 84 boundary 
elements. ALUGrid detects this problem and throws an exception.

Unfortunately, I cannot tell whether this is an error in your Gmsh file or in 
the Gmsh reader (but I would guess the latter).

On the upside I have a workaround for you: AlbertaGrid ignores the additional 
boundary segments. I don't know whether this should be considered a bug or a 
feature, but there it is.

So, you can convert your Gmsh file into DGF using the utility gmsh2dgf (located 
in dune-grid/dune/grid/io/file/dgfparser/utils). Simply compile it using


and call it with your Gmsh file as first argument. You should be able to read 
the resulting DGF file into ALUGrid.

For your convenience I attached the generated DGF file and a vtk output file 
showing the grid (both using AlbertaGrid).

I hope this helps a little.



On 06/06/2012 04:06 PM, Sacconi, Andrea wrote:
> Hi everyone,
> I have a problem with the GMSH reader.
> I'm trying to build a new grid by reading a .msh file (attached); ideally, the
> computational mesh should be made only of triangles located in R^3, so it can be
> interpreted either as a 3D mesh with only boundary elements or as a 2D mesh
> embedded in R^3.
> When I try the first solution, that is
> #define GRIDDIM 3
> #define GRIDWORLD 3
> everything works properly.
> Instead, if I modify
> #define GRIDDIM 2
> #define GRIDWORLD 3
> I get this error:
> Reading 2d Gmsh grid...
> version 2.2 Gmsh file detected
> file contains 304 nodes
> file contains 693 elements
> number of real vertices = 303
> number of boundary elements = 84
> number of elements = 602
> terminate called after throwing an instance of 'Dune::GridError'
> Abort trap
> Does anyone know if there are problems when passing from < 3 , 3 > to < 2 , 3> ?
> I've attached the file.
> Thanks in advance!
> Andrea
> __________________________________________________________
> Andrea Sacconi
> PhD student, Applied Mathematics
> AMMP Section, Department of Mathematics, Imperial College London,
> London SW7 2AZ, UK
> a.sacconi11 at imperial.ac.uk
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sphere_surface.dgf
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20120607/aec07190/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sphere_surface.dgf.vtu
Type: model/vnd.vtu
Size: 22273 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20120607/aec07190/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sphere_surface.msh
Type: model/mesh
Size: 33156 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20120607/aec07190/attachment-0001.msh>

More information about the Dune mailing list