Back to main menu

## Option: remove-doubles

#### Syntax

`-remove-doubles <distance>`

`-rmd <distance>`

#### Description

This option removes duplicate atoms.

Only the first atom found at a given position is conserved. All other atoms that are at the same position or at a distance smaller than the specified <distance> are removed. It may be necessary to wrap atoms before using the present option for the neighbour search to give proper results.

If <distance>=0 then only atoms that have exactly the same position are removed.

Note that the comparison of distances is based only on cores. If shells are present, both core and shell of duplicate atoms are removed for consistency.

If a selection was defined (with the option `-select`) then the neighbor search is performed on all atoms, but only selected atoms are removed.

#### Default

By default duplicate atoms are not removed.

#### Examples

- `atomsk initial.cfg -remove-doubles 0.2 final.xyz`

  This will remove atoms that are closer than 0.2 Å from another atom.

- `atomsk --merge 2 system1.xyz system2.xyz final.xsf -rmd 0.3`

  This option can be useful when merging systems. Beware that in that case, if atoms of the two systems overlap, then it is the atoms belonging to the second system that are removed.

Back to main menu