aoterodelaroza / critic2

Analysis of quantum chemical interactions in molecules and solids.
Other
97 stars 35 forks source link

Add support for FPLO #69

Closed mretegan closed 3 weeks ago

mretegan commented 5 months ago

It would be useful (at least for one person 😄) to have support for reading data from FPLO (https://www.fplo.de). The program supports saving data as OpenDX files but not Cube.

aoterodelaroza commented 5 months ago

OpenDX does not seem too terrible to implement :D (though it may take me a while). I don't have an FPLO licence. Would you mind sending over an example OpenDX file to use it as reference?

mretegan commented 5 months ago

The fplo_data.tar.gz archive contains complete FPLO calculations on quartz and covellite. I also exported the density in an openDX file for both. Please let me know if you need additional files.

aoterodelaroza commented 5 months ago

I think the easiest would be to read the grid_dens.001 file (is 001 always the extension of this file?). However, this file doesn't contain the atomic positions, and I need to get that info from somewhere else for the structure to be consistent with the density. What is the input file for the run? Is scf.out the output and .out the default extension for it? If so, I could probably read the structural info from there.

mretegan commented 5 months ago

The input file for the FPLO calculation is =.in, and the name is fixed. You can extract structural information from it. The name of the output file is not standard. The suffix .001 in the grid_dens file labels the first and only grid data I write for this calculation (see screenshot below).

Screenshot 2024-04-29 at 09 44 23

yquana commented 5 months ago

OpenDX does not seem too terrible to implement :D (though it may take me a while). I don't have an FPLO licence. Would you mind sending over an example OpenDX file to use it as reference?

FPLO is free for academic use, I think.

aoterodelaroza commented 5 months ago

Reading FPLO outputs and grids is implemented. The input files are just too weird to parse, so this was the best option. You can now do:

crystal scf.out
load grid_dens.001

The first command reads the crystal structure from the output and the second reads the grid. The extensions "understood" by critic2 are "out" for the output and "001" for the grid but, as usual, you can force a particular format:

crystal fplo blah
load fplo bleh

I have made some assumptions re what the contents of both files are, so be aware that it may break down if conditions change. For the two examples you sent, it seems to be working, though. Would you please try it and let me know?