next up previous contents
Next: Using the mask Up: SpaceMask Previous: Abstract   Contents

The mask bit-field

The mask is a grid function which can be used to assign a state to each point on the grid. It is used as a bit field, with different bits, or combinations of bits, assigned to represent various states. The mask is currently implemented as a CCTK_INT grid function, providing 32 bits per point.part391 Appropriate numbers of bits within the mask can be allocated to represent individual states of a given type.

For instance, a programmer wants to record whether each point of the grid has state ``interior'', ``excised'' or ``boundary''. The collection of these states is called a type, and 2-bits of the mask (enough to represent the three possible states of the type) are allocated to hold this information. If an independent classification of points (ie. a new type) is required, bits are allocated to it from the remaining free bits in the mask. (See Figure D19.1.)

The SpaceMask thorn provides a set of routines for allocating bits within the mask, and for setting and checking the mask state at individual points.

Figure D19.1: The SpaceMask_RegisterType() function allocates bits of the mask to a new ``type'' (eg. ``excision'' and ``colour'' in the figure). The number of bits that are allocated is determined by the number of possible states of the given type.
/home/cactus_web/CheckOut/CactusStable/arrangements/CactusEinstein/SpaceMask/doc/space_mask


next up previous contents
Next: Using the mask Up: SpaceMask Previous: Abstract   Contents