[Dune] Local node numbering in Dune

Ganesh Diwan gcdiwan83 at gmail.com
Fri Apr 10 15:09:09 CEST 2015


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 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
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150410/65984297/attachment.htm>


More information about the Dune mailing list