[Dune] questions about ElementID_to_physical_entity

Jö Fahlke jorrit at jorrit.de
Wed Apr 13 14:57:12 CEST 2011


Am Wed, 13. Apr 2011, 11:54:35 +0200 schrieb Alexander Schlaich:
> thanks for your advice.
> 
> Using insert_boundary_segments = true works fine.
> Could please explain to me shortly what exactly this option does and
> why it works?

I don't really know myself for certain, but my guess is as follows: with
insert_boundary_segments = false, the GmshReader will ignore any boundary
elements given in the .msh file.  The GridFactory (or the grid) will instead
figure out the boundary elements by itself.  As a consequence
factory.wasInserted() should be false for all boundary intersections (which
you didn't check AFAICT).  boundaryIndexToEntity may or may not be empty after
gmshreader.read() (it *should* be empty IMO but you never know).

So there were probably two places where your program used garbage return
values: the return value of factory.insertionIndex(), which is undefined for
boundary intersections that weren't actually inserted, and pg[<anything>]
which is undefined because pg is of zero size.  Even if pg happened to contain
something, factory.insertionIndex() was used as a subscript, and since that is
undefined there is no guarantee that factory.insertionIndex() < pg.size().

Bye,
Jö.

-- 
Kiss a non-smoker; taste the difference.
-- fortune
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110413/79be0ed0/attachment.sig>


More information about the Dune mailing list