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

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Mon Jun 11 11:59:10 CEST 2012


Hi Martin,

thanks for your help. I have just tried to generate the DGF file using utility gmsh2dgf, and the file is created properly.
Unfortunately, if I try to import it for generating a ALUSimplexGrid<2, 3> problems still occur, the same already mentioned in my previous message.

I'd like to try with ALBERTAGRID, but I can't manage to use the GridSelector.
I confess it's something I have never understood fully, in the sense that when I try to switch from one grid manager to another, expecting that the same lines of code could work in the same way, I still encounter a problem.

When I use ALUSimplexGrid, I type:

#define ALUGRID_SIMPLEX
#define GRIDDIM 2
#define GRIDWORLD 3

at the beginning of my .cc file, then I call

typedef Dune::GridSelector::GridType GridType;

and everything works fine.
What do I have to do to switch to ALBERTAGRID?
Changing 

#define ALBERTAGRID

doesn't work. Where am I wrong??????

Thanks a lot!

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

________________________________________
From: dune-bounces+a.sacconi11=imperial.ac.uk at dune-project.org [dune-bounces+a.sacconi11=imperial.ac.uk at dune-project.org] on behalf of Martin Nolte [nolte at mathematik.uni-freiburg.de]
Sent: 07 June 2012 10:34
To: dune at dune-project.org
Subject: Re: [Dune] GMSH reader fails in reading the same file for ALUSimplexGrid<2, 3> and not ALUSimplexGrid<3, 3>

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

make GRIDTYPE=ALBERTAGRID GRIDDIM=2 WORLDDIM=3

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.

Best,

Martin


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 ALUGRID_SIMPLEX
> #define GRIDDIM 3
> #define GRIDWORLD 3
>
> everything works properly.
>
> Instead, if I modify
>
> #define ALUGRID_SIMPLEX
> #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




More information about the Dune mailing list