Lattice module - ntpl/ntpl GitHub Wiki
#header
##Table of Contents:
###Developer's section
[1.1] - Notes
[1.2] - File types
[1.3] - Lattice structures
[1.4] - Boundaries
###Documentation
[2.1] - def buildNumpy
[2.2] - class Lammps
[2.2.1] - def buildLammps
[2.3] - class Xyz
[2.3.1] - def buildXyz
[2.4] - class Block
[2.5] - def printBasis
##Contents
###Developer's section
[1.1] - Any changes to the documentation of this package
should be reflected in this file as well as the doc strings
of the module, with the exception of example code which
should only be included in this file.
[1.2] - File types
Supported:
lammmps (alpha)
xyz (alpha)
Planned:
gulp
Suggested:
[1.3] - Lattice structures
Supported:
sc (simple cubic)
fcc (face centered cubic)
bcc (body centered cubic)
diamond
Planned:
Suggested:
[1.4] - Boundaries
Supported:
Multiple boundaries in z direction
Boundary spacing relative to block periodic boundary
Planned:
Suggested:
Multiple boundaries in x, y, and z directions -KDP
###Documentation
[2.1] - def buildNumpy
This creates numpy array based on the blocks provided
lattice.Numpy.buildNumpy(blocks)
Parameters
----------
blocks : list of type Block
The blocks used to build the numpy array. Blocks
should be put in order of origin to z-direction
max.
Returns
----------
Numpy : numpy array
A numpy array of shape (numAtoms, 3) and type
float is returned.
[2.2] - class Lammps
Creates and object that represents a single lammps file
ntpy.lattice.Lammps(file_name)
Parameters
----------
file_name : str
The name of the lammps file
[2.2.1] - def buildLammps
This creates and writes the lammps file based on the blocks provided
ntpy.lattice.lammps.buildLammps(blocks)
Parameters
----------
blocks : list of type Block
The blocks used to build the lammps file. Blocks
should be put in order of origin to z-direction
max.
[2.3] - class Xyz
Creates an object that represents a single xyz file.
ntpy.lattice.Xyz(file_name)
Parameters
----------
file_name : str
The name of the xyz file
[2.3.1] - def buildXyz
This creates and writes the xyz file based on the blocks provided
ntpy.lattice.xyz.buildXyz(blocks)
Parameters
----------
blocks : list of type Block
The blocks used to build the lammps file. Blocks
should be put in order of origin to z-direction
max.
[2.4] - class Block
Defines a singular lattice that can linearly interfaced with other lattices
ntpy.lattice.Block(lat_vector, lat_type, dim, bd_space=0, atom_mass=None, atom_type=None)
Parameters
----------
lat_vector : list of type float
The lattice constants for the x, y, and z directions
lat_type : str
The type of lattice to be constructed. Currently only
'sc', 'fcc', 'bcc', and 'diamond' are supported
dim : list of type int
The dimensions of the lattice in the x, y, and z directions.
Dimensions are in units of lattice units.
bd_space : float, optional
The amount of space added at the terminating z boundary of
the lattice. The space added is relative to the standard
periodic foundary of the lattice. A negative value reduces
the amount of space at the boundary.
atom_mass : list of type float, optional
The atom masses corresponding to the atoms in the basis vector.
If only one mass is used then only one mass need be supplied.
For a listing of the basis vector for each lattice type used
by this module, use the lattice function "basis_print".
Required for lammps files.
atom_type : list of type str, optional
The atom types of the lattice. Required for xyz files.
[2.5] - def printBasis
Prints the basis vectors defined in this module for reference
ntpy.lattice.printBasis(lat_type)
Parameters
----------
lat_type : str
The type of lattice to be constructed. Currently only
'sc', 'fcc', 'bcc', and 'diamond' are supported