Skip to main content

Read lammps data infomations.

Project description

readlammpsdata

A script for reading lammps data

Install

# install from github
git clone git@github.com:eastsheng/readlammpsdata.git
cd readlammpsdata
pip install .
# install from pypi
pip install readlammpsdata

Usages

import readlammpsdata as rld

# 0. read Atoms, Masses etc.
Atoms = rld.read_data(lammpsdata.lmp, data_sub_str = "Atoms # full")
Masses = rld.read_data(lammpsdata.lmp, data_sub_str = "Masses")

# 1. read box size
xyz = rld.read_box(lmp)
Lx = xyz["xhi"]-xyz["xlo"]
print(xyz)
print(Lx)

# 2. read atomic number 
Natoms = rld.read_Natoms(lmp)
print("Number of atoms is %s" %Natoms)

# 3. read charges 
charges = rld.read_charges(lmp)
print("Charges of atoms are %s" %charges)
print(round(sum(charges),6))

Fixes

  • 2023-09-11

    • Add read_box function.

    • Add read_Natoms function.

    • Add read_charges function.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

readlammpsdata-1.0.2.tar.gz (15.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page