Specifying number of bond types

Is there a way (after the simulation starts) to create two atoms, bond
them together, and continue the dynamics?

I thought something like the following would work, but I think
atom->nbondtypes is set to zero and it's causing errors:

   atom_style bond
   lattice sc 3.0
   region simbox block 0 10 0 10 0 10
   create_box 1 simbox
   mass 1 14
   pair_style lj/cut 4.0
   pair_coeff 1 1 1.0 1.0
   special_bonds lj 0 0 0
   bond_style harmonic
   bond_coeff 1 1.3 0.5 # error here
   create_atoms 2 single 5 5 5
   create_atoms 2 single 5.1 5 5
   set group all bond 1 # would obviously be a group other than "all"
                           # if there were other atoms present

Is there a way to set the number of bonds (, angles, impropers, etc.) from
the input file, or must that always be done from a read_data or
read_restart command? Same thing for specifying that atom "a" is bonded
to atom "b."

Karl D. Hammond
University of Tennessee, Knoxville

karl,

Is there a way (after the simulation starts) to create two atoms, bond
them together, and continue the dynamics?

yes.

I thought something like the following would work, but I think
atom->nbondtypes is set to zero and it’s causing errors:

atom_style bond
lattice sc 3.0
region simbox block 0 10 0 10 0 10
create_box 1 simbox
mass 1 14
pair_style lj/cut 4.0
pair_coeff 1 1 1.0 1.0
special_bonds lj 0 0 0
bond_style harmonic
bond_coeff 1 1.3 0.5 # error here
create_atoms 2 single 5 5 5
create_atoms 2 single 5.1 5 5
set group all bond 1 # would obviously be a group other than “all”

if there were other atoms present

Is there a way to set the number of bonds (, angles, impropers, etc.) from
the input file, or must that always be done from a read_data or
read_restart command? Same thing for specifying that atom “a” is bonded
to atom “b.”

the number of bond types (same as atom and any other “types”)
would need to be set before a “box” is created. this box creation
can happen through create_box or read_data.

there might be a way to extend the create_box command as you
desire, but at the moment, i think the only way to proceed is to
generate a simple data file. you should be able to augment
that data afterwards from the input script. there are been significant
interest in making these things more dynamical, so i would
expect some improvements in the future, but at the same token
it affects some very basic assumptions in the code and giving
those up may result in losing parallel efficiency. so don’t hold
your breath.

cheers,
axel.