Пример #1
0
from scipy.io import FortranFile
import numpy as np
from pymatgen.command_line.gulp_caller import GulpIO
gio = GulpIO()
gio.get_iniitial_structure(
    '/home/jinho93/slab/LAO/grimes/nvt/dense/report.gulp')
fortran = False
if fortran:
    with FortranFile('/home/jinho93/slab/LAO/bush/nvt/island/old/md.trg') as f:
        version = f.read_reals()[0]
        n_atoms, ndim = f.read_ints()
        print(f'Version is {version}\nn_atoms is {n_atoms}, ndim is {ndim}')
        n_frames = 3
        for _ in range(n_frames):
            tket = f.read_reals()
            tket = [f'{r:.02f}' for r in tket]
            print(f'Time/KE/E/T {tket}')
            for l in range(10):
                line = f.read_reals()
                print(len(line))
else:
    with open('/home/jinho93/slab/LAO/grimes/nvt/dense/lao.trg') as f:
        version = f.readline()
        n_atoms, ndim = [int(r) for r in f.readline().split()]
        print(f'Version is {version}\nn_atoms is {n_atoms}, ndim is {ndim}')
        n_frames = 1

        for _ in range(n_frames):
            x, y, z = np.zeros(n_atoms), np.zeros(n_atoms), np.zeros(n_atoms)
            vx, vy, vz = np.zeros(n_atoms), np.zeros(n_atoms), np.zeros(
                n_atoms)
Пример #2
0
from pymatgen.command_line.gulp_caller import GulpIO

gio = GulpIO()
with open('/home/jinho93/slab/LAO/grimes/nvt/dense/report.gulp') as f:
    s = gio.get_iniitial_structure(f.read())
    print(s)