PointInELement

Clearly defined bug reports and their fixes

PointInELement

Postby Franz Pichler » 14 Apr 2016, 19:21

HI dear elmer community,

i think i found a bug in the pointinelement routine in the interpolation.F90

THere the distance to quadriterals (case 4) is calculated by
Code: Select all
      CASE(4)
        sumdist = MAX( ug - 1.0, MAX( -ug -1.0, 0.0 ) )
        sumdist = sumdist + MAX( vg - 1.0, MAX( -vg - 1.0, 0.0 ) )

i think this should be
Code: Select all
      CASE(4)
        sumdist = MAX( ug - 1.0, MAX( -ug , 0.0 ) )
        sumdist = sumdist + MAX( vg - 1.0, MAX( -vg , 0.0 ) )


An example is when the local coordinates are both negative e.g. u=-0.5 and v=-0.5, which should lead to positive distance.
then the term
max(-(-0.5)-1,0)=max(0.5-1,0)=max(-0.5,0)=0
does not give a positive distance as i think it is supposed to.
Also the other therm
max(-0.5-1,0)=max(-1.5,0)=0
does not deliver that. But i think that one should cover the case where u is bigger than 1, and so it is fine.

I think the analogous is true below for the hexagonal case (case 8(?))

best regard
Franz
Franz Pichler
 
Posts: 196
Joined: 29 Sep 2011, 12:25

Re: PointInELement

Postby raback » 18 Apr 2016, 15:18

Hi Franz

For quads the local coordinate (u,v) are in interval [-1,1] so I think these should be ok. Point (-0.5,-0.5) is in fact within the element. For triangles the interval is [0,1] (except for p-elements to complicate things further...).

-Peter
raback
Site Admin
 
Posts: 3211
Joined: 22 Aug 2009, 11:57
Location: Espoo, Finland

Re: PointInELement

Postby Franz Pichler » 25 Apr 2016, 11:23

Then i apologize for being a smartass,
best regards
Franz
Franz Pichler
 
Posts: 196
Joined: 29 Sep 2011, 12:25


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 1 guest