ISISNeutronMuon / MDANSE

MDANSE: Molecular Dynamics Analysis for Neutron Scattering Experiments
https://www.isis.stfc.ac.uk/Pages/MDANSEproject.aspx
GNU General Public License v3.0
18 stars 4 forks source link

Average structure analysis #465

Closed MBartkowiakSTFC closed 2 weeks ago

MBartkowiakSTFC commented 3 weeks ago

Description of work A new analysis type has been added in this PR. It is a tool mentioned in #446 allowing the user to output the time-averaged crystal structure of the simulated system. The intention is to use it with an external tool like phonopy or spglib to determine the symmetry of the system and find the single unit cell of the supercell that was being simulated.

Fixes

  1. New analysis added: AverageStructure.
  2. OutputStructureConfigurator added, specifically for choosing an output format supported by ASE.
  3. A matching OutputStructureWidget has been added to the GUI.
  4. Unit tests for AverageStructure runs check that it executes without crashing for several combinations of parameters.

To test Tests must pass. You can run the AverageStructure analysis on a crystal(like) system; the LAMMPS CuSbS trajectory can be used if you exclude the Cu atoms.

ChiCheng45 commented 2 weeks ago

Looks great. I generated some cif files of some averaged structures and they loaded up in mercury successfully.

image

image

It won't make much (if any) difference but what do you think about running average over the atomic positions in fractional coordinates first then converting back to cartesians with the averaged unit cell rather than the current approach which runs the average over cartesian coordinates?

I think the two approaches would be the same if the unit cell is cubic and stays cubic during the simulation but I wonder if it would be different if it is not cubic and the unit cell angles change.

MBartkowiakSTFC commented 2 weeks ago

I thought that using the Cartesian coordinates would result in a slightly lower risk of getting wrong results. The averaging of the unit cell, on the other hand, is something that I would worry about in general, independent of how the coordinates were handled.

I cannot really predict how bad the worst case scenario would be, since generally the expectation we have that the atoms stay around their equilibrium positions normally should correspond to a reasonably stable unit cell shape as well.