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

Ian Hinder ian.hinder at aei.mpg.de
Fri Nov 3 03:12:53 CDT 2017


On 3 Nov 2017, at 09:06, Chris Stevens <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, 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
> 
> ADMDerivatives::calc_derivs.cc
> 
> Coordinates::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

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


More information about the Users mailing list