[Carpet] Bugzilla Bug 118

Erik Schnetter schnetter at cct.lsu.edu
Wed May 14 02:48:53 CEST 2008


On May 13, 2008, at 19:42:00, Ian Hinder wrote:

> Erik Schnetter wrote:
>> On May 2, 2008, at 17:50:53, Ian Hinder wrote:
>>
>>> Ian Hinder wrote:
>>>
>>>> The eps with which the times are being compared in CarpetLib is  
>>>> 1e-12,
>>>> but the two times here are different by 1.36e-12, so the error is
>>>> triggered.  I am rerunning with a larger eps value to make sure  
>>>> nothing
>>>> else is wrong.  This happens at t = 586.500 - I don't know why  
>>>> Carpet is
>>>> saying 2736.
>>>
>>> The run with the larger eps value passed the point at which the  
>>> old run
>>> crashed.
>>
>>
>> Ian,
>>
>> I found the source of the problem.  This comparison expects an  
>> absolute
>> accuracy of 1e-12, which is obviously wrong, it should requite  
>> 1e-12 as
>> relative accuracy.  Burkhard Zink just came across a similar error in
>> Carpet.  I expect to push corrections soon.
>
> I just had a similar problem with the following code.  Is it the same
> problem?  This is in Evolve.cc, line 374. It asserts on the comparison
> with eps.
>
>
>              // Advance times
>
>              cctkGH->cctk_time
>                = (global_time
>                   - delta_time / maxtimereflevelfact
>                   + delta_time * mglevelfact / timereflevelfact);
>              CCTK_REAL const carpet_time = cctkGH->cctk_time /  
> delta_time;
>              for (int m=0; m<maps; ++m) {
>                vtt.at(m)->advance_time (reflevel, mglevel);
>                CCTK_REAL const eps = 1.0e-12;
>                static_assert (abs(0.1) > 0,
>                               "Function CarpetLib::abs has wrong
> signature");
>                CCTK_REAL const level_time =
>                  vtt.at(m)->get_time (reflevel, mglevel);
>                assert (abs (level_time - carpet_time) < eps);
>                vtt.at(m)->set_time (reflevel, mglevel, carpet_time);
>              }


Yes, this is probably the same problem.  Try instead

                   assert (abs (level_time - carpet_time) <
                           eps * max (carpet_time, 1.0));

The max is justified since this counts time steps, not simulation  
time, so 1.0 is a reasonable time interval.  At late times,  
carpet_time will be much larger, leading to less relative accuracy.

-erik

-- 
Erik Schnetter <schnetter at cct.lsu.edu>   http://www.cct.lsu.edu/~eschnett/

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : /archives/developers/attachments/20080513/08126f4d/attachment.pgp 


More information about the developers mailing list