pylammps.Computes package

Submodules

pylammps.Computes.Compute module

Compute class

class pylammps.Computes.Compute.Compute[source]

Bases: object

Abstract compute class. It will never be used, but is parent of all the different computes.

compute(system)[source]

Compute routine

log(filename)[source]

Logging routine. By default we just write self.value to filename, with self.header

plot(filename)[source]

Plotting routine. By default we plot every column [1:] as a function of column 0, setting labels and axis names with self.header and save it to filename.

tally(value)[source]

Tally new compute with the previous ones. Mostly because not all of the computes have the same structure, so the “average” is not standard. By default we do the usual average.

zero()[source]

Zero out current tallies.

pylammps.Computes.MSTE module

MSTE Compute class

class pylammps.Computes.MSTE.MSTE(energy=True, pbc=True)[source]

Bases: pylammps.Computes.Compute.Compute

MST/MSTE calculation.

compute(system)[source]

Calculate MSTE.

Parameters:

system : System

System on which we calculate the Minimum Spanning Tree

Returns:

value : numpy array

value is the [mass, occupancy, fraction] histogram

plot(filename)[source]

Plotting routine. We need to override since in this case we don’t want both plots to be on the same y-axis

tally(value)[source]

We need to override the parent tally, since this compute does not average trivially. We create the histogram from the values.

pylammps.Computes.RDF module

Compute class

class pylammps.Computes.RDF.RDF(nbins, pairs, pbc=True)[source]

Bases: pylammps.Computes.Compute.Compute

Radial Distribution Function calculation, order N^2 computing all neighbors.

compute(system)[source]

Calculate RDF.

Parameters:

system : System

System on which we calculate the Radial Distribution Function

Returns:

rdf : numpy array

An array with the information of the compute. The first column is ‘r’ and the rest are the RDF calculated for the pair list.

pylammps.Computes.StructureFactor module

Compute class

class pylammps.Computes.StructureFactor.StructureFactor(k, pairs, repetitions=2, lebedev=194)[source]

Bases: pylammps.Computes.Compute.Compute

Structure Factor computation from definition.

compute(system)[source]

Calculate structure factor.

Parameters:

system : System

System on which we calculate the Structure Factor

Returns:

ssf : dict

An array with the information of the compute. The first column is ‘r’ and the rest is the structure factor calculated for the pair list.

pylammps.Computes.Thermo module

Thermodynamic Compute class

class pylammps.Computes.Thermo.Thermo[source]

Bases: pylammps.Computes.Compute.Compute

MST/MSTE calculation.

compute(system)[source]

Calculate Thermo.

Parameters:

system : System

System on which we calculate the Minimum Spanning Tree

Returns:

temperature, kinetic, potential, total, pressure: 5*float

plot(filename)[source]

We need to override the parent plot method

tally(value)[source]

We need to override the parent tally, since this compute does not average trivially. We create the histogram from the values.

zero()[source]

The value has to be an empty list

Module contents