[Dune] Local node numbering in Dune

Ganesh Diwan gcdiwan83 at gmail.com
Mon Apr 13 11:33:49 CEST 2015


Hi Jo

I'm sorry, you appear to have included the wrong version of MeshTraversal in
> your mail.  At least I cannot see how it could have produced the output
> above,
> since it does not contain the string "my face".
>

My apologies for the confusion. I should have pasted the precise output
from my code, here it is:


//
-------------------------------------------------------------------------------------------------
dimension of the grid is: 2
visiting element 1(cube, 2)
visiting face 1(simplex, 1)
node 1 for face 1 is 1 0
node 2 for face 1 is 1 1
visiting face 2(simplex, 1)
node 1 for face 2 is 0 1
node 2 for face 2 is 1 1
visiting face 3(simplex, 1)
node 1 for face 3 is 0 0
node 2 for face 3 is 0 1
visiting face 4(simplex, 1)
node 1 for face 4 is 0 0
node 2 for face 4 is 1 0
//
-------------------------------------------------------------------------------------------------
// end of output from MeshTraversal

I hope it is clear now, please write if it is not. Also please see the mesh
data in gmsh format which I am using as input to the code above-

$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
4
1 0 0 0
2 1 0 0
3 1 1 0
4 0 1 0
$EndNodes
$Elements
9
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
4 15 2 0 4 4
5 1 2 0 1 1 2
6 1 2 0 1 2 3
7 1 2 0 1 3 4
8 1 2 0 1 4 1
9 3 2 0 6 1 2 3 4
$EndElements


Many thanks for your help,
Ganesh




On Fri, Apr 10, 2015 at 9:27 PM, Jö Fahlke <jorrit at jorrit.de> wrote:

