[lammps-users] positions on the surface of the cylinder using set command

Dear LAMMPS users,

  1. I am trying to choose 14 positions on the surface of the cylinder to connect the DNA beads through Morse potential form with these 14 points. When I visualize the xyz file using Ovito before connecting the points to DNA beads, I can only see the cylinder filled with atoms as in the attachment, but couldnt see the positions using the "set"command I have implemented on the surface of the cylinder. Kindly give me the suggestions.

First off, you need to read the manual even more carefully, and you probably need somebody local with more experience in programming to help you get a better understanding of how to write and debug programs. writing this kind of complex input is essentially writing a little program in the “LAMMPS input language” and thus you need to apply concepts of programming and debugging to get meaningful results and have an effective approach to implementing what you need. these are skills that are next to impossible to teach via email.

there is a technical issue (your equal style expression use the wrong kind of variable reference and thus it will always give the same result) and a conceptual problem. please note that equal style variables in LAMMPS are more like functions than like variables.
the “var” option to the create_atoms command can be used to select on which lattice positions atoms will be created. this means the “variable” pointed to by the “var” keyword is evaluated for each potential set of coordinates within a region (as determined by the lattice command and the region command) and when it value is non-zero, the atom will be created.
thus the “internal” variables are not an input that needs to be set but they will be set internally (hence the name) by LAMMPS and then the equal style variable is consulted on whether those positions would return a zero or non-zero value. the following input

region cube block 0 10 0 10 0 10
create_atoms 1 region cube

will create a cube filled with atoms. however when using this input with the var keyword

variable xx internal 0.0
variable yy internal 0.0
variable zz internal 0.0
variable select equal sqrt(v_xxv_zz+v_yyv_zz)<5

region cube block 0 10 0 10 0 10
create_atoms 1 region cube var select set x xx set y yy set z zz

it will create a partially filled cube with the function in the equal style variable “select” determining which of the possible lattice positions will be created.

what your input is doing is creating multiple atoms at exactly the same location. that is definitely not what you want.
if you want to create atoms in a spiral on a cylindrical surface, you have to follow a very different approach.
a) you should be using create_atoms single
b) you should be using 3 equal style variables to compute the x, y, and z position from within a loop based on the loop index.

here is an example:

variable i loop 14
variable radius index 5.0
variable rotate index 3.0
variable transl index 0.7

variable z equal v_iv_transl
variable x equal v_radius
sin(v_rotatev_iPIv_z/180.0)+5.0
variable y equal v_radius
cos(v_rotatev_iPI*v_z/180.0)+5.0

label loop
create_atoms 1 single {x} {y} ${z}
next i
jump SELF loop

however, if you want to use those as tether positions for your chains, then you have much more work to do. and that goes beyond the scope of this mailing list exceeds the amount of time I can spend to solve your problem for you. so please see my advice from the beginning.

axel.

Dear LAMMPS users,

  1. I am trying to choose 14 positions on the surface of the cylinder to connect the DNA beads through Morse potential form with these 14 points. When I visualize the xyz file using Ovito before connecting the points to DNA beads, I can only see the cylinder filled with atoms as in the attachment, but couldnt see the positions using the "set"command I have implemented on the surface of the cylinder. Kindly give me the suggestions.

thank you axel for giving me the detailed suggestions once again
and for spending more time to point out the errors line by line .
I will read the manual more carefully again before implementing.

Those are some cool LAMMPS input scripts.

Just one additional comment:
If you plan to eventually simulate a system containing bonds (such as a coarse-grained DNA polymer, bonded to the cylinder), then you need to create a LAMMPS DATA file. The DATA file format is explained here:

https://lammps.sandia.gov/doc/2001/data_format.html

Also check out:
https://lammps.sandia.gov/doc/read_data.html

https://lammps.sandia.gov/doc/atom_style.html

If you don’t want to write the DATA file yourself, there are some programs that can build them for you.

https://lammps.sandia.gov/prepost.html

The moltemplate and topotools molecule builders are both very general, and work with almost any LAMMPS atom style. (They are not limited to building all-atom simulations.) This makes them pretty good for preparing DATA files for coarse-grained systems such as yours. (Disclaimer: I wrote moltemplate).

P.S. Although none of these examples are identical to what you are building, perhaps the pictures below give you an idea of what you can build with moltemplate:

https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_OPLSAA/functionalized_nanotubes_NH2#functionalized-nanotubes

http://moltemplate.org/examples.html#2bead_polymer

http://moltemplate.org/examples.html#translocation

http://moltemplate.org/examples.html#confined_DNA

http://moltemplate.org/examples/force_fields.html

https://github.com/jewettaij/moltemplate/blob/b9eea0edb051ba3ea3b54cea006a32d63cb346de/examples/coarse_grained/simple_examples/lennard_jones_cylindrical_container/images/tubewall%2Bsolvent_t%3D3000steps.png

(Since I am mentioning molecule builders, I will also mention VIPSTER. It’s a GUI program for drawing molecules that can be used for either all-atom or coarse-grained systems. It used to be difficult to use, but Sebastian has put some time into make it better recently. You could build part of the system, such as the polymer, using VIPSTER, and connect it to your cylinder by importing the polymers into either moltemplate or topotools, and assembling the final system using those tools. Most likely, using VIPSTER will make it harder to build the system that you described, because it is so simple. But I mention it in case other people discover this post.)

Thanks Andrew for all the suggestions…I will look into it.