# Using a Group Command to Specify a Certain Dihedral Calculation

Hey Axel, thanks so much for the tips! They helped me solve the previous problem, but now I’ve encountered a new, related one. After obtaining some unexpected peaks when I plotted the dihedral histogram, my professor and I realized that they were occurring because my group command was too encompassing:

group DiHe type 3 6 7 8
compute 1 DiHe dihedral/local phi

Whereas I had only wanted the compute command to compute the value of one dihedral per monomer, it had computed others as well because there were multiple atoms of these types in each monomer. It seems that defining a group with types is not specific enough in my case, but with such a big system (6400 atoms), using atomic ID’s does not seem realistic either. Maybe there is a way to restrict the compute to the case where all four atoms are bonded? What do you think is the best way to solve this problem?

Charles Belina
Student Researcher
Skolkovo Institute of Science and Technology

Hey Axel, thanks so much for the tips! They helped me solve the previous
problem, but now I've encountered a new, related one. After obtaining some
unexpected peaks when I plotted the dihedral histogram, my professor and I
realized that they were occurring because my group command was too
encompassing:

group DiHe type 3 6 7 8
compute 1 DiHe dihedral/local phi

Whereas I had only wanted the compute command to compute the value of one
dihedral per monomer, it had computed others as well because there were
multiple atoms of these types in each monomer. It seems that defining a
group with types is not specific enough in my case, but with such a big
system (6400 atoms), using atomic ID's does not seem realistic either. Maybe
there is a way to restrict the compute to the case where all four atoms are
bonded? What do you think is the best way to solve this problem?

the compute *is* already restricted to only consider explicitly
defined dihedrals.

if you say you have many monomers and you want to look at only
specific atoms in them, then i would assume, that your atom ids should
follow a pattern where the individual atom id is like the atom id in
the first monomer plus the molecule/monomer id times the number of
atoms per monomer. for that you can define patters, or in more complex
cases, use an atom style variable (value != 0 => atom is included in
group; value == 0 => atom is not included).

axel.