Commit 4be5747a authored by Mikkel Strange's avatar Mikkel Strange

small update

parent 47a0a8f3
from ase import Atoms
from ase.lattice.triclinic import Triclinic as TC
from ase.build import bulk
......@@ -7,6 +8,13 @@ class UnitCell:
self.cell = [a, b, c]
class Triclinic:
def __init__(self, a, b, c, alpha, beta, gamma):
self.cell = TC(symbol='X', latticeconstant=(a, b, c, alpha,
beta, gamma)).get_cell()
def primitiveVectors(self):
return self.cell
class FaceCenteredCubic:
def __init__(self, a):
self.cell = bulk('X', crystalstructure='fcc', a=a).get_cell()
......@@ -66,9 +74,14 @@ class MoleculeConfiguration:
things = {'UnitCell': UnitCell,
'Triclinic': Triclinic,
'FaceCenteredCubic': FaceCenteredCubic,
'BulkConfiguration': BulkConfiguration,
'MoleculeConfiguration': MoleculeConfiguration}
conf_types = ['MoleculeConfiguration',
'BulkConfiguration']
if __name__ == '__main__':
t = Triclinic(4.0, 4.0, 4.0, 90.0, 90.0, 90.0)
print(t.primitiveVectors())
......@@ -15,7 +15,7 @@ def parse_configuration(fd, name, verbose=False):
"""
code = fd.variables[name].data[:].copy()
code = code.tostring().decode("utf-8")
if verbose:
if 0:
print('parsing code:\n------------')
print(code)
......
......@@ -23,11 +23,16 @@ Hartree = PhysicalQuantity(au.Hartree)
Bohr = PhysicalQuantity(au.Bohr)
Kelvin = PhysicalQuantity(au.kB)
Hour = 1
Degrees = PhysicalQuantity(1.0)
amu = PhysicalQuantity(1.0)
things = {'eV': eV,
'Angstrom': Angstrom,
'Hartree': Hartree,
'Bohr': Bohr,
'Kelvin': Kelvin,
'Hour': 1,
'Hour': Hour,
'Degrees': Degrees,
'amu': amu}
if __name__ == '__main__':
print(Angstrom*4.0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment