pylammps package¶
Subpackages¶
Submodules¶
pylammps.Analyzer module¶
Analyzer class: the Analyzer of LAMMPS Systems
-
class
pylammps.Analyzer.
Analyzer
(computes)[source]¶ Bases:
object
The analyzer class. Has to be instantiated for each simulation, with the computes that we want to calculate
-
analyze
(system)[source]¶ Main method, that performs all the analysis on the system given
Parameters: system : System instance
The system that we will use to calculate the computes
-
computes
¶ Computes for the analyzer
-
pylammps.DummyLammps module¶
Dummy lammps class, good for debugging purposes. It only logs everything on a file
pylammps.Logger module¶
Logger class
-
class
pylammps.Logger.
Logger
(system, root_path='./data', style='folder')[source]¶ Bases:
object
Main logger class. Can either plot or write the data on a text file
-
dump
(system, style='text')[source]¶ Dump the system information.
Parameters: system : System
The molecular dynamics system. It needs to have a dump method in it. It can be eventually changed so it can be ported outside lammps.
style : {‘text’, ‘image’}
Style to use when dumping
-
pylammps.Potential module¶
Module for the calculation of the potential energy in Neutron Star systems.
pylammps.System module¶
System class: the Lammps Molecular Dynamics main object
-
class
pylammps.System.
NeutronStarSystem
(gpu=False, silent=True)[source]¶ Bases:
pylammps.System.System
The Neutron Star System. It sets up the typical usage for Neutron Star Simulations
-
class
pylammps.System.
System
(gpu=False, silent=True)[source]¶ Bases:
dict
Any system will be a dictionary with the parameters of the simulation. It inherits from a dictionary to keep the syntax as clean as possible
-
box
¶ Get box of the system as a (3, 2) numpy array
Returns: box : 2D numpy array
-
dump
(path, style)[source]¶ Wrapper to the lammps dump format
Parameters: path : string
Path where to save the dump
style : {‘text’, ‘image’}
Style to use when dumping
-
expand
(rate)[source]¶ Set initial condition for an expansion as seen in [Dorso]
[Dorso] Dorso and Strachan, Phys. Rev. B 54, 236 Parameters: rate : float
Expansion rate, in box per seconds units
-
minimize
(etol, ftol, maxiter, maxeval)[source]¶ Minimize to remove some of the potential energy, probably due to initial random configuration, and set temperature to Gaussian according to the system temperature if it exists.
Parameters: etol : float
Stopping tolerance for energy (unitless)
ftol : float
Stopping tolerance for force (force units)
maxiter : int
Maximum number of iterations of minimizer
maxeval : int
Maximum number of force evaulations
-
read_dump
(fname)[source]¶ Read information from the last snapshot of a dump file. It purges all previous particles, so the particles are exactly the type and ids of the new particles are those of the dump file.
Parameters: fname : str
LAMMPS-style dump filename to read
Raises: IOError
In case there is no snapshot in the filename to read
-
run
(steps)[source]¶ Wrapper for the “run” command in lammps.
Parameters: steps: number of steps to run
-
t
¶ Get types as a numpy array from the simulation
-
thermalize
(freq, wind)[source]¶ Runs the system until it has thermalized. The criterion for stability is:
1.- The average temperature of the last freq*steps is close to the set temperature by a standard deviation and
2.- The energy stops decreasing (slope > 0)
Parameters: freq: int
Number of timesteps between each temperature to be considered in the average and slope
wind: int
Number of timesteps in the slope and average calculation of the temperature.
Notes
Due to criterion 2, this works only when setting temperature from high to low. Nevertheless, when going from low to high temperatures, one would expect that just setting the temperatures and complying with 1 should be enough.
-
v
¶ Get v as a numpy array from the simulation
-
x
¶ Get x as a numpy array from the simulation
-