next up previous contents
Next: param.ccl Up: interface.ccl Previous: Function aliasing   Contents


Variable Blocks

The thorn's variables are collected into groups. This is not only for convenience, but for collecting like variables together. Storage assignment, communication assignment, and ghostzone synchronization take place for groups only.

The thorn's variables are defined by:

[<access>:]

<data_type> <group_name>[[<number>]] [TYPE=<group_type>] [DIM=<dim>]
[TIMELEVELS=<num>]
[SIZE=<size in each direction>] [DISTRIB=<distribution_type>]
[GHOSTSIZE=<ghostsize>] [STAGGER=<stagger-specification>]
[TAGS=<string>]  ["<group_description>"]
[{
 [ <variable_name>[,]<variable_name>
   <variable_name> ]
} ["<group_description>"] ]
(The options TYPE, DIM, etc. following <group_name> must all appear on one line.) Note that the beginning brace ({) must sit on a line by itself; the ending brace (}) must be preceded by a carriage return.
  • access defines which thorns can use the following groups of variables. access can be either public, protected or private.
  • data_type defines the data type of the variables in the group. Supported data types are CHAR, BYTE, INT, REAL, and COMPLEX.
  • group_name must be an alphanumeric name (which may also contain underscores) which is unique across group and variable names within the scope of the thorn. A group name is compulsory.
  • [number], if present, indicates that this is a vector group. The number can be any valid arithmetical expression consisting of integers or integer-valued parameters. Each variable in that group appears as a one-dimensional array of grid variables. When the variable is accessed in the code, then the last index is the member-index, and any other indices are the normal spatial indices for a group of this type and dimension.
  • TYPE designates the kind of variables held by the group. The choices are GF, ARRAY or SCALAR. This field is optional, with the default variable type being SCALAR.
  • DIM defines the spatial dimension of the ARRAY or GF. The default value is DIM=3.
  • TIMELEVELS defines the number of timelevels a group has if the group is of type ARRAY or GF, and can take any positive value. The default is one timelevel.
  • SIZE defines the number grid-points an ARRAY has in each direction. This should be a comma-separated list of valid arithmetical expressions consisting of integers or integer-valued parameters.
  • DISTRIB defines the processor decomposition of an ARRAY. DISTRIB=DEFAULT distributes SIZE grid-points across all processors. DISTRIB=CONSTANT implies that SIZE grid-points should be allocated on each processor. The default value is DISTRIB=DEFAULT.
  • GHOSTSIZE defines number of ghost-zones in each dimension of an ARRAY.
  • STAGGER defines position of grid-points of a GF with respect to the underlying grid. It consists of a string made up of a combination DIM of the letters M, C, P depending on whether the layout in that direction is on the Minus face, Centre, or Plus face of the cell in that dimension.
  • TAGS defines an optional string which is used to create a set of key-value pairs associated with the group. The keys are case independent. The string (which must be deliminated by single or double quotes) is interpreted by the function Util_TableSetFromString(), which is described in the ReferenceManual.
    Currently the CST parser and the flesh do not evaluate any information passed in an optional TAGS string. Thorns may do so by querying the key/value table information for a group by using CCTK_GroupTagsTable() and the appropriate Util_TableGet*() utility functions (see the ReferenceManual for detailed descriptions).
    For a list of currently supported TAGS key-value table information please refer to the corresponding chapter in the documentation of the CactusDoc arrangement.
  • The (optional) block following the group declaration line contains a list of variables contained in the group. All variables in a group have the same data type, variable type, dimension and distribution. The list can be separated by spaces, commas, or new lines. The variable names must be unique within the scope of the thorn. A variable can only be a member of one group. The block must be delimited by brackets on new lines. If no block is given after a group declaration line, a variable with the same name as the group is created. Apart from this case, a group name cannot be the same as the name of any variable seen by this thorn.
  • An optional description of the group can be given on the last line. If the variable block is omitted, this description can be given at the end of the declaration line.


next up previous contents
Next: param.ccl Up: interface.ccl Previous: Function aliasing   Contents