[Users] Cannot access x,y,z,r when inheriting grid in c

Chris Stevens c.stevens at ru.ac.za
Fri Nov 3 03:22:12 CDT 2017


Hi Ian,

thanks for the quick reply.

SCHEDULE WorldTubeExtract_TEST AT CCTK_INITIAL AFTER 
WorldTubeExtract_RegisterSlices
{
   LANG: C
   OPTIONS: LEVEL
} "TEST"

Also the output of Carpet::is_global_mode() is 0 so definitely not in 
global mode.

Cheers,

Chris


On 11/03/2017 10:12 AM, Ian Hinder wrote:
>
> On 3 Nov 2017, at 09:06, Chris Stevens <c.stevens at ru.ac.za 
> <mailto:c.stevens at ru.ac.za>> wrote:
>
>> Hi all,
>>
>> this hopefully is a dumb question, but I cannot for the life of me 
>> get access to the x,y,z,r coordinates defined in CartGrid3D.
>>
>> Suppose I have a thorn X that wants to access these coordinates from 
>> test.cc <http://test.cc>, then the thorn should inherit: grid, the 
>> .cc should #include "cctk_Arguments.h" and the line that accesses, 
>> say x[0], should be called after DECLARE_CCTK_ARGUMENTS.
>>
>> Unfortunately doing this results in an error:
>>
>> [maths02:86267] *** Process received signal ***
>> [maths02:86267] Signal: Segmentation fault (11)
>> [maths02:86267] Signal code: Address not mapped (1)
>> [maths02:86267] Failing at address: (nil)
>>
>> Which is analogous to the error message you get by defining a grid 
>> variable in interface.ccl without the accompanying STORAGE: in 
>> schedule.ccl, i.e. the memory is not allocated.
>>
>> I am using Llama as my coordinate system, but I know this basically 
>> is a wrapper for CartGrid3D and these coordinates are still set. I 
>> see the printout from CartGrid3D.
>>
>> I try to access these coordinates at, for example, CCTK_INITIAL, when 
>> the grid structure is already setup. I have also tried later time 
>> bins such as CCTK_POSTSTEP.
>>
>> Example files that access these coordinates are:
>>
>> CTGBase::debug.cc <http://debug.cc>
>>
>> ADMDerivatives::calc_derivs.cc
>>
>> Coordinates::cylinderinbox.cc <http://cylinderinbox.cc>
>>
>> However I am not having any luck reverse-engineering these.
>>
>> Any ideas would be appreciated.
>>
>
> Hi,
>
> Thanks for the detailed report!
>
> What mode are you calling your function in?  i.e. can you show us the 
> block in schedule.ccl that schedules your function?  If it is not 
> local mode (the default), then you won't be able to access any grid 
> data, and you will get a segfault.
>
> -- 
> Ian Hinder
> http://members.aei.mpg.de/ianhin
>

-- 
Dr Chris Stevens

Department of Mathematics

Rhodes University

Room 5

Ph: +27 46 603 8932

Web: www.chrisdoesmaths.com <http://www.chrisdoesmaths.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20171103/addb09ca/attachment.html 


More information about the Users mailing list