[Dune] Re: ug intersection methods

Oliver Sander sander at mi.fu-berlin.de
Fri May 5 14:04:08 CEST 2006


Hi Sreejith!
It seems to me that this is not an actual bug in UGGrid.  I think
the reason is that, when implementing UGGrid, I interpreted an
ambiguity in the definition of intersectionSelfLocal() and
intersectionSelfGlobal() differently from the implementors
of SGrid.

The specification says:
'intersectionSelfLocal () const
geometrical information about this intersection in local 
coordinates of the inside() entity. This method returns a Geometry object 
that provides a mapping from local coordinates of the intersection to 
local coordinates of the inside() entity.'

and analogously for intersectionNeighborLocal().  However, this
is not completely precise.  First of all, it doesn't say anything
about the orientation of the intersection wrt the element.  Secondly,
with a given orientation I have to pick one cyclic permutation of
the vertices of the intersection.

Since I've mostly worked with UG I tend to think in conforming meshes.
Therefore, I implemented intersection...Local() such that the returned
geometry corresponds to the corresponding subface of the element.
In particular, this means the return value of intersectionSelfLocal()
is oriented differently from the return value of 
intersectionNeighborLocal().  That is why you don't get the same
world coordinate for the local coordinate 0.25.  You would get the
same if you chose 0.25 on one side and 0.75 on the other.

Note that this problem also occurs with intersectionGlobal().
No orientation is specified.

This may be painful but I am afraid we have to come up with a
precise specification of the intersection...() methods.

Hope this helps,
Oliver

************************************************************************
* Oliver Sander                ** email: sander at mi.fu-berlin.de        *
* Freie Universität Berlin     ** phone: + 49 (30) 838 75217           *
* Institut für Mathematik II   ** URL  : page.mi.fu-berlin.de/~sander  *
* Arnimallee 2-6               ** -------------------------------------*
* 14195 Berlin, Germany        ** Member of MATHEON (www.matheon.de)   *
************************************************************************

On Fri, 5 May 2006, Sreejith Pulloor Kuttanikkad wrote:

> Dear Oliver,
>
> Sorry to take some of your time.
>
> I am just attaching a sample code and the quad2elms.am file.
>
> i have tested on same grid (unit square divided into a upper and lower
> half) with only one intersection (edge).
>
>
> i assuming a local point on interioredge (1D) : 0.25 and the global
> coords then should be (0.25,0.5)
> then when i run the code the following is the result for diff grids:
>
> for sgrid:
>
> gtface: (cube, 1) gtnbface: (cube, 1)
> local: 0.25 face_self_local: 0.25 1  face_neighbor_local: 0.25 0
> glob:0.25 0.5
> gtface: (cube, 1) gtnbface: (cube, 1)
> local: 0.25 face_self_local: 0.25 0  face_neighbor_local: 0.25 1
> glob:0.25 0.5
>
>
> for ug:
>
> UGGrid<2,2> with grid file: quadgrid2elms.am
>
> AmiraMesh contains 6 nodes and 2 elements
> amiraloadmesh: 2 elements created
> gtface: (simplex, 1) gtnbface: (simplex, 1)
> local: 0.25 face_self_local: 0.75 1  face_neighbor_local: 0.25 0
> glob:0.75 0.5
> gtface: (simplex, 1) gtnbface: (simplex, 1)
> local: 0.25 face_self_local: 0.25 0  face_neighbor_local: 0.75 1
> glob:0.25 0.5
>
>
> if you look at, ug gives wrong global coords? am i right ? or did i
> confused somewhere. and also the selflocal and neighborlocal ???
>
> please also note ug is printing the geometry type of edge as (simplex,1)
> instead of (cube,1)
>
>
> please have a look when you get some time.
>
> thanks,
> Sreejith
>
>
>
>
>
>
> On Fri, May 05, 2006 at 09:55:42AM +0200, Oliver Sander wrote:
>> Hi Sreejith!
>> I have never used those methods myself.  Maybe they are buggy.
>>
>> If your code is working with SGrid, why don't you run the same
>> example with the same grid but using a UGGrid?  Then you can
>> compare and see where the differences occur.
>>
>> Let me know if you find a bug in UGGrid and I'll try to fix it
>> as soon as possible.
>>
>> --
>> Oliver
>>
>> ************************************************************************
>> * Oliver Sander                ** email: sander at mi.fu-berlin.de        *
>> * Freie Universit?t Berlin     ** phone: + 49 (30) 838 75217           *
>> * Institut f?r Mathematik II   ** URL  : page.mi.fu-berlin.de/~sander  *
>> * Arnimallee 2-6               ** -------------------------------------*
>> * 14195 Berlin, Germany        ** Member of MATHEON (www.matheon.de)   *
>> ************************************************************************
>>
>> On Thu, 4 May 2006, Sreejith Pulloor Kuttanikkad wrote:
>>
>>> Dear Oliver,
>>>
>>> Sorry .. I am again.
>>> I have a doubt if the methods intersectionSelfLocal() and
>>> intersectionNeighborLocal() in ug grid is
>>> correct or not? because when i test with sgrid and alberta, i am getting
>>> correct results and but not with ug grid. and when checked i found that
>>> when evaluating some integrals on intersection (edge or face), ug
>>> gives different value frm sgrid or alberta. i dont know if the bug is
>>> somewhere else but would like to make sure that the above methods are
>>> correct.
>>> do u know a simple way of testing to know the method is correct?
>>>
>>> Thanks,
>>> Sreejith
>>>
>>> --
>>> Sreejith P. Kuttanikkad
>>> IWR, University of Heidelberg
>>> Room:009, Im Neuenheimer Feld-348
>>> 69120 Heidelberg,Germany.
>>> Ph :+49-6221-54-5689/4412(Office)
>>>  :+49-(0)17624228904(Mob)
>>> http://hal.iwr.uni-heidelberg.de/~sreejith/
>>> -------------------------------------------
>>>
>
>
> -- 
> Sreejith P. Kuttanikkad
> IWR, University of Heidelberg
> Room:009, Im Neuenheimer Feld-348
> 69120 Heidelberg,Germany.
> Ph :+49-6221-54-5689/4412(Office)
>   :+49-(0)17624228904(Mob)
> http://hal.iwr.uni-heidelberg.de/~sreejith/
> -------------------------------------------
>


More information about the Dune mailing list