From: Yann Claveau (yann.claveau_at_univ-rennes1.fr)
Date: Wed May 12 2021 - 04:37:01 CDT

Thanks a lot Axel, I did not think at all of this obvious solution !

I tried the suggestion of  Adupa Vasista <adupavasista_at_gmail.com> (he
did not reply to all so I write his answer here) :

    /"One thing you can do is, to manually assign the index using //
    /

        /$selSi set index 1/
        /$sel0 set index 3/
        /$selH set index 2/

    /"/

But I get

    atomsel object: set: data not modifiable: index

Yann

Le 12/05/2021 à 11:30, Axel Kohlmeyer a écrit :
>
>
> On Wed, May 12, 2021 at 5:16 AM Yann Claveau
> <yann.claveau_at_univ-rennes1.fr <mailto:yann.claveau_at_univ-rennes1.fr>>
> wrote:
>
> Dear all,
>
> I used topotools to convert a pdb file into lammps data. I would
> like to know if it is possible to change the numbering of atoms in
> the lammps data file.
>
> Here is an example : Consider 3 atom type : H, O, Si.
>
> I selected them using
>
> set selSi [atomselect top {name Si}]
> set selO  [atomselect top {name O}]
> set selH  [atomselect top {name H}]
>
> Then, after analysis (topo retypebonds, topo guessangles, mol
> reanalyze top) I created the lamms data file.
>
> topo writelammpsdata data.example
>
> In this file, atoms are ordered alphabetically:
>
> 1 H
> 2 O
> 3 Si
>
> is it possible to change this order using topotools, for instance:
>
> 1 Si
> 2 H
> 3 O
>
>
> the simplest way to achieve this would be by (re-)naming the atoms so
> they will sort in the desired order, e.g. as 1H, 2O, and 3Si.
>
> axel.
>
> Thanks for your help,
>
> --
> Yann claveau, post-doc
> Département Matériaux-Nanosciences
> Bât. 11A, bureau 122,
> Campus de Beaulieu
> Institut de Physique de Rennes - UMR-CNRS 6251
> Université de Rennes 1
> 35042 Rennes cedex FRANCE
>
>
>
> --
> Dr. Axel Kohlmeyer akohlmey_at_gmail.com <mailto:akohlmey_at_gmail.com>
> https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!u6Hh7syiME0avAL-bBPOa5JfRqRXUvh-zsdTefgmcLTDpfcJh52vf3jEz-pySq1Wiw$ <https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!u6Hh7syiME0avAL-bBPOa5JfRqRXUvh-zsdTefgmcLTDpfcJh52vf3jEz-pySq1Wiw$ >
> College of Science & Technology, Temple University, Philadelphia PA, USA
> International Centre for Theoretical Physics, Trieste. Italy.

-- 
Yann claveau, PhD
Département Matériaux-Nanosciences
Bât. 11A, bureau 122,
Campus de Beaulieu
Institut de Physique de Rennes - UMR-CNRS 6251
Université de Rennes 1
35042 Rennes cedex FRANCE