You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(a) The most usual format has the list of atoms and immediately after the density data.
(b) There is a second format uses "negative" number of atoms to indicate that there will some kind of "orbital" index (two numbers actually) in between the list and the data.
But inspecting the code, it seems that OpenBabel supports both variants for reading.
But it doesn't implement (a) for writing.
This is unfortunate because VESTA and VisIt and others do not support format (b).
I can hack the OpenBabel code to implement writing in format (a), but I wonder if there is a better way to handle subtle changes in the output format.
In any case if one doesn't introduce a whole new format, I would like to know if there is way to pass this information to the converter of the Format class.
I notice for example that there is a Flags() method in the Format class, but it seems to be for something else.
These are the lines that need to be modified to save the CUBE file in the most usual format (a).
Another leaner alternative, that doesn't require flags, is to default to format (a) when there is only one GridData count.
In any case, I would like to know if there is interest in implementing this in the code.
I can propose a merge request after asking some framework questions (testing, etc).
The text was updated successfully, but these errors were encountered:
correaa
changed the title
What is the correct way to deal with dialects for output
Correct way to deal with dialects for output of CUBE files
Mar 28, 2023
To be specific, this is the change I propose. #2580
It can be interpreted as it is, or if a there is better mechanism, I can change the negAtoms flag I introduced to depend on some flag passed to the format instead of the number of grid_datas count.
Thank you for the pointers.
I will take a look into these options.
To not complicate things more than needed, I propose to default to the (simpler) format (a) in the case that there is only one grid associated with the molecule.
Having one grid is very common and it is also common that other programs only format (a) anyway.
I use CUBE files a lot for quick inspection of simulation results.
And I use the popular VESTA and VisIt applications for visualization.
To my surprise, I realized that there are two dialects of CUBE format defined https://gaussian.com/cubegen/
(a) The most usual format has the list of atoms and immediately after the density data.
(b) There is a second format uses "negative" number of atoms to indicate that there will some kind of "orbital" index (two numbers actually) in between the list and the data.
But inspecting the code, it seems that OpenBabel supports both variants for reading.
But it doesn't implement (a) for writing.
This is unfortunate because VESTA and VisIt and others do not support format (b).
I can hack the OpenBabel code to implement writing in format (a), but I wonder if there is a better way to handle subtle changes in the output format.
In any case if one doesn't introduce a whole new format, I would like to know if there is way to pass this information to the converter of the Format class.
I notice for example that there is a
Flags()
method in the Format class, but it seems to be for something else.These are the lines that need to be modified to save the CUBE file in the most usual format (a).
https://github.com/openbabel/openbabel/blob/master/src/formats/gausscubeformat.cpp#L620-L628
Another leaner alternative, that doesn't require flags, is to default to format (a) when there is only one GridData count.
In any case, I would like to know if there is interest in implementing this in the code.
I can propose a merge request after asking some framework questions (testing, etc).
The text was updated successfully, but these errors were encountered: