How to use the pyscal.crystal_structures.make_crystal function in pyscal

To help you get started, we’ve selected a few pyscal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github srmnitc / pyscal / tests / test_q4.py View on Github external
def test_q_4():
    atoms, boxdims = pcs.make_crystal('bcc', repetitions = [4, 4, 4])
    sys = pc.System()
    sys.atoms = atoms
    sys.box = boxdims

    #sys.get_neighbors(method = 'voronoi')
    sys.find_neighbors(method = 'cutoff', cutoff=0.9)
    sys.calculate_q(4, averaged=True)
    q = sys.get_qvals(4, averaged=True)
    assert np.round(np.mean(np.array(q)), decimals=2) == 0.51 , "Calculated q4 value is wrong!"
github srmnitc / pyscal / tests / test_q11.py View on Github external
def test_q_11():
    atoms, boxdims = pcs.make_crystal('bcc', repetitions = [4, 4, 4])
    sys = pc.System()
    sys.atoms = atoms
    sys.box = boxdims

    sys.find_neighbors(method = 'voronoi')

    sys.calculate_q(11, averaged=True)
    q = sys.get_qvals(11, averaged=True)
    assert np.round(np.mean(np.array(q)), decimals=2) == 0.00
github srmnitc / pyscal / tests / test_q10.py View on Github external
def test_q_10():
    atoms, boxdims = pcs.make_crystal('bcc', repetitions = [4, 4, 4])
    sys = pc.System()
    sys.atoms = atoms
    sys.box = boxdims

    sys.find_neighbors(method = 'voronoi')

    sys.calculate_q(10, averaged=True)
    q = sys.get_qvals(10, averaged=True)
    assert np.round(np.mean(np.array(q)), decimals=2) == 0.41
github srmnitc / pyscal / tests / test_q2.py View on Github external
def test_q_2():
    #this might take a while, it will find all qs
    atoms, boxdims = pcs.make_crystal('bcc', repetitions = [6, 6, 6])
    sys = pc.System()
    sys.atoms = atoms
    sys.box = boxdims
    #sys.read_inputfile("tests/bcc.dat")
    sys.find_neighbors(method = 'voronoi')
    #sys.get_neighbors(method = 'cutoff', cutoff=0.9)

    sys.calculate_q(2)
    q = sys.get_qvals(2)
    assert np.round(np.mean(np.array(q)), decimals=2) == 0.00
github srmnitc / pyscal / tests / test_volume.py View on Github external
def test_q_2():
    #this might take a while, it will find all qs
    atoms, boxdims = pcs.make_crystal('bcc', repetitions = [6, 6, 6])
    sys = pc.System()
    sys.atoms = atoms
    sys.box = boxdims

    #sys.read_inputfile("tests/bcc.dat")
    sys.find_neighbors(method = 'voronoi')
    atoms = sys.atoms
    vols = []
    avgvols = []
    for atom in atoms:
        vols.append(atom.volume)
        avgvols.append(atom.avg_volume)
    assert np.mean(np.array(vols)) == 0.5
    assert np.mean(np.array(avgvols)) == 0.5
github srmnitc / pyscal / tests / test_q8.py View on Github external
def test_q_8():
    atoms, boxdims = pcs.make_crystal('bcc', repetitions = [4, 4, 4])
    sys = pc.System()
    sys.atoms = atoms
    sys.box = boxdims

    sys.find_neighbors(method = 'voronoi')

    sys.calculate_q(8, averaged=True)
    q = sys.get_qvals(8, averaged=True)
    assert np.round(np.mean(np.array(q)), decimals=2) == 0.33
github srmnitc / pyscal / tests / test_traj_process.py View on Github external
def test_customvals_dump():
    """
    Test writing customvals
    """
    atoms, boxdims = pcs.make_crystal('bcc', repetitions=[1,1,1])
    sys = pc.System()
    sys.atoms = atoms
    sys.box = boxdims


    #test for multiple customvals
    customks = 'one'
    customvs = [1,1]
    ptp.write_structure(sys, "tests/bcc4.dump", customkey=customks, customvals=customvs)

    #now read this file
    lines = []
    for line in open("tests/bcc4.dump", 'r'):
        lines.append(line)

    #now check the atoms
github srmnitc / pyscal / tests / test_q9.py View on Github external
def test_q_9():
    atoms, boxdims = pcs.make_crystal('bcc', repetitions = [4, 4, 4])
    sys = pc.System()
    sys.atoms = atoms
    sys.box = boxdims

    sys.find_neighbors(method = 'voronoi')

    sys.calculate_q(9, averaged=True)
    q = sys.get_qvals(9, averaged=True)
    assert np.round(np.mean(np.array(q)), decimals=2) == 0.00