[Users] syntax for pointers from array in Cactus?
Roland Haas
rhaas at aei.mpg.de
Tue May 24 01:01:35 CDT 2016
Hello Bernard,
> In my C source file, I get the pointers from the 0th rank of this
> array, for passing into an interpolator:
>
> CCTK_POINTER outputs[59];
> for(m=0;m<59;m++){
> outputs[m] = &dataslice[m][0][0];
> }
I C all arrays appear flat (not multi-dimensional as they are in
Fortran), so you need to use:
output[m] = &dataslice[m*numtheta*numphi]
You can (if you want to) query dataslice's size by calling the Cactus
function CCTK_GroupDynamicData
(http://einsteintoolkit.org/documentation/ReferenceManual/ReferenceManualch2.html#x4-70000A2)
though using the parameters is fine as well.
Yours,
Roland
--
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from http://keys.gnupg.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5517 bytes
Desc: not available
Url : http://lists.einsteintoolkit.org/pipermail/users/attachments/20160524/327875a2/attachment.bin
More information about the Users
mailing list