# A proper way to define angle coeff for class2

Dear all,

I have the trouble to define angle coeff using force field class2 style. Before I post this question, I (of course) check the archive and the doc page of angle_style (http://lammps.sandia.gov/doc/angle_class2.html) and angle_coeff (http://lammps.sandia.gov/doc/angle_coeff.html). No answer found so here come the question.

I would like to define two equilibrium angles in my system.

#1 angle_coeff 1*3 109.5665 105.3402 0 0
#2 angle_coeff 2 bb 10.7256 1.0789 1.0789
#3 angle_coeff 3 ba 186.6098 186.6098 1.0789 1.0789

#4 angle_coeff 4*6 114.8591 75.2794 0 0
#5 angle_coeff 5 bb -13.0929 1.5242 1.3457
#6 angle_coeff 6 ba 58.8451 130.2229 1.5242 1.3457

Since the #3 argument of “ba” term has to use equilibrium angle (theta0) from #1 (109.5665), I think I have to use 13 in #1. Likewise, #6 of “ba” term has to use equilibrium angle (theta0) from #4 (114.8591), I use 46 in #4.

The error code gives me “ERROR: All angle coeffs are not set (…/angle.cpp:64)”

Am I doing anything wrong?

I had tried the following and it shows no error.

#1 angle_coeff * 109.5665 105.3402 0 0
#2 angle_coeff * bb 10.7256 1.0789 1.0789
#3 angle_coeff * ba 186.6098 186.6098 1.0789 1.0789

#4 angle_coeff 4*6 114.8591 75.2794 0 0
#5 angle_coeff 5 bb -13.0929 1.5242 1.3457
#6 angle_coeff 6 ba 58.8451 130.2229 1.5242 1.3457

I am not sure whether it is an appropriate format to define the system, even #4, #5 and #6 should override the previous setting. Thanks for your help and wish you happy holidays.

Cheers,
F.S.

Every angle type (6 in your case) must have

angle (a), bond-angle (ba), and bond-bond (bb)

coeffs defined, for LAMMPS to not complain.

In your first example you have 6 a, but only 2 bb (2 and 5)

and 2 ba (3 and 6). So you get an error.

In your 2nd example, you use * for a,bb,ba, so that
defines everything (6 for each). Then you overwrite a subset
of them, which is also fine. So LAMMPS says you have

all the coeffs defined.

Steve

Thanks Dr. Steve. You explanation is very clear and straightforward.

For whom might also be confused, I should use

#1 angle_coeff 1 109.5665 105.3402 0 0
#2 angle_coeff 1 bb 10.7256 1.0789 1.0789
#3 angle_coeff 1 ba 186.6098 186.6098 1.0789 1.0789

#4 angle_coeff 2 114.8591 75.2794 0 0
#5 angle_coeff 2 bb -13.0929 1.5242 1.3457
#6 angle_coeff 2 ba 58.8451 130.2229 1.5242 1.3457

I believe it means that even only using “one specific energy term” of style class 2, we have to define all the other terms as well (e.g. irrelevant coefficients equal zero).

Cheers,
F.S.