<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 3 Nov 2017, at 09:06, Chris Stevens <<a href="mailto:c.stevens@ru.ac.za">c.stevens@ru.ac.za</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div text="#000000" bgcolor="#FFFFFF"><p>Hi all,</p><p>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.</p><p>Suppose I have a thorn X that wants to access these coordinates
from <a href="http://test.cc">test.cc</a>, 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.</p><p>Unfortunately doing this results in an error:</p><p>[maths02:86267] *** Process received signal ***<br>
[maths02:86267] Signal: Segmentation fault (11)<br>
[maths02:86267] Signal code: Address not mapped (1)<br>
[maths02:86267] Failing at address: (nil)<br>
</p><p>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.<br>
</p><p>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.<br>
</p><p>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.</p><p>Example files that access these coordinates are:</p><p>CTGBase::<a href="http://debug.cc">debug.cc</a></p><p>ADMDerivatives::calc_derivs.cc</p><p>Coordinates::<a href="http://cylinderinbox.cc">cylinderinbox.cc</a></p><p>However I am not having any luck reverse-engineering these.<br>
</p><p>Any ideas would be appreciated.</p></div></blockquote><div><br></div><div>Hi,</div><div><br></div><div>Thanks for the detailed report!</div><div><br></div><div>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.</div></div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>-- </div><div>Ian Hinder</div><div><a href="http://members.aei.mpg.de/ianhin">http://members.aei.mpg.de/ianhin</a></div></div></div></div></div>
</div>
<br></body></html>