Back to main menu

Option: select

Syntax

-select all

-select invert

-select <species>

-select <index>

-select <index1>,<index2>,<index3>:<index4>,...

-select list <file>

-select random <N> <species>

-select <above|below> <d> <dir>

-select <in|out> box <x> <y> <z> <x'> <y'> <z'>

-select <in|out> sphere <x> <y> <z> <R>

-select <in|out> cylinder <axis> <x1> <x2> <R>

-select prop <property> <value1[:value2]>

-select <NNN> <species> neighbors <index>

-select grid <file>

Description

This option allows to select atoms according to given criteria. The selection can include atoms of a given species, atoms above or below a given plane, atoms inside or outside of a geometric region, or a random set of atoms.

When using -select all the selection is cleared. All atoms will then be treated equally by other options, so this is equivalent to selecting all atoms.

When using -select invert the selection is inverted (i.e. any selected atom is un-selected, and unselected atoms are selected). If no selection was previously defined (i.e. all atoms are selected) then nothing is done since it does not make sense to select no atom.

When using -select <species>, all atoms of the given species are selected. The chemical symbol must be used (e.g. Al, Si, C, Cu...).

When using -select <index> (where <index> in an integer), only the atom of the given index is selected. Several indices can be given, separated by a comma. A range of indices can be defined by two integers separated by a colon.

When using -select list <file>, the list of atoms to select is read from a <file>. The <file> must be a text file containing one atom index (integer number) per line.

When using -select random, N atoms of the given <species> are selected randomly (where N in an integer). If N is a real number followed by the symbol "%", then the given percentage of atoms will be selected. If <species> is set to "any" or "all" then N atoms will be randomly selected regardless of their species. Note that this option attempts to generate random indices of the atoms to be selected, therefore it is largely non-reproducible, i.e. starting from the exact same system and applying the present option will likely lead to different results.

When using -select above (respectively, -select below), all atoms that are at a distance greater (repectively lesser) than the distance <d> with respect to the cartesian origin (0,0,0) along the given direction <dir> are selected. The direction <dir> can be one of "X", "Y", "Z" (referring to cartesian axes), or a crystallographic direction defined by its Miller indices (see how to specify Miller indices). If the crystallographic orientation of the system is defined (e.g. through the option -properties) then the Miller indices are considered with respect to that orientation. Otherwise the orientation assumed is X=[100], Y=[010], Z=[001].

Using -select in (or out) allows to select atoms inside (respectively outside) of a geometric region. Only some basic geometric shapes are implemented, like the parallelepiped, sphere, and so on. The parameters depend on the geometry of the region:

The box is a parallelepipedic box defined by two points of coordinates (x,y,z) and (x',y',z').

The sphere is defined by its center (x,y,z) and its radius R.

The cylinder is defined by its center (x1,x2) in the plane normal to the direction <axis>, and its radius R. The directions x1 and x2 are decided after the direction <axis> by permutation X, Y, Z (e.g. if <axis>=Y then x1 will be the position along the cartesian Z direction, and x2 the position along X).

The positions <x>, <y>, <z> are usually given in Å. It is also possible to give them with respect to the box dimensions with the keyword BOX and an operation (see this page). Note that these keywords can only be used for positions: the radius <R> of sphere or cylinder must always be given in Å.

The option -select prop allows to select atoms whose given <property> has the given <value>. If only one value is provided then only atoms that have exactly this value for this <property> are selected. If two values are given, separated by a colon (:) then all atoms whose <property> falls in this range are selected.

When using -select <NNN> <species> neighbors <index>, the neighbors of the atom of the given <index> are selected. If <NNN> is a positive integer then the <NNN> closest neighbors are selected, regardless of their distance (<NNN> must then be smaller than 100). If <NNN> is a negative real number then all neighbors within a radius of |<NNN>| are selected, regardless of their number. If <NNN> is zero, then the first nearest neighbors are selected. Note that if some atoms are out of the box then the neighbor search can give wrong results (the option -wrap can be used to wrap all atoms into the box). If <species> is the chemical symbol of a species then only atoms of that species are selected. If <species> is set to "all" or "any" then atoms are selected regardless of their species.

When using -select grid, a finite-element grid of values is read from the <file>. The <file> must be a text file complying to one of the three following formats:

The two first formats allow to manipulate 2-D or 3-D grids; the last one only allows to generate 2-D grids (see examples below). This option can be used to select complex shapes.

The options called after the option -select will be applied only to the atoms that are selected by the present option, refer to their documentation to know how each option treats selected atoms. Beware that some options can result in strange (i.e. non-physical) results when applied to some atoms only.

Each time this option is called, a new set of atoms is selected, causing any previous selection to be lost.

Note that this option has no effect on the output: no matter which atoms are selected or not, all atoms coordinates are written in the output file(s).

Default

By default no selection is defined, hence all atoms are selected. If a selection is defined and all selected atoms are removed (i.e. if the selection does not contain any atom anymore), then the selection is cleared, in other words the remaining atoms are all selected.

Examples

Back to main menu