Skip to main content

Read lammps data infomations.

Project description

readlammpsdata

A script for reading and modifying 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(lmp, data_sub_str = "Atoms # full")
Masses = rld.read_data(lmp, data_sub_str = "Masses")
PairCoeffs = rld.read_data(lmp, data_sub_str = "Pair Coeffs")
Bonds = rld.read_data(lmp, data_sub_str = "Bonds")

# 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_atom_info(lmp,"atoms")
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))
# 4. ......
print(help(rld)) # for read all functions

Fixes

  • 2023-11-24

    • Fixed bugs of addH
  • 2023-11-22

    • Added the change_lmp_axis function
    • Added the coord2zero function
    • Added the addH function
    • Added the cut_lmp_atoms function
  • 2023-10-21

    • Added the exchange_position function
  • 2023-10-20

    • Added the change_type_order function
    • Added the combine_lmp function
    • Added the cut_lmp function
  • 2023-10-17

    • Added the move_boundary function;

    • Added the density function;

  • 2023-10-16

    • Added the modify_methane_hydrate function;
    • Added the modify_header function;
    • Added the add_atoms function;
    • Added the array2str function;
  • 2023-10-12

    • Added the sort_lmp function;

    • Added the lmp2xyz function;

    • Added the msi2clayff function;

    • Added the lmp2tip4p function;

  • 2023-10-08

    • Added the pdb2xyz function;
    • Added the read_formula function;
    • Added the modify_pos function;
    • Added the modify_pore_size function;
  • 2023-09-23

    • Replaced the read_Natoms to the read_atom_info function;
    • Added the read_vol function;
    • Added the read_xyz function;
    • Added the read_pdb function;
  • 2023-09-22

    • Added the read_terms function for reading complex LAMMPS data;
  • 2023-09-11

    • Added read_box function;
    • Added read_Natoms function;
    • Added 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.9.tar.gz (32.0 kB view details)

Uploaded Source

File details

Details for the file readlammpsdata-1.0.9.tar.gz.

File metadata

  • Download URL: readlammpsdata-1.0.9.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for readlammpsdata-1.0.9.tar.gz
Algorithm Hash digest
SHA256 212464d714ae2c299697b7f9f50a3d22bd30f3db943228c430b519b3b5afde9d
MD5 f331a693bf8ace7bd70fd83ad050fd3c
BLAKE2b-256 3cf96360e90203a5870b9cd4c15eea134a2fdd94927cbb9a4d2605ec656c484d

See more details on using hashes here.

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