예제 #1
0
def test_props(verbose=False):
    sys = System()

    box0 = PeriodicBox( Vector(10.0,10.0,10.0) )
    box1 = PeriodicBox( Vector(20.0,20.0,20.0) )

    if verbose:
        print(box0)
        print(box0.volume())
        print(box1.volume())

    assert(not sys.containsProperty("space"))

    sys.add( InterCLJFF("cljff") )

    if verbose:
        print(sys)
        print(sys.property("space"))
        print(sys.userProperties().propertyKeys())
        print(sys.builtinProperties().propertyKeys())

    assert(sys.containsProperty("space"))
    assert_equal( sys.property("space"), Cartesian() )

    sys.setProperty( "space0", LinkToProperty("space", FFIdx(0)) )

    if verbose:
        print(sys.property("space0"))

    assert(sys.containsProperty("space0"))

    sys.setProperty("space0", box0)

    if verbose:
        print(sys.property("space"))

    assert_equal(sys.property("space0"), box0)

    sys.setProperty("space1", box1)

    sys.setProperty("combined_space", CombineSpaces("space0", "space1"))

    assert_equal(sys.property("space1"), box1)

    if verbose:
        print(sys.properties().propertyKeys())

        print(sys.property("combined_space"))
        print(sys.property("combined_space").volume())

    assert_almost_equal( sys.property("combined_space").volume().value(), 
                         sys.property("space0").volume().value() + sys.property("space1").volume().value(), 5 )

    space3 = PeriodicBox( Vector(5,5,5) )
    sys.setProperty("space0", space3)

    assert_equal( sys.property("space0"), space3 )

    if verbose:
        print(sys.property("combined_space"))
        print(sys.property("combined_space").volume())

    assert_almost_equal( sys.property("combined_space").volume().value(), 
                         sys.property("space0").volume().value() + sys.property("space1").volume().value(), 5 )

    sys.removeProperty("space0")

    if verbose:
        print(sys.properties().propertyKeys())

    assert( not sys.containsProperty("space0") )
예제 #2
0
from Sire.Maths import *

box0 = PeriodicBox(Vector(10.0, 10.0, 10.0))
box1 = PeriodicBox(Vector(20.0, 20.0, 20.0))

print(box0)
print(box0.volume())
print(box1.volume())

from Sire.MM import *
sys.add(InterCLJFF("cljff"))

print(sys)
print(sys.property("space"))
print(sys.userProperties().propertyKeys())
print(sys.builtinProperties().propertyKeys())

sys.setProperty("space0", LinkToProperty("space", FFIdx(0)))

print(sys.property("space0"))

sys.setProperty("space0", box0)

print(sys.property("space"))

sys.setProperty("space1", box1)

sys.setProperty("combined_space", CombineSpaces("space0", "space1"))

print(sys.properties().propertyKeys())
예제 #3
0
from Sire.Maths import *

box0 = PeriodicBox( Vector(10.0,10.0,10.0) )
box1 = PeriodicBox( Vector(20.0,20.0,20.0) )

print(box0)
print(box0.volume())
print(box1.volume())

from Sire.MM import *
sys.add( InterCLJFF("cljff") )

print(sys)
print(sys.property("space"))
print(sys.userProperties().propertyKeys())
print(sys.builtinProperties().propertyKeys())

sys.setProperty( "space0", LinkToProperty("space", FFIdx(0)) )

print(sys.property("space0"))

sys.setProperty("space0", box0)

print(sys.property("space"))

sys.setProperty("space1", box1)

sys.setProperty("combined_space", CombineSpaces("space0", "space1"))

print(sys.properties().propertyKeys())