define a circle around an atom

Dear Lammps users ,

I want to define a circle around a special atom of a group and then I want to know the number of different atoms inside of this circle at different times .
Can you please let me know how i can do that ?

thanks in advance .

Hi Saeed,

You can easily do this by post-processing in vmd. Here, the selection is all the H atoms. The code calculates the number of atoms within 3 Å of all the H atoms. You should choose your desired selection and distance.

set mol [molinfo top]
set fp [open “No-atoms.tmp” w]

set n [molinfo $mol get numframes]

for {set i 0} {$i < $n} {incr i} {
puts “\t \t progress: $i/$n”

set a [atomselect top “within 3 of type H” frame $i]
set num [$a num]

puts $fp “$i $num”
$a delete

$a delete

close $fp

The compute coord/atom command counts the
number of atoms within a spherical cutoff of each
atom in the group that you give it.


Dear lammps users ,

Is it possible to define a circle with region command ?!


No. LAMMPS is programmed in a 3D way, so even if your simulation is 2D, the closest you’ll get to a circle is using a cylinder region.