[Dune] questions about ElementID_to_physical_entity

Jayesh Badwaik jayeshb.work at gmail.com
Sat Apr 9 12:09:48 CEST 2011


Hi,
thanks for your help
the code is working properly now.

I was using the Dune::GridPtr<Grid> before as you had suspected.
I actually got that idea from the dune-pdelab-howto manual
where they are using the same thing.
especially the crankdiffusion problem (listing 16).



Cheers and Regards,
Jayesh Vinay Badwaik
-----------------------------------------------------------------------------------------------------------

We are servants rather than masters in mathematics   --- Charles Hermite






On Sat, Apr 9, 2011 at 15:10, Jö Fahlke <jorrit at jorrit.de> wrote:

> Am Sat,  9. Apr 2011, 14:32:31 +0530 schrieb Jayesh Badwaik:
> > i am trying to use elementid_to_physical_entity feature of the gmsh
> reader
> > and the code i'm using is as follows
> >
> > std::vector<int>    boundaryid;
> > std::vector<int>    elementid;
> > GridReader gridreader;
> > GridPointer gridptr =  gridreader.read(gridfile, boundaryid, elementid,
> > true, true);
>
> I'm assuming GridPointer is something like Grid*, specifically that it is
> *not* something like Dune::GridPtr<Grid>.
>
> The problem is probably that the GmshReader stores the element and boundary
> ids in the order the elements and boundary segments were inserted into the
> grid.  Of course, you cannot know this order.  You can however obtain it
> from
> the gridfactory the GmshReader uses to insert the mesh elements:
>
>  Dune::GmshReader<Grid> gridreader;
>  Dune::GridFactory<Grid> factory;
>  gridreader.read(factory, gridfile, boundaryid, elementid, true, true);
>  Grid *gridptr = factory.create();
>
> and later
>
>  int eid = elementid[factory.insertionIndex(element)];
>  int bid = 0;
>  if(factory.wasInserted(intersection))
>    bid = boundaryid[factory.insertionIndex(intersection)];
>
> Note that calling insertionIndex() is only valid as long as you didn't
> change
> the grid since creation -- i.e. no globalRefine(), no adapt(), no
> loadBalance().
>
> @Dune: what is the purpose of those GmshReader::read() methods that fill
>       element and boundary id but don't take a GidFactory?
>
> Bye,
> Jö.
>
> --
> If God had intended Man to Smoke, He would have set him on Fire.
> -- fortune
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iQIVAwUBTaApcemx9CKgc0OWAQjORxAAntWZMhdflziPqOAOXa4Bnms4twnF/g9L
> u4TWBh4VpQkBjyX28+sKe3/atHosPDsFR+o6lHI9zJyxusLxrMTbZ0r775JE2U2w
> 1jhuV0gzqJqhVOeQngIvGYkxSpjj1SBlYkvGveLqfVIiuK6+PGjzlJLKm7g0jGsA
> jHawwYJBtygmjcgzp8PkvBwWCyGM23faIwUXgeT12OudkssSdw2ffRiZVVZey51w
> idrHUTOitKoK9WaKckeYXbCuP2kUINgkCNY83pgUDMQ07PDEExQA0EqbHOZHycHW
> vtla84KeJyyaWKydT1Mups9gcbLTuwxt6KlffCins381gB1IJz/mZl7Q0oOHJTLD
> 2WnHUKnpAigKxpI9GgFFlmr/ajo27JMcG7sx24l+hzk1eIdqRfa38uFv08yR79Nx
> EQ7c1MFR887xYtIDHpotaiXnXPHNhEad60IAfUQEv25jy+0cgIgKJGPXTUtmvKEs
> SXphqrX+cgCho7uadUPf4RvwoHhKp8n5f9txTZACz7ZhiW2UvJkuE3CWSRVxVLBE
> SU+zuOlkvhYcc8hxEps6OLIcFtQuHgnM88RyaQrCSvC4Y7N7DnPbYCAD/0pK6ByY
> z6Ay2XzlMw8SSM+lBbMH5meeblq4nEobBI0ZEfXdb29qVkcsSsoxJyMBmVyFuW4M
> cNdWEUABNu0=
> =yGSV
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110409/47267b9d/attachment.htm>


More information about the Dune mailing list