next up previous contents
Next: Group Types Up: Cactus Variables Previous: Cactus Variables   Contents

Data Type

Cactus supports integer, real, complex and character variable types, in various different sizes. (Sizes in the following refer to the number of bytes occupied by the a variable of the type).

INTEGER
CCTK_INT, CCTK_INT1, CCTK_INT2, CCTK_INT4, CCTK_INT8. (CCTK_INT defaults to being CCTK_INT4).
REAL
CCTK_REAL, CCTK_REAL4, CCTK_REAL8, CCTK_REAL16. (CCTK_REAL defaults to being CCTK_REAL8).
COMPLEX
CCTK_COMPLEX, CCTK_COMPLEX8, CCTK_COMPLEX16, CCTK_COMPLEX32. (CCTK_COMPLEX defaults to being CCTK_COMPLEX16).
BYTE
This is a 1 byte data type.

Normally a thorn should use the default types--CCTK_INT, CCTK_REAL, CCTK_COMPLEX--rather than explicitly setting the size, as this gives maximum portability. Also, the defaults can be changed at configuration time (see Section A2.1.2), and this allows people to compile the code with different precisions to test for roundoff effects, or to run more quickly with a lower accuracy.