예제 #1
0
파일: nmd.py 프로젝트: csgorham/ntpy
numFft = tTotal / tFft					# Number of FFT Blocks
numTstep = tFft / wStep					# Number of FFT Time Steps

## Freqency Specifications (used for plotting)
freqStep = 2 * np.pi / (tFft * dt)		# Frequency Step
freqMax = 2 * np.pi / (wStep * dt * 2)	# Maximum Frequency
numFreq = tFft / (wStep * 2)			# Number of Frequencies

omega = np.zeros( (numFreq) )
omega = np.arange(numFreq) * (freqMax / numFreq)

## Create lammps position file ##
mylamp = lt.Lammps(inPosName)
myBox = lt.Block([ljLat, ljLat, ljLat], latType, dim, atom_mass = [ljMass])
mylamp.buildLammps([myBox])
latPos = lt.buildNumpy([myBox])

## Lattice properties
numAtomsUC = myBox.numAtomsUcell()
numUcell = myBox.numUcell()
numAtoms = myBox.numAtoms()
Lx = myBox.Lx()
Ly = myBox.Ly()
Lz = myBox.Lz()
numModes = 3 * numAtomsUC

## Create kpoints
kpt = lt.kpt(dim, conv=True)
kptIndex = np.zeros( (kpt[:,0].size) )
kptIndex = range(kpt[:,0].size)
예제 #2
0
## ## This is the most basic case possible.							## ##

#	First, create a lammps object that represents one file.
mylamp = lt.Lammps('test_1.txt') 
# mylamp = lt.lammps('filenamehere') 

# Next, create your lattice *NB: atom_mass, must be defined for lammps files.
mylat = lt.Block([1.5632, 1.5632, 1.5632], 'fcc', [4, 4, 4], atom_mass = [1])
# mylat = lt.block([lattice vector x, lat vec y, lat vec z], 'lattice type', [units in x, units in y, units in z], atom_mass = [atom mass here])

# Finally, build your lammps file using the block you just created.
mylamp.buildLammps([mylat])
## ## And you're done!!!

## ## We can also return the positions as a numpy array
npy_lattice = lt.buildNumpy([mylat])
print npy_lattice


## ## "blocks" are very modular, they can be called multiple times	## ##
## ## This creates the same lattice above but from two "blocks".	## ##

mylamp = lt.Lammps('test_2.txt')
# Notice this block is half the size in the z-direction
mylat = lt.Block([1.5632, 1.5632, 1.5632], 'fcc', [4, 4, 2], atom_mass = [1])
# Now pass the block twice to create two identical halves.
# The lattice will be concatenated in the z-direction automatically
# creating an identical lattice to the one above.
mylamp.buildLammps([mylat, mylat])
## ## End
예제 #3
0
## ## This is the most basic case possible.							## ##

#	First, create a lammps object that represents one file.
mylamp = lt.Lammps('test_1.txt')
# mylamp = lt.lammps('filenamehere')

# Next, create your lattice *NB: atom_mass, must be defined for lammps files.
mylat = lt.Block([1.5632, 1.5632, 1.5632], 'fcc', [4, 4, 4], atom_mass=[1])
# mylat = lt.block([lattice vector x, lat vec y, lat vec z], 'lattice type', [units in x, units in y, units in z], atom_mass = [atom mass here])

# Finally, build your lammps file using the block you just created.
mylamp.buildLammps([mylat])
## ## And you're done!!!

## ## We can also return the positions as a numpy array
npy_lattice = lt.buildNumpy([mylat])
print npy_lattice

## ## "blocks" are very modular, they can be called multiple times	## ##
## ## This creates the same lattice above but from two "blocks".	## ##

mylamp = lt.Lammps('test_2.txt')
# Notice this block is half the size in the z-direction
mylat = lt.Block([1.5632, 1.5632, 1.5632], 'fcc', [4, 4, 2], atom_mass=[1])
# Now pass the block twice to create two identical halves.
# The lattice will be concatenated in the z-direction automatically
# creating an identical lattice to the one above.
mylamp.buildLammps([mylat, mylat])
## ## End

## ## We can also build an xyz file for visualization				## ##