LAMMPS capability

Hello,

I feel LAMMPS would become considerably more dynamic with a feature described by the following example: after relaxing a bulk polymer containing a cylindrical void space, insert a certain CNT based a ‘molecule’ template. I also suggest this because it seems to be very close to being possible, but not quite. The key points are: this molecule would not be randomly placed or rotated initially, it not a rigid body, and of course the feature would need to support a single, infinitely periodic structure.

As I understand it, the currently suggested method for combining two files is using topotools, which seems like more work than just setting up and relaxing each system separately. The motive behind this is the case where the same, large polymer system is used but many different CNTs wish to be examined.

Thanks,

Jake

If all you want to do is be able to create a new instance of a
molecule and tell LAMMPS exactly where you want to put it, that seems
like a reasonable feature. And I generally agree that having more
options to directly, manually create and delete individual atoms,
bonds, angles, dihedrals, impropers, and entire molecules directly in
LAMMPS would open up some cool possibilitie

   I don't think the size (or periodicity) of the molecule being added
matter to LAMMPS.

--- alternatives ---

   The main thing I wanted to say was doing the same thing in
topotools or moltemplate is not as difficult or cumbersome as you
think. As you know, both topotools and moltemplate can merge two data
files. (For example, one containing a polymer melt with a hole, and
the other containing a nanotube.) The pizza.py tool can also do this:
http://sourceforge.net/p/lammps/mailman/message/25061283/

   As for topotools, I understand why you don't want to be forced to
use VMD's graphical user interface every time you want to change the
nanotube. However you can run topotools through the terminal by
supplying it with a file of topotools commands (eg.
"topo_commands.tcl"), and invoking VMD with the -e option. This way
the graphical user interface is never needed. For example:

vmd -e topo_commands.tcl

(moltemplate has no graphical interface, so you can only run it
through the shell)
You could invoke either topotools, moltemplate, or pizza.py this way
using the "shell" command in LAMMPS in the middle of a simulation.

http://lammps.sandia.gov/doc/shell.html

Hope this helps.

Andrew

Hello,

I feel LAMMPS would become considerably more dynamic with a feature
described by the following example: after relaxing a bulk polymer containing
a cylindrical void space, insert a certain CNT based a 'molecule' template.
I also suggest this because it seems to be very close to being possible, but
not quite. The key points are: this molecule would not be randomly placed or
rotated initially, it not a rigid body, and of course the feature would need
to support a single, infinitely periodic structure.

that is a very specific need and use case.

As I understand it, the currently suggested method for combining two files
is using topotools, which seems like more work than just setting up and
relaxing each system separately. The motive behind this is the case where
the same, large polymer system is used but many different CNTs wish to be
examined.

i disagree with your reasoning. it is *exactly* the case you are
describing for which using a tool separate from LAMMPS with powerful
scripting capability is more suitable. LAMMPS' scripting is
(deliberately) limited. yes, you may need to figure out how to do the
manipulations you want, but you only need to figure it out once, and
then can "mass produce" inputs, if needed also submit scripts and more
from templates. trying to shoehorn this all into LAMMPS may only lead
into making it even more complex and laborious to maintain as it
already is.

doing topology manipulations from inside LAMMPS is quite complicated
to implement, as it interferes with parallelization and for efficiency
reasons, certain data structures have to be committed to particular
dimensions by the time a simulation box is created. that generally
flies into the face of doing more flexible manipulations. it is quite
difficult as it is and a lot of time is spent on chasing down bugs (or
rather "unexpected features") reported by people trying to make
"creative" use of the facilities that already exist in ways that
nobody expected.

if you still feel strongly about the feature(s) you want, don't get
discouraged, but rather open a text editor and start programming.
prove me wrong. a lot of LAMMPS is contributed code written by people
that needed something that the core developers didn't care about or
didn't have the time or didn't think it was possible or didn't think
it was worth it. one never knows. steve generally only objects against
contributions that have technical deficiencies.

axel.

Actually, I think you can already do this.

The create_atoms command has a molecule option to use
a molecule template file. If you first use read_data
to define the background atoms with the void, you
can then use create_atoms single (for one molecule)
or region (to fill a void with a lattice of molecules) and
add the molecule(s).

I’ve never used it for your use case, but try it out
and see if it works or needs some additional option
to do what you want.

You could also read in a bulk system without the
void, then use delete_atoms to create the void
before inserting the molecule(s) from the template
file.

Steve

Thanks Steve! That should do it after modifying the original read_data or read_restart (not yet confirmed). This is of course because ‘create_atoms single’ can’t add new atom types or bond types that weren’t defined by the original read_data. I am surprised by this, but I think it comes down to my lack of understanding of interfering with parallelization (but Axel’s explanation was very helpful). Essentially, my original request comes down to being able to add another read_data after a restart. In my ignorance I would guess this should be possible by scanning the input file for that before creating the simulation box (e.g. essentially one command which reads both a restart and a data file).

The first command that creates the simulation box

(create_box or read_data) needs to define the number

of atom types, bond types, etc. Even if it more than

the # of types in the read data file (there are read data
keywords and create_box keywords that can be used
to do that).

Then you should have no problem adding extra atoms,
moleclues, etc, via more create_atoms commands
or fix deposit, etc.

You cannot currently use multiple read_data commands
or a read_restart followed by read_data. But your original
Q didn’t sound like that’s what you needed to do, since
you mentioned using molecule templates.

Steve

Thanks Steve. In an atomistic fully-personalized simulation, (atom_style full and other styles class2, for example), I also need to add the new coefficients for torsion, dihedrals, impropers, etc. In this case in order to fully define the molecule, it would be ideal for the molecule template to be identical in format to a read_data file (to have those sections included too). This is not least because I assume most people in my situation would build the molecule (or possibly complicated lattice structure) and export it the same way they built the original system.

The formats of the 2 files are different. The molecule template

is used for different things, besides what you are wanting to use it for.

What you probably really want is the ability to use multiple read_data

commands, reading multiple data files. I’ve been thinking about
how to enable that.

Steve

Yes I agree. I realize I’m out of my league at this point, but it seems if you require that both are read in with the same command it just becomes an exercise in parsing. As far as also not requiring that people plan ahead with the number of atom types (for read_data commands on the fly), how much efficiency is lost if this number is automatically set to a high value? I’m a MATLAB guy so I’m probably incorrectly picturing a simple sparse matrix.