[Dune] How to iterate over Process Boundary edges
Martin Nolte
nolte at mathematik.uni-freiburg.de
Fri Apr 10 12:48:23 CEST 2015
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:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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
>>>
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iQIcBAEBAgAGBQJVJ6b6AAoJEDkNM7UOEwMZdicP/jWrqi01WOE1bwzODuUYAbsV
> nFZXZh6HyHKeBSbEEFsWfdwlvj7rP+nn0Q9WP9kcRQYYxtIPY0IQ3exxMVuj0JMx
> eVUbMOYQcD2GQY99kyk4nC7mOYw4lye8fNwO8uY9eEI5jtQdg7RD+aq8XcO/NqIf
> QNXnAaKPYd4kj47YaeJYhtz/vMjYIlyE9inSY/xNLCtR/jokpTS6xfxTxGzyU1E9
> prXkcmr4VTx7nmeZwHQDiKNkvkU7T01zFwV36txyntDq9PBZZdD0W2FiDTptPJsm
> YKt3VzcOcaQtQr61vI6WbeQ8iB9o4QRk1HlxaaumvA6SoMu96gCb7ZAScqxGvLng
> R1zdXN/7leAdMdxlRFRqlTb7Fouep4R7O1ZYfMEi06m0CqcSRseDY2SOWwD5eh6l
> soOGKwet91K6nkyPBe11AowFJ7LU4RO0XGjGV2rCcZcYt1aZN/jJf9iPavaTGD8g
> 5VIiOTbxrjiOsJBcoi9UYrvJkqvhZjs5eqYeQJdsyk1TnDrS+bYKGoeUzkxP1WqH
> Q21hCOQaet2t4czeDGLjB+8oDhfxiAHAOUQMatmadLvY3Lig5YrEFL0Z6a8X0axm
> JlXjxFQt+uWdVd3ttQd1H5yul2u7QmNfCw15GSjKmZ2mhKgGbAJBd3CzodW4MJPl
> ZqSfs81l5kinb3ADinQk
> =sk3R
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> 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