Using nspecial and special arrays from special.cpp on ghost atoms.

Hi all,

I am trying to code a pairwise interaction for which I sometimes need to find the bonded atoms to a ghost atom. However, using nspecial[ghost_ID][0] returns 0 always, so it seems that no record is kept of specials on the processor for which the atoms are ghost.

Is there a way to get this information for the purpose of implementing a pairwise interaction? pair_hbond_dreiding_*.cpp isn’t a guide here, since
the acceptor’s bonds are irrelevant.

Thanks for any help,

Regards,

Gil.

Hi all,

I am trying to code a pairwise interaction for which I sometimes need to
find the bonded atoms to a ghost atom. However, using nspecial[ghost_ID][0]
returns 0 always, so it seems that no record is kept of specials on the
processor for which the atoms are ghost.

that is correct. querying for atom ids over nlocal is an error.
even more so, for pairs with exclusion factors of 0.0 the "j"
atoms are removed from the neighborlist.

to find atoms bonded to a specific atom, you should have
a look at atom->num_bonds and atom->bond_atom
mind you bond_atom stores atom ids, so you may have
to use atom->map to convert them to local atom indices,
if needed.

cheers,
    axel.

The num_bond array that Axel mentions is not
stored for ghost atoms either. If you want atoms
bonded to a ghost atom, you would have to
communicate the bond list (e.g. num_bonds)
explicitly. You can do this from a compute
or fix via a call to the Comm class which calls
back to the fix/compute to pack/unpack the data
you wish to communicate.

Steve

Axel,

Thanks for your response.

Querying atom->num_bond[ghostID] with newton off appears to give the same result as nspecial. Perhaps there is a settings that I can’t seem to find to resolve this?

Regards,

Gil.