> Am Fri, 10. Apr 2015, 14:09:09 +0100 schrieb Ganesh Diwan:
> > Date: Fri, 10 Apr 2015 14:09:09 +0100
> > From: Ganesh Diwan <gcdiwan83 at gmail.com>
> > To: Oliver Sander <sander at igpm.rwth-aachen.de>, DUNE Liste
> >  <dune at dune-project.org>
> > Subject: Re: [Dune] Local node numbering in Dune
> > X-No-Auth: unauthenticated sender
> > X-No-Relay: not in my network
> > X-Envelope-From: <gcdiwan83 at gmail.com>
> >
> > Hi Oliver
> >
> > When I loop through the element(s), I see that Dune returns element faces
> > that are in conflict with what the link above says. To be specific I get
> > my face 2 as Dune reference element face 0,
> > my face 0 as Dune reference element face 1,
> > my face 3 as Dune reference element face 2,  and
> > my face 1 as Dune reference element face 3,
> >
> > Clearly I am doing something wrong!
>
> I'm sorry, you appear to have included the wrong version of MeshTraversal
> in
> your mail.  At least I cannot see how it could have produced the output
> above,
> since it does not contain the string "my face".
>
> (In case I misunderstood and MeshTraversal was not meant to produce that
> output, please clarify how you obtained the numbers after "my face" and
> "Dune
> reference element face".)
>
> Regards,
> Jö.
>
> > I have:
> >
> > typedef Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming> GridTypeALU;
> > std::auto_ptr<GridTypeALU> mygrid( GmshReader<GridTypeALU>::read(
> > "./grids/hhgex.msh", true, true ) );
> > MeshTraversal (*mygrid); //
> >
> > and then I have MeshTraversal as:
> >
> > template<class G>
> > void MeshTraversal(G& grid) {
> >     //first we extract the dimensions of the grid
> >
> >     const int dim = G::dimension;
> >     std::cout << "dimension of the grid is: " << dim << std::endl;
> >     const int dimworld = G::dimensionworld;
> >     typedef typename G::ctype ct;
> >     typedef typename G::LeafGridView GridView;
> >
> >     typedef typename GridView::template Codim<0>::Iterator LeafIterator;
> >     typedef typename GridView::IntersectionIterator IntersectionIterator;
> >
> >     GridView gridView = grid.leafView();
> >     // get grid view on leaf part
> >
> >     LeafIterator endit = gridView.template end<0>();
> >
> >     int count = 0;
> >     //
> >     for (LeafIterator it = gridView.template begin<0>(); it != endit;
> ++it)
> > {
> >
> >         count++;
> >         Dune::GeometryType gt = it->type();
> >         //
> >         std::cout << "visiting element " << count << gt << std::endl;
> >
> >         IntersectionIterator isend = gridView.iend(*it);
> >
> >         int countface = 0;
> >         for (IntersectionIterator is = gridView.ibegin(*it); is != isend;
> >                 ++is) {
> >             countface++;
> >             Dune::GeometryType gfacet = is->type();
> >             std::cout << "visiting face " << countface << gfacet <<
> > std::endl;
> >             std::cout << "node 1 for face" << countface << " is "
> >                     << is->geometry().corner(0) << std::endl;
> >             std::cout << "node 2 for face" << countface << " is "
> >                     << is->geometry().corner(1) << std::endl;
> >             //
> >         }
> >     }
> >     std::cin.get();
> > }
> >
> >
> >
> > On Wed, Apr 8, 2015 at 3:57 PM, Ganesh Diwan <gcdiwan83 at gmail.com>
> wrote:
> >
> > > Thankyou!
> > >
> > > Ganesh
> > >
> > > On Wed, Apr 8, 2015 at 3:56 PM, Oliver Sander <
> sander at igpm.rwth-aachen.de>
> > > wrote:
> > >
> > >> Am 08.04.2015 um 16:50 schrieb Ganesh Diwan:
> > >> > Dear List
> > >> >
> > >> > It appears that after reading the grid from a Gmsh format file
> inside
> > >> Dune,
> > >> > the local dofs 2 and 3 i.e. node number 3 and 4 are swapped. This is
> > >> inside
> > >> > dune-grid//dune/grid/io/file/gmshreader.hh
> > >> >
> > >> > Is there a specific reason this is done? Is there a way to tell
> Dune to
> > >> use
> > >> > the same node numbering as in Gmsh file and not to alter it?
> > >>
> > >> Hi Ganesh,
> > >> Dune has one fixed numbering for the local node numbers of all
> reference
> > >> elements
> > >> (see
> > >>
> http://www.dune-project.org/doc/doxygen/dune-geometry-html/group___geometry_reference_elements.html
> > >> )
> > >>
> > >> These numberings differ from the ones used by gmsh, and hence the gmsh
> > >> reader
> > >> needs to do some node swapping.
> > >>
> > >> Best,
> > >> Oliver
> > >>
> > >> >
> > >> > Thankyou
> > >> > Ganesh
> > >> >
> > >> >
> > >> >
> > >> > _______________________________________________
> > >> > Dune mailing list
> > >> > Dune at dune-project.org
> > >> > http://lists.dune-project.org/mailman/listinfo/dune
> > >> >
> > >>
> > >>
> > >>
> > >> _______________________________________________
> > >> Dune mailing list
> > >> Dune at dune-project.org
> > >> http://lists.dune-project.org/mailman/listinfo/dune
> > >>
> > >>
> > >
>
> > _______________________________________________
> > Dune mailing list
> > Dune at dune-project.org
> > http://lists.dune-project.org/mailman/listinfo/dune
>
>
> --
> Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
> University of Münster, Orleans-Ring 10, D-48149 Münster
> Tel: +49 251 83 35146 Fax: +49 251 83 32729
>
> Interpunktion, Orthographie und Grammatik der Email ist frei erfunden.
> Eine Übereinstimmung mit aktuellen oder ehemaligen Regeln wäre rein
> zufällig und ist nicht beabsichtigt.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150413/798d1373/attachment.htm>


More information about the Dune mailing list