msi2lmp issue with non-orthogonal PBC

Dear Users and Axel

I am having some issues with my CNT system visualization where box is not orthogonal, one of the angles is 120. I am not sure if it is VMD or msi2lmp or topotools.

I have a periodic (non-orthogonal system) (9,5) CNT in .mdf and .car format (attached) that I generated using Material Studio (PCFF forcefield). Then, I used new version (after Axel modified it back in August) to convert to lammps data file. Older version could not handle non-orthogonal boxes if I remember correctly, so Axel’s version is only choice (Thanks)

msi2lmp.exe runs fine and output a data file (attached).

When I visualize .car and .data (using topotools) file of the same system in VMD, I see differences.

.car file look as it should be in VMD.

For .data file, the CNT appears to be breaking in almost half followed by some shifting (1/2 the box length) in non-orthogonal direction (see the screenshot). Bond connectivity seems fine but due to this shifting, some of the bonds look to be extremely streched.

For your reference, I am attaching the appropriate files as well. Please have a look at them when you get a chance if you get same issue in VMD visualization. If so, what might be causing it.

Thanks in advance.

Best Regards,
Vikas

09-05-10.data (294 KB)

09-05-10.car (48.5 KB)

09-05-10.mdf (61.1 KB)

Screenshot.png

Dear Users and Axel

I am having some issues with my CNT system visualization where box is not
orthogonal, one of the angles is 120. I am not sure if it is VMD or msi2lmp
or topotools.

made some experiments and it most likely is due to msi2lmp.
will have a closer look at msi2lmp now.

axel.

Thanks. Please let me know when you get to the cause.

Best Regards,
Vikas

Thanks. Please let me know when you get to the cause.

please try this change and let us know. thanks.

diff --git a/tools/msi2lmp/src/ReadCarFile.c b/tools/msi2lmp/src/ReadCarFile.c
index 9a4f0e9..73209bc 100644
--- a/tools/msi2lmp/src/ReadCarFile.c
+++ b/tools/msi2lmp/src/ReadCarFile.c
@@ -25,9 +25,9 @@ void set_box(double box[3][3], double *h, double *h_inv)
   h_inv[1] = 1.0/h[1];
   h_inv[2] = 1.0/h[2];

- h[3] = box[2][0];
+ h[3] = box[2][2];
   h[4] = box[2][1];
- h[5] = box[2][2];
+ h[5] = box[2][0];
   h_inv[3] = -h[3] / (h[1]*h[2]);
   h_inv[4] = (h[3]*h[5] - h[1]*h[4]) / (h[0]*h[1]*h[2]);
   h_inv[5] = -h[5] / (h[0]*h[1]);

Dear Axel,
Many thanks for your quick response. It works now.

Best regards,
Vikas