Creating a hole in the structure

Dear Lammps Users,
I want some advice on how to remove the molecules in a structure. I have a complete structure (CSH) and I want to create an initial crack (elliptical shape) at the center of the structure. Is there a way to do it in lammps so that when I removed the atoms (e.g., Ca, S, O, and H), the charge should be maintained. One possible way is to remove manually in the data, but I am looking for an alternative approach.

I assume that you want to delete molecules which overlap with the
hole, and avoid cutting molecules in half. I don't think the
"delete_atoms" LAMMPS command has this feature. (Perhaps the
"delete_atoms" command could be augmented to delete entire molecules
whenever any of their atoms get deleted.) Until then, you might have
to write your own script to do this. (Or edit the "delete_atoms.cpp"
LAMMPS source code file, add this feature, and earn the adoration of
millions.) Here are some choices:

---- method 1: ----

Since you have already built the data file, it might be easier to
manually edit the DATA file you already have, or write a (python?)
script to read the data file, and figure out which atoms belong to
molecules which overlap with the elliptical hole. Once you have
figured that out, you could modify your script to search for the
Bonds, Angles, Dihedrals, Impropers which contain these atoms. Then
create a new data file with these atoms, and bonded interactions
removed. Be sure to renumber the atom ID numbers consecutively so
that there are no gaps, and change the number of atoms (and bonds, and
angles, ...) at the top of the DATA file.

---- method 2: use moltemplate ----

If you used "moltemplate" to build a DATA file, then it's relatively
easy to delete atoms from your system (and it will take care of
deleting the bonds, angles, dihedrals, ... automatically). There are
a couple examples:
http://www.moltemplate.org/visual_examples.html#nanotube+water
http://www.moltemplate.org/visual_examples.html#translocation

Alternatively, since you already built your system using another tool,
you first have to convert that LAMMPS data file into a moltemplate
file (".lt" file) using the "ltemplify.py" script (which is explained
in appendix B of the moltemplate manual at
http://www.moltemplate.org/doc)

STEP 1
ltemplify.py -name OldSystem file.in file.data > old_system.lt

...where "file.data" is your original data file, and "file.in" is your
old LAMMPS input script containing
force-field-parameters/coeff-commands for your system. (Note: All of
the pair, bond, angle, dihedral, improper parameters for your system
must be defined in this file using various coeff commands.
Fortunately, these numbers don't have to be correct if your goal is
only to create a new DATA file.)

STEP 2
...Then create a new file "system.lt", and add the following lines
--- system.lt ---
import "old_system.lt"
old_system = new OldSystem
delete $atom:old_system/id426
delete $atom:old_system/id427
delete $atom:old_system/id432
:

> Dear Lammps Users,
> I want some advice on how to remove the molecules in a structure. I have a complete structure (CSH) and I want to create an initial crack (elliptical shape) at the center of the structure. Is there a way to do it in lammps so that when I removed the atoms (e.g., Ca, S, O, and H), the charge should be maintained. One possible way is to remove manually in the data, but I am looking for an alternative approach.

I assume that you want to delete molecules which overlap with the
hole, and avoid cutting molecules in half. I don't think the
"delete_atoms" LAMMPS command has this feature. (Perhaps the
"delete_atoms" command could be augmented to delete entire molecules
whenever any of their atoms get deleted.) Until then, you might have
to write your own script to do this. (Or edit the "delete_atoms.cpp"
LAMMPS source code file, add this feature, and earn the adoration of
millions.) Here are some choices:

---- method 1: ----

Since you have already built the data file, it might be easier to
manually edit the DATA file you already have, or write a (python?)
script to read the data file, and figure out which atoms belong to
molecules which overlap with the elliptical hole. Once you have
figured that out, you could modify your script to search for the
Bonds, Angles, Dihedrals, Impropers which contain these atoms. Then
create a new data file with these atoms, and bonded interactions
removed. Be sure to renumber the atom ID numbers consecutively so
that there are no gaps, and change the number of atoms (and bonds, and
angles, ...) at the top of the DATA file.

---- method 2: use moltemplate ----

If you used "moltemplate" to build a DATA file, then it's relatively
easy to delete atoms from your system (and it will take care of
deleting the bonds, angles, dihedrals, ... automatically). There are
a couple examples:
http://www.moltemplate.org/visual_examples.html#nanotube+water
http://www.moltemplate.org/visual_examples.html#translocation

Alternatively, since you already built your system using another tool,
you first have to convert that LAMMPS data file into a moltemplate
file (".lt" file) using the "ltemplify.py" script (which is explained
in appendix B of the moltemplate manual at
http://www.moltemplate.org/doc)

STEP 1
ltemplify.py -name OldSystem file.in file.data > old_system.lt

...where "file.data" is your original data file, and "file.in" is your
old LAMMPS input script containing
force-field-parameters/coeff-commands for your system. (Note: All of
the pair, bond, angle, dihedral, improper parameters for your system
must be defined in this file using various coeff commands.
Fortunately, these numbers don't have to be correct if your goal is
only to create a new DATA file.)

STEP 2
...Then create a new file "system.lt", and add the following lines
--- system.lt ---
import "old_system.lt"
old_system = new OldSystem
delete $atom:old_system/id426
delete $atom:old_system/id427
delete $atom:old_system/id432
:
------------
where 426, 427, 432, etc... are the atoms from your data file which
you want to delete (which you identified earlier by other means. See
below...).

My apologies, that should have been:

delete old_system/id426
delete old_system/id427
delete old_system/id432
:
(Leave out the "$atom:")
Forgive me if I get some of these details wrong. Hopefully this email
gives you some ideas on how to proceed. (The "delete" command is
explained in chapter 8 of the manual.)

Cheers

Thanks a lot, Andrew and it is informative too. I hope it will work out and will update soon, if successful.

Thanks!
Gideon

> Dear Lammps Users,
> I want some advice on how to remove the molecules in a structure. I have a complete structure (CSH) and I want to create an initial crack (elliptical shape) at the center of the structure. Is there a way to do it in lammps so that when I removed the atoms (e.g., Ca, S, O, and H), the charge should be maintained. One possible way is to remove manually in the data, but I am looking for an alternative approach.

I assume that you want to delete molecules which overlap with the
hole, and avoid cutting molecules in half. I don't think the
"delete_atoms" LAMMPS command has this feature. (Perhaps the

delete_atoms *does* have this feature for about two years. see the
option "mol yes".

axel.

Oops...
  Well, in that case I would definitely use the "region" command to
define the region containing the molecules you want to delete, and
then use the "delete_atoms" command. That should be much easier than
what I suggested.

Cheers
Andrew
:\

Awesome, thanks!
I really appreciate your help. I am working on it and I hope I will get there soon.