From: Georg Spiekermann (spiek_at_gfz-potsdam.de)
Date: Mon Aug 16 2010 - 10:12:10 CDT

hello,

I would like to share a workaround to a problem I had when using
DynamicBonds.

When I visualize with VMD silicate melts from MD runs, the displaying of
Si-O bonds is desired, but oxygen-oxygen-bonds are generally not
desired, they look disturbing.

In draw_dynamic_bonds (as in others, like draw_bonds) bonds between
hydrogen and hydrogen are automatically excluded from being drawn. Bonds
between two other atoms of the same type (for example
oxygen-oxygen-bonds) seem not yet to be excludable when choosing
DynamicBonds.

My workaround to exclude oxygen-oxygen-bonds from being drawn by
DynamicBonds is this:
1) in Atom.h: To "#define ATOMHYDROGEN 3" I added "#define ATOMOXYGEN
4".
2) in BaseMolecule.h: To the "IS_HYDROGEN(s)"-macro I added an adapted
"IS_OXYGEN(s)"-macro. They recognize elements by the first character,
"H" and "O".
3) in BaseMolecule.C: Analogous to "if (aname != NULL &&
IS_HYDROGEN(aname)){ a->atomType = ATOMHYDROGEN;}" I added the
equivalent for ATOMOXYGEN.
4) in DrawMolItem.C: In the for-loop I added "if (atom1->atomType ==
atom2->atomType) {tmp = p->next;free(p);continue;}".

It works and can be easily extended to more elements. It might also be
applied to similar routines like draw_polyhedra for example.
I am curious to know whether already exist other workarounds out there,
please let me know.

kind regards,
Georg Spiekermann