From: Ronald Cohen (rcohen_at_carnegiescience.edu)
Date: Tue Jul 16 2024 - 09:04:29 CDT

This is clear in the plug in! The cell is not read for each time step but only at the beginning!
00187 <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/vaspxmlplugin_8c.html#a3> static int read_vaspxml_timestep <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/vaspxmlplugin_8c.html#a3>(void *mydata, int natoms, molfile_timestep_t <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structmolfile__timestep__t.html> *ts)
00188 {
00189 vasp_plugindata_t <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html> *data = (vasp_plugindata_t <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html> *)mydata;
00190 char lineptr[LINESIZE];
00191
00192 /* only save coords if we're given a timestep pointer, */
00193 /* otherwise assume that VMD wants us to skip past it. */
00194 if (!data || !ts) return MOLFILE_EOF <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/molfile__plugin_8h.html#a3>;
00195
00196 /* Scan xml file */
00197 while (fgets(lineptr, LINESIZE, data->file <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m0>)) {
00198
00199 /* Extract coordinates of all atoms */
00200 if (strstr(lineptr, "positions") != NULL) {
00201 int i;
00202 for (i = 0; i < data->numatoms <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m4> && fgets(lineptr, LINESIZE, data->file <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m0>); ++i) {
00203 float x, y, z, rotx, roty, rotz;
00204 if (3 != sscanf(lineptr, " <v> %f %f %f </v>", &x, &y, &z)) return MOLFILE_EOF <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/molfile__plugin_8h.html#a3>;
00205
00206 rotx = x*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[0][0] + y*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[1][0] + z*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[2][0];
00207 roty = x*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[0][1] + y*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[1][1] + z*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[2][1];
00208 rotz = x*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[0][2] + y*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[1][2] + z*data->cell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m7>[2][2];
00209
00210 ts->coords <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structmolfile__timestep__t.html#m0>[3*i ] = data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[0][0]*rotx + data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[0][1]*roty + data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[0][2]*rotz;
00211 ts->coords <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structmolfile__timestep__t.html#m0>[3*i+1] = data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[1][0]*rotx + data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[1][1]*roty + data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[1][2]*rotz;
00212 ts->coords <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structmolfile__timestep__t.html#m0>[3*i+2] = data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[2][0]*rotx + data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[2][1]*roty + data->rotmat <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/structvasp__plugindata__t.html#m8>[2][2]*rotz;
00213 }
00214 vasp_timestep_unitcell <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/vaspplugin_8h.html#a6>(ts, data);
00215 return MOLFILE_SUCCESS;
00216 }
00217 }
00218
00219 return MOLFILE_EOF <https://www.ks.uiuc.edu/Research/vmd/plugins/doxygen/molfile__plugin_8h.html#a3>;
I am not sure how to modify the plug in and generate the so file to use with the code, but it seems this would apply to many people.
It is the same thing with the XDATCAR plugin vaspxdatcarplugin .

On another note it is crazy that vmd won't deal with non-orthogonal cells properly.
Ron

> On Jul 16, 2024, at 9:47 AM, Ronald Cohen <rcohen_at_carnegiescience.edu> wrote:
>
> When I do pbc get -all for a vasp xml file, all the lattice parameters for all the frames are the same as for the first frame, though they are different in the xml file!
>
> pbc get -all
> {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.00000!
> 0} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.000000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.0!
> 00000} {23.912001 23.912001 23.912001 90.000000 90.000000 90.0!
> 00000}
> vmd >
> but in xml:
> starting frame 1:
> <primitive_cell>
> <structure name="primitive_cell" >
> <crystal>
> <varray name="basis" >
> <v> 23.91200000 0.00000000 0.00000000 </v>
> <v> 0.00000000 23.91200000 0.00000000 </v>
> <v> 0.00000000 0.00000000 23.91200000 </v>
> </varray>
> end frame:
> structure name="finalpos" >
> <crystal>
> <varray name="basis" >
> <v> 22.92074161 -0.00000810 0.00000367 </v>
> <v> 0.00000000 22.92074291 -0.00000149 </v>
> <v> 0.00000000 -0.00000000 22.92074175 </v>
> </varray>
>
> This is:
> VMD for LINUXAMD64, version 1.9.4a57 (April 27, 2022)
> the same thing happens for:
> VMD for LINUXAMD64, version 1.9.3 (November 30, 2016)
>
> Sincerely,
>
> Ron Cohen
>
>