[Dune] Usage of insertBoundary to set ID boundaries

Martin Nolte nolte at mathematik.uni-freiburg.de
Thu Feb 13 17:54:15 CET 2014


Hi Andrea,

the source of your confusion seems to be the "insertBoundary" method. This 
method is _not_ part of the official GridFactory interface, but is unique to 
the AlbertaGrid implementation. Usually, it is only called from the 
AlbertaGrid's DGFGridFactory. The interface method is called 
insertBoundarySegment.

Just a few words on the difference:

insertBoundary takes an element index, a face number (might be the old DUNE 
numbering), and a boundary id (integer in 1, ..., 127). This is the easiest 
(and fastest) way to attach the boundaryId to an AlbertaGrid. However, 
boundary ids are deprecated. Important: Using this method you will _not_ be 
able to obtain an insertion index!

insertBoundarySegment takes a vector of vertex indices (in insertion order). 
This mehtod only serves the purpose to allow for calling the insertionIndex 
method. Note that there is a variant taking a boundary parametrization. To be 
fair: This method is a bit slower (and internally more complicated) than using 
insertBoundary. But its only setup-time anyway.

Both methods must be called before grid creation.

I would recommend using the insertBoundarySegment + insertionIndex technique 
described by Andreas. This is the official way of attaching data to boundary 
segments. If you really want a solution specific to AlbertaGrid, you can use 
insertBoundary + boundaryId (requires experimental grid extensions). However, 
I can give no guarantees on how long this method will be supported or whether 
there will be a grace period before a potential removal of these methods.

I hope this explains the internal stuff a bit. You might want to consider 
restricting yourself to the official interface documentation in the future.

Best,

Martin

On 02/13/2014 03:52 PM, Sacconi, Andrea wrote:
> Hi both Andreas,
>
> I agree with you.
> I was perplexed, but I didn't say anything before. The reason is, in Andreas's (Buhr) previous post the usage of insertBoundary was not mentioned before the creation of the grid. My perplexity came from there.
>
> Anyway, now I will change the code. The only task, now, is to find somewhere the correct localFaceIndex and pass it to the method in question.
>
> 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: Andreas Buhr [andreas at andreasbuhr.de]
> Sent: 13 February 2014 14:39
> To: Sacconi, Andrea; dune at dune-project.org
> Subject: Re: [Dune] Usage of insertBoundary to set ID boundaries
>
> On 02/13/2014 01:39 PM, Sacconi, Andrea wrote:
>> The problem is here: I did as you do, but when I call (_after_ the
>> creation of the grid)
>
> Hi,
>
> well, I guess the grid factory does not care about what you give to it
> after grid creation?!
>
> Does this make sense?
>
> Best,
> Andreas
>
> _______________________________________________
> 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