OSDN Git Service

Exclude atoms with occupancy = 0 from MM/MD calculations
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Tue, 6 Sep 2011 10:24:16 +0000 (10:24 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Tue, 6 Sep 2011 10:24:16 +0000 (10:24 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@111 a2be9bc6-48de-4e38-9406-05402d4bc13c

MolLib/MD/MDCore.c
MolLib/Ruby_bind/ruby_bind.c

index c7eaffe..8373ccc 100644 (file)
@@ -2663,6 +2663,7 @@ md_copy_coordinates_to_internal(MDArena *arena)
                return -2;  /*  Number of atoms does not match  */
        for (i = 0, ap1 = arena->mol->atoms, ap2 = arena->xmol->atoms; i < arena->mol->natoms; i++, ap1 = ATOM_NEXT(ap1), ap2 = ATOM_NEXT(ap2)) {
                ap1->r = ap2->r;
+               ap1->occupancy = ap2->occupancy;  /*  Occupancy can be used to exclude particular atoms  */
        }
        if (arena->mol->cell != NULL && arena->xmol->cell != NULL)
                memmove(arena->mol->cell, arena->xmol->cell, sizeof(XtalCell));
index 880263d..ef3fe7a 100644 (file)
@@ -3644,9 +3644,11 @@ static VALUE s_AtomRef_SetF(VALUE self, VALUE val) {
 
 static VALUE s_AtomRef_SetOccupancy(VALUE self, VALUE val) {
        VALUE oval = s_AtomRef_GetOccupancy(self);
+       Molecule *mp;
        val = rb_Float(val);
-       s_AtomFromValue(self)->occupancy = NUM2DBL(val);
+       s_AtomAndMoleculeFromValue(self, &mp)->occupancy = NUM2DBL(val);
        s_RegisterUndoForAtomAttrChange(self, s_OccupancySym, val, oval);
+       mp->needsMDCopyCoordinates = 1;  /*  Occupancy can be used to exclude particular atoms from MM/MD  */
        return val;
 }