Where does the Universe object store the dimensions of the simulation cell?

26 views
Skip to first unread message

Satyen Dhamankar

unread,
Oct 17, 2023, 12:44:27 AM10/17/23
to MDnalysis discussion
Hello,

I am learning the ropes of MDAnalysis so this is a very basic question. 

I am parsing a trajectory output by LAMMPS in the standard "atom" format. 
This is a snippet from the trajectory:
```
ITEM: TIMESTEP
0
ITEM: NUMBER OF ATOMS
42572
ITEM: BOX BOUNDS pp pp pp
0.0000000000000000e+00 7.5000000000000000e+01
0.0000000000000000e+00 7.5000000000000000e+01
0.0000000000000000e+00 7.5000000000000000e+01
ITEM: ATOMS id type x y z
1 1 53.1548 4.4557 0.70681
2 2 52.7814 5.36408 1.18418
3 1 51.9246 5.09719 1.8911
4 1 53.4932 5.97228 1.79943
5 3 52.4377 6.3564 0.0468971
6 1 52.2907 7.2622 0.634702
7 4 51.1551 5.8994 74.3893
8 5 50.9479 4.74092 74.0151
9 6 50.2509 6.89418 74.222
10 7 50.4368 7.7257 74.7573
```
I am analyzing the trajectory and calculating an RDF in the following manner:
```
import MDAnalysis as mda
from MDAnalysis.analysis import rdf
import matplotlib.pyplot as plt
import numpy as np

if __name__=="__main__":

    coords = mda.coordinates.LAMMPS.DumpReader("coords.npt.lammpsdump")
    u = mda.Universe("coords.npt.lammpsdump", atom_stype="id type x y z")

    # access atom types
    water_o = u.select_atoms('type 10')
    polymer_o = u.select_atoms('type 5')
    irdf = rdf.InterRDF(water_o, polymer_o, nbins=100, range=(0.0, 30.0), exclusion_block=(1,1))
    irdf.run()

    plt.plot(irdf.bins, irdf.rdf, c='steelblue')
    plt.savefig("oo_rdf", dpi=1200, bbox_inches="tight")
```
My question is, where does the Universe object store the dimensions of the simulation cell? The simulation is NPT so the volume of the box fluctuates, and I would like to understand how I can access the volume fluctuations via the Universe object.

Roshan Shrestha

unread,
Oct 17, 2023, 12:51:41 AM10/17/23
to mdnalysis-...@googlegroups.com
Hi,
     You can access the dimensions at Universe.trajectory.dimensions

With best regards 




--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/cc059f91-363d-4bf9-a9a6-8cf3fbebb701n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages