OSDN Git Service

Atom renumbering was not working for pi anchor table. Fixed.
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Tue, 30 Oct 2012 00:12:01 +0000 (00:12 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Tue, 30 Oct 2012 00:12:01 +0000 (00:12 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@314 a2be9bc6-48de-4e38-9406-05402d4bc13c

MolLib/Molecule.c

index 8f6254a..52d3bfa 100755 (executable)
@@ -8975,12 +8975,19 @@ MoleculeRenumberAtoms(Molecule *mp, const Int *new2old, Int *old2new_out, Int is
        for (i = 0; i < mp->nimpropers * 4; i++) {
                mp->impropers[i] = old2new[mp->impropers[i]];
        }
+       /*  Renumber the connection table and pi anchor table  */
        for (i = 0; i < mp->natoms; i++) {
                Atom *ap = ATOM_AT_INDEX(saveAtoms, i);
                Int *ip = AtomConnectData(&ap->connect);
                for (j = 0; j < ap->connect.count; j++, ip++)
                        *ip = old2new[*ip];
+               if (ap->anchor != NULL) {
+                       ip = AtomConnectData(&ap->anchor->connect);
+                       for (j = 0; j < ap->anchor->connect.count; j++, ip++)
+                               *ip = old2new[*ip];
+               }
        }
+       
        if (mp->par != NULL) {
                /*  Renumber the parameters  */
                int n;