[Dune] Usage of insertBoundary to set ID boundaries

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Thu Feb 13 18:10:21 CET 2014


Hi Martin,

thanks a lot for your detailed explanation! I realise that using this "insertBoundary" method available only for Alberta is a bit limiting, since it does not allow me to reuse the code with another grid manager.

Since you mentioned it, I am aware that the boundary IDs are deprecated and could be eliminated in the future. This presents to me (and I guess to many other users) the old question: how do I prescribe/attach the boundary conditions into the code? In particular, the IDs on the intersections (and _not_ on the vertex) prove so far to be quite effective. You can specify them directly on the DGF file and everything is handled correctly, once you have coded how to deal with the different tags. In addition, if you refine the macrogrid, the tags are correctly assigned to all the newly-created intersections, given the tag of their father entity.

If the support is dropped for these deprecated IDs, I guess that there will be another clever way for handling the boundary conditions, the refinement issue that would naturally arise, etc.

Thanks again for your answer!
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: dune-bounces+a.sacconi11=imperial.ac.uk at dune-project.org [dune-bounces+a.sacconi11=imperial.ac.uk at dune-project.org] on behalf of Martin Nolte [nolte at mathematik.uni-freiburg.de]
Sent: 13 February 2014 16:54
To: Dune
Subject: Re: [Dune] Usage of insertBoundary to set ID boundaries

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

_______________________________________________
Dune mailing list
Dune at dune-project.org
http://lists.dune-project.org/mailman/listinfo/dune




More information about the Dune mailing list