[lammps-users] Adding a new bond type

Dear LAMMPSers,

I’m adding a new bond type to LAMMPS. Following the way to add a new pair type, I’ve tried to add two lines

#ifdef BondInclude
#include “bond_fenecut.h”
#endif

#ifdef BondClass
BondStyle(fenecut,BondFenecut)
#endif

to either the style_user.h or the style_molecule.h,

but the compilation always fails like this:

In file included from style.h:352,
from force.cpp:202:
style_user.h: In member function ‘LAMMPS_NS::Bond* LAMMPS_NS::Force::new_bond(const char*)’:
style_user.h:36: error: expected type-specifier before ‘BondFenecut’
style_user.h:36: error: cannot convert ‘int*’ to ‘LAMMPS_NS::Bond*’ in return
style_user.h:36: error: expected ‘;’ before ‘BondFenecut’
style_user.h:36: error: ‘BondFenecut’ was not declared in this scope
force.cpp:205: error: expected primary-expression before ‘else’
force.cpp:205: error: expected ;' before 'else' make[1]: *** [force.o] Error 1 make[1]: Leaving directory /home/zhenlong/pair_fene_cut/lammps-16Nov07/src/Obj_serial’
make: *** [serial] Error 2

I am not sure what is the problem since the class I’ve created and the way I incorporate it is similar to all the existing bond types.

Would you please tell me any possible solutions to this problem? Thank you very much!

best,

Zhenlong

This problem has been SOLVED, thanks!

Zhenlong