again, "minor" trouble in detect.F90 & Re: [FLASH-BUGS] "minor" glitch in flatten.F90 (part 2)

Markus Gross m.s.gross at hw.ac.uk
Tue Jul 22 12:17:48 CDT 2003


Tomek -

Similar trouble as before, but now in detect.F90. Answer to the points you 
raised follow below.

The problem in detect.F90 is:

line 129:
    do i = 3, nzn5
       if (scrch2(i-1)*scrch2(i+1) >= 0.e0) scrch3(i) = 0.e0
    end do

in my case this flips the sign scrch2(i-1)*scrch2(i+1)=1.d-24 due to rounding 
and produces quite significant differences in the solution, e.g. +-100 Pa 
where the pressure in the problem ranges from 80000 Pa - 100000 Pa.

Additionally I noted:
line 113:
       if (a(i+1) - a(i-1) == 0.e0) then
          temporary = small * smalla
       else

I highly doubt that this will be true in a lot of cases. Is there any 
rational for such a criteria, i.e. is it only here to avoid a div_by_zero ?



> I am generally against using floor-values in the code as they are (1)
> problem-dependent, and (2) mask some real problems.

(2) I perfectly agree, this is exactly why I am following these up, wouldn't 
waste days of my time if I would think, well it's just rounding error. From 
my experience only 10% of "rounding errors" are rounding errors.

> 1.e-10 or 1.e+10 does not really mean much when taken out
> of context. Hardwiring -10/+10 and -2/+2, as you suggested, may not be
> the best solution. Tying those constant to epsiln may work better.

adding these though gives the uses some appreciation of specific trouble 
makers and an easy way of ruling these out. In my case I would rather live 
with a hardwired constant than a rounding error of 100.d-0 in the pressure... 
epsilon unfortunately does not cover all rounding errors either, especially 
if you have to set convergence criteria for iterative solutions where it may 
not be necessary and or desirable to converge to machine precision. 
Nevertheless, it is an excellent default for all hardwired constants.

Markus.


-- 
_______________________________________________________________

Markus Gross AMIMechE BEng (Hons.) Mechanical Engineering

Heriot Watt University Edinburgh
School of Engineering and Physical Sciences
James Nasmyth Building
Edinburgh
EH14 4AS
UK

Member of  IMechE, SPIE, CSME and VDI
_______________________________________________________________

further contact:

Phone   : +44 (0) 131 451 4737

UNiX talk: talk markus at lasersim.mce.hw.ac.uk

_______________________________________________________________

"Plans are a place to begin," Grove said. "They rarely deliver
you to where you expect. Make your plans knowing you are going
to throw them away."

_______________________________________________________________







More information about the flash-bugs mailing list