From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Tue Aug 30 2011 - 12:45:15 CDT

erik,

please find attached an example script that will
work for this specific case. in order to make it
more general, you'll have to make the tests
and atom selections smarter. to do that, you'll
have to teach yourself some Tcl scripting and
also have a close look at the VMD scripting
examples/tutorial chapter in the VMD user's
guide and additional material.

the attached example is to demonstrate the
power of a little bit of scripting, when you
exploit the versatile commands, and particularly
the atomselect command in VMD.

to use it, make sure you have your propene.xyz
and propene.dcd file in the same directory as
the script and then go to the VMD command
console window and run the command:

play find_products.tcl

that will process your data and create a file
selectedatoms.pdb that has the atoms that
you are looking for. from there it is only a
small step to generating a lammps data file
with the topotools plugin. ;-)

don't hesitate to ask the list, if you need
help with scripting, but please make sure
that you first familiarize yourself a little bit
with Tcl/VMD scripting and the quirks of
the Tcl syntax in particular.

good luck,
     axel.

On Tue, Aug 30, 2011 at 12:17 PM, winardi, erik <egw24_at_yahoo.com> wrote:
> Dear Dr. Kohlmeyer,
> I attached 2 files in my email:  .car and .xyz files.
> The .car file contain the initial structure of the system ( 1 propene and
> 100 O2)
> The .xyz file is extracted from VMD at the final timestep solution from
> lammps. The molecule of interest in this final solution is the H2O2 molecule
> and these are the information of the atoms that construct that molecule:
> Atom index 2 - O      11.293134        1.988555        2.774701
> Atom index 3 - O      12.201421        2.310666        1.665972
> Atom index 204 - H   12.034750        1.619421        0.982851
> Atom index 207 - H   10.488749        2.425842        2.746771
>
> What I want to do is to extract these atoms only without any other atoms and
> create an input file to the lammps for another simulation.
> Many Thanks
> Erik
> ________________________________
> From: Axel Kohlmeyer <akohlmey_at_gmail.com>
> To: "winardi, erik" <egw24_at_yahoo.com>
> Cc: Vmd l <vmd-l_at_ks.uiuc.edu>
> Sent: Tuesday, August 30, 2011 10:54 AM
> Subject: Re: vmd-l: Lammps Output data format
>
> On Tue, Aug 30, 2011 at 11:43 AM, winardi, erik <egw24_at_yahoo.com> wrote:
>> Dear Dr. Kohlmeyer,
>> Thank you for your respond, it really helpful.
>> I will explain what I am currently doing.
>> I ran propene oxidation  containt 1 propene and 100 O2 = 209 total atoms
>> at
>> Temperature of 2500K using NVT ensemble.
>> I am using reaxFF to do the simulation and come up with several molecules
>> like CO and H2O2.
>> I am trying to get the CO(2 atoms) only and H2O2(4 atoms) only from the
>> molecule data result without taking all the other atoms.
>
> ok.
>
>> What I did is, I picked the atoms in VMD and wrote down all the atom index
>> for those atom molecule and make a new lammps input file manually for
>> these
>> 2 molecules (CO and H2O2). We want to try to run and break the molecule
>> using reaxff and measure the energy for that both molecules.
>
> ouch. you did something the hard way, where VMD is particularly powerful
> in allowing to you write scripts to automate a process.
>
> if you can provide an example file, i can probably provide you
> with a script template that can find and identify different molecular
> species, which you could then amend and extend as needed.
> that would be used to assemble an atom selection for the new
> system, which can be copied to a new "molecule" in vmd and
> then written out to a lammps compatible data file.
>
>> I couldn't create the new input file for both atoms. I just wondering how
>> to
>> write the correct atom input for lammps so I could write a converter for
>> write the input data for lammps using the information I got from the VMD
>> by
>> picking the atom (Coordinate, Atom Index, etc).
>> What I can think of is to delete all the molecules in the box and leave
>> the
>> molecule of interest, but it will take a lot of time to pick more about
>> 200
>> atoms in VMD visualization panel just to delete the atoms. Is there any
>> better way to do this ?
>
> yes. again, have a look at the atomselect command.
> it is _very_ powerful. the only tricky thing is to find
> molecules that have bonds going across periodic
> boundaries, but there are ways to deal with that, too.
>
> cheers,
>     axel.
>
>> I hope I explain it clear enough.
>> Thank so much,
>>  Erik
>>
>> ________________________________
>> From: Axel Kohlmeyer <akohlmey_at_gmail.com>
>> To: "winardi, erik" <egw24_at_yahoo.com>
>> Cc: "vmd-l_at_ks.uiuc.edu" <vmd-l_at_ks.uiuc.edu>
>> Sent: Monday, August 29, 2011 1:20 PM
>> Subject: Re: vmd-l: Lammps Output data format
>>
>> On Mon, 2011-08-29 at 10:20 -0700, winardi, erik wrote:
>>> Dear VMD users,
>>
>> dear erik,
>>
>>> I have questions about using the lammps.trj output from VMD.
>>> 1. I tried to use the lammps.trj format datafile for lammps data
>>> input, I am guessing that I can't use the output of lammps.trj for
>>> lammps input file. I understand that VMD can use the topo
>>> writelammpsdata command to provide the initial structure data to
>>> lammps. I just curious when do we need to provide this lammps.trj data
>>> in lammps?
>>
>> i don't really understand your question, which seems to be
>> more appropriate for the lammps-users mailing list in the
>> first place. do you want to use a lammps trajectory dump
>> as input for the read_data command? this is not possible.
>>
>>> 2. I went trough the topotools website but I couldn't find how the
>>> data format for topo writelammpsdata is written. I am trying to make a
>>> converter for different data format to be converted to lammps data
>>> format. It would be great if I could get the format of writting the
>>> initial lammps molecule data.
>>
>> again, this question would be better asked on the lammps-users mailing
>> list. the format of the lammps data file is documented in great detail
>> in the lammps manual. look up the documentation of the read_data
>> command.
>>
>> what kind of a conversion are you looking for. for the most part
>> the topotools plugin aims to provide already the infrastructure
>> to write correctly formatted lammps data files and VMD provides
>> (through molfile/babel) access to a large variety of input file
>> formats. the tricky part in between is to generate/reconstruct
>> the pieces of information that are needed for a proper topology
>> (i.e. lammps data) file, that are missing from the many existing
>> coordinate file formats. this is something that is very system
>> specific and thus it is impossible to write a simple converted.
>> the (incomplete) topotools tutorial on my home page gives a few
>> hints at which steps are missing and how to generate the information
>> for a couple of rather simple systems.
>>
>> if you can give me a more specific example of the kind of
>> problem that you want to address, i'd be happy to make further
>> suggestions or even provide some script templates, if they
>> are easy enough to do. i would also encourage you to reuse
>> existing tools as much as possible instead of writing your
>> own tool from scratch, unless there are very, very good
>> reasons to do so.
>> thanks,
>>     axel.
>>
>>
>>
>>>
>>> Many Thanks,
>>> Erik
>>
>> --
>> Dr. Axel Kohlmeyer
>> akohlmey_at_gmail.com http://goo.gl/1wk0
>>
>> Institute for Computational Molecular Science
>> Temple University, Philadelphia PA, USA.
>>
>>
>>
>>
>
>
>
> --
> Dr. Axel Kohlmeyer
> akohlmey_at_gmail.com  http://goo.gl/1wk0
>
> Institute for Computational Molecular Science
> Temple University, Philadelphia PA, USA.
>
>
>
>
>

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com  http://goo.gl/1wk0
Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.