Reading trajectory from VASP XDATCAR

Hello !

I created a snippet with Ovito Python package (Pro 3.10.0) for a rapid analysis of VASP AIMD trajectories. the use case here was a time averaging of the Radial Distribution Function from a sequence of XDATCAR files generated from VASP 5.4.4. .

When loading the trajectory it happens to read only the first frame of each XDATCAR file of the list.

Here is the code that I run with ovitos shell on Ubuntu 22.04

from ovito.pipeline import Pipeline
from ovito.io import import_file, export_file
from ovito.modifiers import CoordinationAnalysisModifier, TimeAveragingModifier
from ovito.modifiers import CombineDatasetsModifier

xdatcar_flles = ['./XDAT.Al90Fe10.1400K.9000.33', './XDAT.Al90Fe10.1400K.9000.34']

pipeline = import_file(xdatcar_files)
print('File import: ',  xdatcar_files, 'Number of frames:', pipeline.source.num_frames)

rmax = 7.0
nbins = 150
dr = rmax/nbins
print("Partial RDFs,  Number of MD frames:", pipeline.source.num_frames)

modifier = CoordinationAnalysisModifier(cutoff = rmax, number_of_bins = nbins, partial = True)
pipeline.modifiers.append(modifier) pipeline.modifiers.append(TimeAveragingModifier(operate_on='table:coordination-rdf'))

partial_rdf = pipeline.compute().tables['coordination-rdf[average]'].xy()
np.savetxt("rdf_ovito.dat", partial_rdf)

produces the following screen output

File import:  ['./XDAT.Al90Fe10.1400K.9000.33', './XDAT.Al90Fe10.1400K.9000.34']  Number of frames: 2
Partial RDFs, Number of MD frames: 2

The RDF calculation works fine as far as Ican judge from the saved ascii file.

Maybe I missed something, but this seems to me a bug of reading XDATCAR files. The work around proposed by Alexander in a previous topic doesn’t work on my side.

Any help would be much appreciated, Thanks in advance.

All the best
Noel

Hi Noel,
I have contacted you via DM, so you can share those files with me if you like.
-Constanze

Thanks Constranze !
I replied directly to you
Best Noel