LAMMPS-How to edit data file?

How do I edit a data file line by line? The data file contains 6000 atoms which I found hard to edit without any aid. I need to change the coordinates of my cutting tool so that I can create certain rake angle. The whole project is about nanometric cutting, where copper is the cutting material and diamond is the cutting tool. I tried to use materials studio software to edit, but I could not obtain step-by-step procedure in editing the data file. I’m totally new to LAMMPS. Hope someone can help me here.

Thanks in advance

Sincerely,
Dinesh

If you are using a visualization program to modify your geometry, you will need to output the geometry into a new data file, which may or may not be in correct format of a LAMMPS data file. This will depend on the output options of the program you are using. If it isn’t, you will then need to convert it into the correct format for LAMMPS.

Alternatively, you could write a script to read in your current data file, make the desired modifications, and output the new values into the correct format for a LAMMPS data file. However, you should confirm you didn’t do something strange to your geometry.

Michael

dinesh,

How do I edit a data file line by line? The data file contains 6000 atoms
which I found hard to edit without any aid. I need to change the coordinates
of my cutting tool so that I can create certain rake angle. The whole
project is about nanometric cutting, where copper is the cutting material
and diamond is the cutting tool. I tried to use materials studio software to
edit, but I could not obtain step-by-step procedure in editing the data
file. I'm totally new to LAMMPS. Hope someone can help me here.

please note, that the kind of problem you describe is for the most
part not really a LAMMPS problem (even though you could use LAMMPS to
solve it entirely) and you are not likely to find a single
step-by-step solution that matches your specific needs. the way to go
about addressing issues like this is to break it down into pieces and
then solve each part individually.

what you basically need are two things:
1) a tool that can do a specific transformation for a subset of coordinates
2) a tool that can make a data file readable to the tool 1) and take
the output from tool 1) and turn it back into a data file

you have multiple options.
- VMD: can read and write data files through the topotools plugin and
can also read and write many kinds of other coordinate files
(including formats that you can read and write in materials studio)
- VMD: can also do coordinate transformations directly on any set or
subset of coordinate data through its scripting interface (using the
atom selections)
- VMD: allows you to visually inspect and verify the resulting coordinates
- LAMMPS: itself can write and write(!) data files
- LAMMPS: has the displace_atoms command which can move and translate
groups of atoms
- LAMMPS: has the group command, which can select groups of atoms
- LAMMPS: has the write_dump image command, which can visualize your
current system

now all you have to do is to figure out how to do all the pieces
(there is documentation and tutorials for both program) or look up
additional tools that your are more comfortable with and put them
together to do what you want. there are likely many more ways to do
the same thing, e.g. write a custom
python/perl/awk/c++/fortran/whatever program that reads, modifies and
then writes out your data as needed.

axel.

With a simple fortran/c/python etc code.

Otto