set atom names based on LAMMPS type in VMD!

Hello!
Is there any way in to add atom names to set convenient defaults for visualization of LAMMPS data in VMD?
Thanks,
Fatemeh

Yes, you can set the type of atoms by the integer number, then you will have different color of the atoms depend on their type.

best,
rizal

2011/6/21 F.E.Nia <fate.nia@…24…>

Thanks Rizal! yes I have done this and I can see my system in VMD based on different colors now! but I am looking for a command or a way to add atom names so it is much more convenient to see the system based on different atoms than only different colors.
Best,
Fatemeh

I usually do it manually using text editor, I replace each atomic type with the atom names. I think every text editor software have the facility to find and replace the words.

maybe there is an elegant way to do this, but I never elaborate it. 330.gif

best,
rizal

2011/6/21 F.E.Nia <fate.nia@…24…>

The current version of LAMMPS lets you do a dump_style custom with element
names for each atom, defined by the dump_modify command.

Thus you can have a column in your dump file of “C”, for example.

Steve

330.gif

The current version of LAMMPS lets you do a dump_style custom with element
names for each atom, defined by the dump_modify command.

Thus you can have a column in your dump file of “C”, for example.

however, i have not yet had the time to implement the backed support
for this into the molfile plugin for VMD. so it will be ignored at the moment.
i have already started to look at what changes are needed, and there are
some more, since VMD tries to infer several properties from atom names,
so i have to make sure that they are consistent with other file formats
and get properly overridden in case the lammps dump contains that
information explicitly.

the currently easiest way is to script this with VMD tcl scripting.
using something like this (untested):

foreach {num name} {{1 C} {2 H} {3 O}} {
set sel [atomselect top “name $num”]
$sel set name $name
$sel delete
}

if you want to keep this for future use, you can
write it out as a .psf file:

animate write psf mysystem.psf

and then load the psf file before loading the lammps dump.

i will send an announcement to the list when the improved
lammps plugin for VMD is done.

cheers,
axel.

330.gif