```6.3.2.1.  MANIPULATING ATOMS

Option [A] selected from the structure option menu S, see Sec. 6.3.2, allows
you to add, hide, move, or delete cluster atoms. So this option can be used
to rebuild parts of the cluster. The atom modify menu SA reads

========================================================================

Atoms:  [IA]dd [M]od  [H]ide [U]nhide [P]urg  [T]ransl [C]opy  [R]cnt
[S]equ(rpt)   [X]plot  [?,]esc
================================================================== 15 ==

where the value of the sequential repeat flag rpt reads "on" or "off"
depending on the repeat state (see options [T], [C], [S] below).

>   [I]  selected from submenu SA adds an atom to the cluster where internal
coordinates are used for its position. The prompt

(with na denoting the number of the new atom) asks for eight
numbers defining an atom to be added as no. na (= nct+1) to the
cluster of nct atoms. Here n0, n1, n2 are numbers of existing
cluster atoms, dist is a distance, and theta, phi are respective
rotation angles defining the atom position (x,y,z). The following
conventions are used for the atom position:

(a)  n0 = n1 = n2 = 0 :
atom position are in absolute spherical coordinates with
respect to the origin of the basic coordinate system (X,Y,Z)

x = dist * sin(theta) * cos(phi)
y = dist * sin(theta) * sin(phi)
z = dist * cos(theta)

(b)  n0 > 0, n1 = n2 = 0 :
atom position are in spherical coordinates with respect to
atom no. n0 at r0 = (x0,y0,z0)

x = x0 + dist * sin(theta) * cos(phi)
y = y0 + dist * sin(theta) * sin(phi)
z = z0 + dist * cos(theta)

where theta and phi are angles in the basic coordinate system
(X,Y,Z).

(c)  n0 > 0, n1 >0, n2 = 0 :
atom position are in spherical coordinates with respect to
atom no. n0 at r0 = (x0,y0,z0)

x = x0 + dist * sin(theta) * cos(phi)
y = y0 + dist * sin(theta) * sin(phi)
z = z0 + dist * cos(theta)

where theta and phi are angles in a local cartesian coordinate
system (X',Y',Z') with vector r1-r0 defining the Z'-axis.

(d)  n0 > 0, n1 >0, n2 > 0 :
atom position are in spherical coordinates with respect to
atom no. n0 at r0 = (x0,y0,z0)

x = x0 + dist * sin(theta) * cos(phi)
y = y0 + dist * sin(theta) * sin(phi)
z = z0 + dist * cos(theta)

where theta and phi are angles in a local cartesian coordinate
system (X',Y',Z') with vector r1-r0 defining the Z'-axis. The
plane through r0,r1,r2 contains the X'-axis such that vector
r2 has a positive X' component.

nuclear charge nuc assigned to the new atom. Both values may be
revised later. Correct input of the atom definition is confirmed by
a message

Xyz,R,Id,V( na)=   x   y   z   rad   nuc  T

listing the (absolute cartesian) coordinates (x,y,z) of the new
atom, its atom radius rad, its nuclear charge / element name, and
its visibility flag value "T" ( = visible). Then BALSAC returns to
submenu SA. Dummy input "8*0" in the above prompt returns

>   [A]  selected from submenu SA adds an atom to the cluster where absolute
cartesian coordinates are used for its position. The prompt

(with na denoting the number of the new atom) asks for five numbers
defining an atom to be added as no. na (= nct+1) to the cluster of
nct atoms. Here (x,y,z) denotes the atom position in absolute
nuclear charge of the new atom. Correct input of the atom
definition is confirmed by a message

Xyz,R,Id,V( na)=   x   y   z   rad   nuc  T

listing the (absolute cartesian) coordinates (x,y,z) of the new
atom, its atom radius rad, its nuclear charge / element name, and
its visibility flag value "T" ( = visible). Then BALSAC returns to
submenu SA. Dummy input "5*0" in the above prompt returns

>   [M]  selected from submenu SA modifies an atom of the cluster. This
allows you to change coordinates of an atoms as well as its atom
radius and nuclear charge in one step. The option becomes
particularly useful if you have mistyped coordinates of a cluster
in the initial input and want to change components. The prompt

Modify n-th atom  N (1-  nct , 0=esc) :

(with nct denoting the total number of cluster atoms) asks for the
number n of an atom to be modified. Here dummy input n=0 returns
immediately to submenu SA. For values n within the valid range
[1, nct] coordinates and attributes of atom no. n are listed, see
above, as

Xyz,R,Id,V( n)=   x   y   z   rad   nuc  T

together with a prompt

Modified atom:  X,Y,Z,R,NUC ("5*0"=esc) :

requesting five numbers redefining the cluster atom by its position
(x,y,z) in absolute cartesian coordinates, an atom radius, and a
nuclear charge. The input is confirmed by

Xyz,R,Id,V( n)=   x   y   z   rad   nuc  T

showing the new atom definition after which BALSAC returns to

>   [H]  selected from submenu SA hides an atom of the cluster. Hidden atoms
are treated as invisible by setting their internal visibility flag
to "F" and they and will not appear in subsequent plots. However,
their coordinates and attributes are still contained in the atom
definition list and hidden atoms can be revived in the same
BALSAC/CLUSTER session by the unhide option [U] of submenu SA
described below. Hidden atoms will not be stored on structure
output files and, thus, will be lost in subsequent BALSAC/CLUSTER
sessions. Note that the graphic analysis option offers atom hiding
which is much more intuitive and faster, see Sec. 6.3.12. The
prompt

Hide n-th atom  N (1-  nct , 0=esc) :

(with nct denoting the total number of cluster atoms) asks for the
number n of an atom to be hidden. Here dummy input n=0 returns
immediately to submenu SA. For values n within the valid range
[1, nct] coordinates and attributes of atom no. n are listed, see
above, as

Xyz,R,Id,V( n)=   x   y   z   rad   nuc  T

together with a prompt

===================================================

Confirm:  [H]ide  [?,]esc
========================================== 16 =====

to confirm hiding. Selecting [H] in this prompt hides atom no. n
and shows

Atom no. n  hidden

while [,] cancels the hiding process returning to submenu SA.

=======================================================

Unhide atoms:  [A]ll  [S]el  [L]ist  [?,]esc
================================================= 71 ==

which allows you to revive all or selected cluster atoms which have
been hidden in the present BALSAC/CLUSTER session. Note that the
graphic analysis option offers atom unhiding which is much more
intuitive and faster, see Sec. 6.3.12.

>    >   [A]  selected from submenu SAU revives all atoms that are hidden in
the present BALSAC/CLUSTER session by using the graphical hide
option (see Sec. 6.3.12), suboption [H] of menu SA (atom
hide), or of menu SG (group hide). Here the visibility flags
of all hidden atoms are set to "T" so that they become visible
in plots and are stored in structure output files. The process
is confirmed by a message

nvis  atom(s) unhidden

where nvis denotes the number of atoms formerly hidden after
which BALSAC/CLUSTER returns to submenu SA.

>    >   [S]  selected from submenu SAU revives selected atoms that are
hidden in the present BALSAC/CLUSTER session by using the
graphical hide option (see Sec. 6.3.12), suboption [H] of menu
SA (atom hide), or of menu SG (group hide). The prompt

Unhide n-th atom  N (1-  nct , 0=esc) :

(with nct denoting the total number of cluster atoms) asks for
the number n of an atom to be unhidden. Here dummy input n=0
returns immediately to submenu SA. For values n within the
valid range [1, nct] coordinates and attributes of atom no. n
are listed, see above, as

Xyz,R,Id,V( n)=   x   y   z   rad   nuc  V

and for a hidden atom (V = "F") a line

Atom no. n  unhidden

confirms unhiding setting its visibility flag to "T" while for
a visible atom (V = "T") the line

Atom is not hidden

shows that the atom does not need to be unhidden. After this

>    >   [L]  selected from submenu SAU lists all coordinates and attributes
of all nvis atoms that are presently hidden (invisible) by

1) Xyz,R,Id(    p1) :   x   y   z ,  rad ,  nuc
...
nvis) Xyz,R,Id( pnvis) :   x   y   z ,  rad ,  nuc

nvis atom(s) hidden

where (x,y,z) denotes the position of each atom, rad its atom
radius, and nuc its nuclear charge (element name). If the
number of hidden atoms exceeds 20 listing will be interrupted
and the prompt

** Press [C], L-click to continue;  [,], R-click to escape **

allows you to continue (select [C]) or finish listing (select
[,]). After listing is finished BALSAC returns to submenu SA.

>   [P]  selected from submenu SA removes all hidden atoms from the present
cluster which is confirmed by

np  atoms of  nct  survive

where nct is the number of atoms before and np that after the purge
process. Note that this option does NOT prompt to confirm purging
so that all hidden atoms are definitely lost after the purge! If
there are no hidden atoms the purge option has no effect. After
purging BALSAC returns to submenu SA.

>   [T]  selected from submenu SA translates selected atoms by applying a
shift vector. The prompt

Translate n-th atom  N (1-  nct , 0=esc) :

(with nct denoting the total number of cluster atoms) asks for the
number n of an atom to be translated. Here dummy input n=0 returns
immediately to submenu SA. For values n within the valid range
[1, nct] coordinates and attributes of atom no. n are listed, see
above, as

Xyz,R,Id,V( n)=   x   y   z   rad   nuc  V

and

Shift  X,Y,Z :

asks for absolute cartesian coordinates (xs,ys,zs) defining a shift
vector which will be added to the original coordinates of atom no.
n to determine its new position

(x',y',z') = (x,y,z) + (xs,ys,zs)

listed by

Xyz,R,Id,V( n)=   x'  y'  z'  rad   nuc  V

to confirm translation. After this BALSAC returns to submenu SA if
the sequential repeat flag (shown in submenu SA) is set to "off".
If the repeat flag is set to "on" the prompt

[R]epeat operation    [?,]esc

repeats the translation of atom no. n sequentially using the same
shift vector (select [R]) or returns to submenu SA (select [,]).

>   [C]  selected from submenu SA copies selected atoms after applying a
shift vector. The prompt

Copy from n-th atom  N (1-  nct , 0=esc) :

(with nct denoting the total number of cluster atoms) asks for the
number n of an atom to be used for the copy. Here dummy input n=0
returns immediately to submenu SA. For values n within the valid
range [1, nct] coordinates and attributes of atom no. n are listed,
see above, as

Xyz,R,Id,V( n)=   x   y   z   rad   nuc  V

and

(nct+1)-th atom shift X,Y,Z :

asks for absolute cartesian coordinates (xs,ys,zs) defining a shift
vector which is added to the coordinates of atom no. n to determine
the position

(xn,yn,zn) = (x,y,z) + (xs,ys,zs)

of a new atom (no. nct+1) which is added to the cluster. The
charge, visibility) with atom no. n as shown by the line

Xyz,R,Id,V( nct+1)=   xn  yn  zn  rad   nuc  V

to confirm the copy. After this BALSAC returns to submenu SA if the
sequential repeat flag (shown in submenu SA) is set to "off". If
the repeat flag is set to "on" the prompt

[R]epeat operation    [?,]esc

repeats copying sequentially by applying the same shift vector on
the atom copy generated last (select [R], resulting in chains of
identical atoms if applied more than once) or returns to submenu SA
(select [,]).

>   [R]  selected from submenu SA recenters the cluster by shifting all
cluster atoms by a fixed vector such that v = (vx,vy,vz) forms the
new origin. Hence, the coordinates of all atom positions are
transformed as

(x,y,z)  -->  (x',y',z') = (x,y,z) - (vx,vy,vz)

If v coincides with the position vector of an atom this atom center
will form the origin (0,0,0) of the recentered cluster. The prompt

New origin  NC,X,Y,Z ("-1,0,0,0"=esc) :

asks for four numbers defining the origin vector v given either in
absolute coordinates (0,vx,vy,vz) or denoting the center of an
existing atom nv by (nv,0,0,0). Dummy input "-1,0,0,0" returns
immediately to submenu SA. Now all cluster atoms will be recentered
which is confirmed by either

Location ( vx   vy  vz ) will be new origin

if the input was given as (0,vx,vy,vz) or by

Atom no. nv  will be new origin

if the input was given as (nv,0,0,0). After this BALSAC returns to

>   [S]  selected from submenu SA switches the sequential repeat flag
between "off" and "on" after which BALSAC returns to submenu SA.
With the repeat flag set to "on" each atom copy/translate action is
followed by a prompt, see above, allowing you to repeat the copying
or translating process with identical shift vectors.

>   [X]  selected from submenu SA plots the cluster (switching to graphics
mode (DOS) or opening a graphics window (Unix)) or lists its atom
coordinates depending on the plot/list mode defined in the graphics
option, see Sec. 6.2.7.

>   [,]  selected from submenu SA returns immediately to the structure
option menu S, see Sec. 6.3.2.