postprocess package¶
Submodules¶
postprocess.extract module¶
Module for post-process in lammps
-
class
postprocess.extract.
Extraction
(path='.')[source]¶ Bases:
object
Extraction class. We can extract either scalars, vector or per-particle magnitudes
-
box
(fname, idx=0)[source]¶ Extract the boxes that are in a lammps dump file that matches the parameters.
Parameters: fname : str
LAMMPS dump filename
idx : datatype, optional
Index of the timestep to look for [not the timestep itself]
Returns: output : list
A list of numpy arrays with the boxes that match all parameters.
-
entries
(parameters)[source]¶ Return all the entries from the database that match the parameters.
Parameters: parameters : dict
A dictionary of parameters to look for in the database
Returns: ret : list
A list of the entries (directories) in the database.
-
particle
(cols, fname, dtype=<type 'numpy.float64'>, idx=0)[source]¶ Extract a ‘per particle’ magnitude that is the given lammps dump file.
Parameters: cols : tuple
Columns to extract
fname : str
LAMMPS dump filename
dtype : datatype, optional
Datatype of the array
idx : datatype, optional
Index of the timestep to look for [not the timestep itself]
Returns: output : list
A list of numpy arrays with the requested data that match all parameters.
-
t
(fname, idx=0)[source]¶ Extract the types that are in a lammps dump file that matches the parameters.
Parameters: fname : str
LAMMPS dump filename
idx : datatype, optional
Index of the timestep to look for [not the timestep itself]
Returns: t : list
A list of numpy arrays with the types that match all parameters.
-
v
(fname, idx=0)[source]¶ Extract the velocities that are in a lammps dump file that matches the parameters.
Parameters: fname : str
LAMMPS dump filename
idx : datatype, optional
Index of the timestep to look for [not the timestep itself]
Returns: v : list
A list of numpy arrays with the velocities that match all parameters.
-
x
(fname, idx=0)[source]¶ Extract the positions that are in a lammps dump file that matches the parameters.
Parameters: fname : str
LAMMPS dump filename
idx : datatype, optional
Index of the timestep to look for [not the timestep itself]
Returns: x : list
A list of numpy arrays with the positions that match all parameters.
-
postprocess.tools module¶
-
postprocess.tools.
replicate
(x, t, box, nrep=1)[source]¶ Replicate positions of particles in a box according to periodic boundary conditions.
Parameters: x : numpy array
Positions of the particles
t : numpy array
Types of the particles
box : iterable
Simulation box
nrep : int, optional
Number of repetitions to consider. Default value is 1.
Returns: x, t, box : numpy array, numpy array, box
Positions, type and box of the repeated values.