<< >> Up Title Contents

variables

The program recognises free variables:

"i[ ]"  integer variables
"r[ ]"  real variables

The current implementation allows 10 free variables [0] through [59] each.

"res[ ]"  Result of several calculations that return more than one
          value.
          res[0] contains the number of values returned, res[1] to
          res[res[0]] contain the actual values.
          The values of "res" change everytime, a command is applied
          that returns more than one value. The old values are lost !

Several other variables are linked to structural values:

"x[<i>]",
"y[<i>]" and
"z[<i>]" are the fractional coordinates of the atom number <i>.
"m[<i>]" is the number of the scattering curve for atom <i>
"n[1]"   is the total number of atoms in the crystal, this variable
         is read only.
"n[2]"   is the total number of different scattering curves in the
         crystal, this variable is read only.
"n[3]"   is the total number of atoms in the original unit cell,
         this variable is read only.
"cdim[1,1]" lowest  x coordinate of any atom in the crystal.
"cdim[1,2]" highest x coordinate of any atom in the crystal.
"cdim[2,1]" lowest  y coordinate of any atom in the crystal.
"cdim[2,2]" highest y coordinate of any atom in the crystal.
"cdim[3,1]" lowest  z coordinate of any atom in the crystal.
"cdim[3,2]" highest z coordinate of any atom in the crystal.
The variable "cdim" is read only.

"env[<i>]"      Index of neighbouring atoms as found by
                ==> "find"
                "env[0]" is the number of neighbours.
"md_num[1]"     Number of different microdomain types, read only
"md_cre[1]"     Number of different microdomain types that have been
                created with the 'create' command but not yet used to
                modify the crystal with the 'run' command. read only
"mc_num[1]"     Number of microdomains whose origins have been distributed
                throughout the crystal with the 'create' command.
                read only
"md_rad[<i>,<j>]"  Radius of microdomain type <i>.
                    If the type is "block",  <j> = 6 always.
                    If the type is "sphere", <j> = 1 gives the radius.
                    If the type is "face",   <j> gives the radius of face
                           number <j>.
                    If the type is "fuzzy",  <j> = 6 always.
                    The radius of microdomains type "block" and "fuzzy"
                    is determined automatically by the ==>'run' command.
                    read only.
"mc_run[1]"     Number of microdomains that have been used to modify the
                crystal with the 'run' command.
                read only
"mc_type[<i>]"  Number specifying the type of microdomain number <i>.
                read only
"mc_orig[1,<i>] x coordinate of microdomain <i>
"mc_orig[2,<i>] y coordinate of microdomain <i>
"mc_orig[3,<i>] z coordinate of microdomain <i>
                Read only for microdomains that have been used to modify
                the crystal, i.e. for which the 'run' command has been used.
                Read/write for microdomains whose origins have been
                created with 'create' but not yet used to modify the
                crystal with 'run'.
"mc_rad[<i>]"   Individual radius for microdomain <i>. This radius is
                added to the microdomain radius for a gaussian distribution.
                Read only for microdomains that have been used to modify
                the crystal, i.e. for which the 'run' command has been used.
                Read/write for microdomains whose origins have been
                created with 'create' but not yet used to modify the
"md_next[<i>]"  Number of the closest microdomain. If "md_next" is
                negative, the atom <i> is inside the microdomain,
                else outside.
"md_dist[<i>]"  Distance of the atom <i> to the closest microdomain.
                If "md_next" is negative, the atom <i> is inside the
                 microdomain, else outside.

The variables can be assigned constant numbers:

i[0] =  1               ! Integer variable no 0 is set to "1"
r[4] =  1.5             ! Real variable no 4 is set to "1.5"
x[5] = -2.7888          ! x-coordinate of atom 5 is set to "-2.7888"

Arithmetic expressions may be used on the right hand side:

i[i[4]+2] = 2.0*(i[2]+i[0])/(i[2]**2)
m[i[0]+50] = m[i[0]] ! The atom 50 atoms down the line from
                       atom no <i[0]> is assigned the same
                       scattering curve, thus essentially switching
                       its chemistry around !

As shown in the example above, arithmetic operations can be nested and grouped by brackets "(" and ")".


<< >> Up Title Contents