[Dune] How to iterate over Process Boundary edges

Aleksejs Fomins aleksejs.fomins at lspr.ch
Fri Apr 10 13:03:17 CEST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Martin,

Sorry, I think I have mislead you. Ghost element and an Interior element are the same as what they mean in Dune.

According to the picture in dune-grid-howto, the faces and edges shared by Interior and Ghost at the same time are considered Border.

So in Dune-terminology, I would like to iterate over all edges on partition Border, and select only those that are found on multiple processors (ProcessorBoundary), excluding the ones that are found only on one process (DomainBoundary).

Regards,
Aleksejs




On 10/04/15 12:48, Martin Nolte wrote:
> Hi Aleksejs,
> 
> ok, so in your definition a ghost element is on the process boundary? That's a nut. What about a communication to find out?
> 
> Best,
> 
> Martin
> 
> On 04/10/2015 12:33 PM, Aleksejs Fomins wrote:
> Dear Martin,
> 
> Thank you very much for your reply,
> 
> This code will iterate over edges on partition type border.
> 
> I want to iterate over all edges that are shared by 2 or more processes, I call them ProcessBoundary
> 
> To be honest, I am not even sure if ProcessBoundaries are Interior or Border partition.
> 
> Could you please clarify,
> Aleksejs
> 
> 
> 
> 
> 
> I am sorry if I sounded rude. I did not mean to. Just that sometimes I get replies like "read this url", which I find a bit mean.
> 
> 
> On 10/04/15 11:18, Martin Nolte wrote:
>>>> Hi Aleksejs,
>>>>
>>>> given your introduction, I hardly dare answering. So please excuse me, if I got your question wrong of give you just another inefficient of ineffective answer.
>>>>
>>>> As far as I understand your question, you seek all edges with partition type "border", so the code could look like
>>>>
>>>> for( const auto &edge : edges( gridView, Partitions::interiorBorder ) )
>>>> {
>>>>    if( edge.partitionType() != BorderEntity )
>>>>      continue;
>>>>
>>>>    // do whatever you need to do on an edge on the process border
>>>> }
>>>>
>>>> Best,
>>>>
>>>> Martin
>>>>
>>>> On 04/10/2015 10:56 AM, Aleksejs Fomins wrote:
>>>> Dear Dune,
>>>>
>>>> I know I have asked this question about a hundred times now, but I would really like to get a consistent answer on it, and so far I was always sent off to read the Intersection documentation which I can probably recite with closed eyes by now.
>>>>
>>>> I want to iterate over all edges that are on the process boundary and do something with them. I have a certain diagnostics routine which does only that and nothing else.
>>>>
>>>> Currently employed method:
>>>> 1.1) Iterate over all elements
>>>> 1.2) Iterate over all intersections
>>>> 1.3) Check if the outside element of the intersection is a Ghost
>>>> 1.4) If yes, extract all edges associated with the intersection as subentities of the face.
>>>> 1.5) Do sth with extracted edges
>>>>
>>>> The problem with this code, disregarding the fact that it is clumsy, is also that it is very inefficient.
>>>> Even though in my special case I am only interested in process boundary edges, this algorithm effectively iterates
>>>> * Once over all elements,
>>>> * twice over all faces (because all internal intersections are visited twice)
>>>> * and twice over all process boundary edges (because most PB edges are shared by two PB faces)
>>>>
>>>> So this code is approx 5 times slower than this hypothetical straightforward code
>>>> 2.1) Iterate over all edges (entities of codim 2)
>>>> 2.2) Find out if this edge is on a process boundary in constant time
>>>> 2.3) If yes, do sth with this edge
>>>>
>>>> The question is if it is possible to do 2.2 and if yes then how?
>>>>
>>>> Regards,
>>>> Aleksejs
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJVJ631AAoJEDkNM7UOEwMZqLUP/3Caa7g2/v0kOsIo6lHXflxf
ZPcsgrEkc/eYB+HGC3EWqTzgz9P2TNnko6/igxHyzdridf/RoCJn72llDUxZpaCz
tQENTvwCHKHfYQ2TJW2uTpYET8Da1HV5amEQ/U7kGmfzX8RWv8f61rw+SqMr45bK
sgTa0zV1gT5LGypBeeeGIddFwhvafXp/JQz/3Vd7R6vCMUzsaJJAVeAYEl6TCK7K
5CpaRqPoH+7RvoPaTUZiZsI0R5H+57EtbqY210gMHUOhaSVfTMwmW0u8dMICPQFM
mdFLKSUm+yx8Wyg2D571qYrwgzc5w1LhnB8tIcj4s++Z6UxTy+UNjwxbWjHaY/3J
je73Bqa/6joAVkp0/mzXgjrT+kwTGC03KjInK9vUFGD0zB/azhxWfoiy2CRZbWKZ
C2WObH7dm+stkNcwiQVcQ78E9UuCyrlWOrD7nOT8b9Z3YQd5EL4cDcSmwrvbuQEe
2R+9+0qxcNG0zQrwUCHQ8yOlUaDKHQ9My2BViTcRjWMCrNJTmqMWDM6B6xLdkyOF
52msn9EChytmGmaYiGXwJgfNtcpnERC1xdIAAOwQ6gvjzsTGzUXIJ/56n0bJjc2C
9V/ZEhhSkaObnZXZRK+p4ZMYsuJMe2V1sxAdfH8be9A+U6DfO5wKc9WioZbRigXe
zAhx7k1hNI01V3XlXz6/
=FgsY
-----END PGP SIGNATURE-----




More information about the Dune mailing list