[Users] syntax for pointers from array in Cactus?
physicsbeany at gmail.com
Tue May 24 09:26:50 CDT 2016
Thanks, Roland. That is what I have to do.
C does permit multi-dimensional arrays that can be indexed like
[i][j][k] (presumably without guaranteed contiguous memory
allocation), but I didn't appreciate that the Cactus ones are the
simpler flat sort (OK, I suppose I knew that for the grid functions,
but not the other kind).
Anyway, I've changed to the "flat" 1D indexing as you've indicated,
and it's compiling now. Thanks again,
On 24 May 2016 at 02:01, Roland Haas <rhaas at aei.mpg.de> wrote:
> 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;
>> outputs[m] = &dataslice[m];
> 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
> though using the parameters is fine as well.
> 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.
> Users mailing list
> Users at einsteintoolkit.org
More information about the Users