Converting LIGGGHTS file to csv/matlab matrices directly

Submitted by siddharth.kanungo93 on
aaigner

You can write a Matlab script (or better a function) to read dump-files and return the matrix. I did something similar years ago, but don't ask me for the code. This one I may not share.

Happy coding ... ;-)
Andreas

Wed, 2 Sep 2015 - 14:09 Permalink
Vu Viet Dung

You can write code matlab to begin from Liggghts extract to .txt format ---> matrice by Matlab. Code Matlab can be "fopen -- fread---fclose--strrep---str2num"
Best regards
Vu

Wed, 2 Dec 2015 - 00:23 Permalink
zumack

In reply to by Vu Viet Dung

Do you know Matlab could read binary txt file?

It seems LIGGGHTS dump files in binary, and Matlab needs the txt file should be in ACSII

Wed, 2 Jan 2019 - 12:35 Permalink
mschramm

In reply to by zumack

Hello,
LIGGGHTS can dump as a binary but it normally dumps as a text file.
What command are you using for your dumps?
It should be similar to
dump dmp all custom 1000 post/dump*.liggghts id mol type x y z vx vy vz fx fy fz omegax omegay omegaz radius

Matlab could read a binary file but you would need to know the format of the binary file.
As far as I know, no one has made a script for MATLAB/Octave that reads liggght binary dump files.

Tue, 19 Feb 2019 - 19:45 Permalink

I am interested in using matlab matrices for post processing the data. Right now, I am converting the LIGGGHTS documents to VTK, using paraview I am exporting to CSV and using a numpy script I am converting to matlab matrices. I was wondering there was a way to directly convert the Liggghts file into CSV/Matlab Matrices.

Thanks
SIddharth