ipymd.data_input package¶
Subpackages¶
Submodules¶
ipymd.data_input.base module¶
Created on Sun May 1 22:49:20 2016
@author: cjs14
-
class
ipymd.data_input.base.
DataInput
[source]¶ Bases:
object
Data is divided into two levels; atomic and meta
- atom is a series of tables, one for each timestep, containing variables (columns) for each atom (rows)
- meta is a table containing variables (columns) for each configuration (rows)
ipymd.data_input.cif module¶
Created on Wed May 18 22:24:10 2016
@author: cjs14
adapted from from http://physics.bu.edu/~erikl/research/tools/crystals/read_cif.py
-
class
ipymd.data_input.cif.
CIF
[source]¶ Bases:
ipymd.data_input.base.DataInput
Data is divided into two levels; atomic and meta
- atom is a series of tables, one for each timestep, containing variables (columns) for each atom (rows)
- meta is a table containing variables (columns) for each configuration (rows)
-
setup_data
(file_path, override_abc=[], ignore_overlaps=False)[source]¶ Build a crystal from a Crystallographic Information File (.cif)
Parameters: file_path (str) – path to file override_abc : [] or [a,b,c]
if not empty, will override a, b, c length parameters given in fileNotes
here is a typical example of a CIF file:
_cell_length_a 4.916 _cell_length_b 4.916 _cell_length_c 5.4054 _cell_angle_alpha 90 _cell_angle_beta 90 _cell_angle_gamma 120 _cell_volume 113.131 _exptl_crystal_density_diffrn 2.646 _symmetry_space_group_name_H-M ‘P 32 2 1’ loop_ _space_group_symop_operation_xyz
‘x,y,z’ ‘y,x,2/3-z’ ‘-y,x-y,2/3+z’ ‘-x,-x+y,1/3-z’ ‘-x+y,-x,1/3+z’ ‘x-y,-y,-z’loop_ _atom_site_label _atom_site_fract_x _atom_site_fract_y _atom_site_fract_z Si 0.46970 0.00000 0.00000 O 0.41350 0.26690 0.11910
ipymd.data_input.crystal module¶
Created on Mon May 16 01:23:11 2016
@author: cjs14
Adapted from chemlab which, in turn, was adapted from ASE https://wiki.fysik.dtu.dk/ase/ Copyright (C) 2010, Jesper Friis
-
class
ipymd.data_input.crystal.
Crystal
[source]¶ Bases:
ipymd.data_input.base.DataInput
Data is divided into two levels; atomic and meta
- atom is a series of tables, one for each timestep, containing variables (columns) for each atom (rows)
- meta is a table containing variables (columns) for each configuration (rows)
-
setup_data
(positions, atom_type, group, cellpar=[1.0, 1.0, 1.0, 90, 90, 90], repetitions=[1, 1, 1], mass_map={}, charge_map={})[source]¶ Build a crystal from atomic positions, space group and cell parameters (in Angstroms)
Parameters: - positions (list of coordinates) – A list of the fractional atomic positions
- atom_type (list of atom type) – The atom types corresponding to the positions, the atoms will be translated in all the equivalent positions.
- group (int | str) – Space group given as its number in International Tables NB: to see mappings from Hermann–Mauguin notation, etc, use the get_spacegroup_df function in this module
- repetitions – Repetition of the unit cell in each direction
- cellpar – Unit cell parameters (in Angstroms and degrees)
- mass_map (dict of atom masses) – mapping of atom masses to atom types
- charge_map (dict of atom charges) – mapping of atom charges to atom types
- function was taken and adapted from the spacegroup module (This) –
:param found in ASE.: :param The module spacegroup module was originally developed by Jesper: :param Frills.:
Example
from ipymd.data_input import crystal c = crystal.Crystal([[0.0, 0.0, 0.0], [0.5, 0.5, 0.5]],
[‘Na’, ‘Cl’], 225, cellpar = [5.4, 5.4, 5.4, 90, 90, 90], repetitions = [5, 5, 5])c.get_atom_data() c.get_simulation_box()
ipymd.data_input.lammps module¶
Created on Mon May 16 01:15:56 2016
@author: cjs14
-
class
ipymd.data_input.lammps.
LAMMPS_Input
[source]¶ Bases:
ipymd.data_input.base.DataInput
Data is divided into two levels; atomic and meta
- atom is a series of tables, one for each timestep, containing variables (columns) for each atom (rows)
- meta is a table containing variables (columns) for each configuration (rows)
-
class
ipymd.data_input.lammps.
LAMMPS_Output
[source]¶ Bases:
ipymd.data_input.base.DataInput
Data is divided into two levels; atomic and meta
- atom is a series of tables, one for each timestep, containing variables (columns) for each atom (rows)
- meta is a table containing variables (columns) for each configuration (rows)
-
setup_data
(atom_path='', sys_path='', sys_sep=' ', atom_map={}, incl_atom_step=False, incl_sys_data=True)[source]¶ Data divided into two levels; meta and atom
- atom_map : dict
- mapping of atom level variable names e.g. {‘C_var[1]’:’x’}
- sys_sep : str
- the separator between variables in the system data file
- incl_atom_time : bool
- include time according to atom file in column ‘atom_step’ of meta
- incl_sys_data : bool
- include system data in the single step meta data
Notes
Meta level data created with fix print, e.g.;
fix sys_info all print 100 “${t} ${natoms} ${temp}” & title “time natoms temp” file system.dump screen noAtom level data created with dump, e.g.;
dump atom_info all custom 100 atom.dump id type x y z mass q OR (file per configuration) dump atom_info all custom 100 atom_*.dump id type xs ys zs mass q
-
ipymd.data_input.lammps.
natural_keys
(text)[source]¶ alist.sort(key=natural_keys) sorts in human order, e.g. [‘1’,‘2’,‘100’] instead of [‘1’,‘100’,‘2’] http://nedbatchelder.com/blog/200712/human_sorting.html