dftd3 / simple-dftd3

reimplementation of the DFT-D3 program
https://dftd3.readthedocs.io
GNU Lesser General Public License v3.0
51 stars 26 forks source link

Default realspace cutoffs #10

Closed knikhil1995 closed 2 years ago

knikhil1995 commented 2 years ago

Would it be possible to set the default (2-body) cutoff to 94.8683 a.u. as in the reference implementation as opposed to 60 a.u. right now?

awvwgk commented 2 years ago

The default realspace cutoff for the pairwise interactions is set here:

https://github.com/awvwgk/simple-dftd3/blob/1961f9ed0bf03085144b76c8b19beea576190113/src/dftd3/cutoff.f90#L27-L28

It can be overwritten in the Fortran API, but is not accessible via command line or C/Python API yet.

knikhil1995 commented 2 years ago

Thanks, I am implementing support for s-dftd3 and dftd4 (via the C API, treating both as external dependencies for now) in the dftfe code (finite element dft code) but the results from dftfe runs differed from the results obtained from the reference implementation due to the difference in cutoffs.

If possible I would like to request that the cutoff be changed in s-dftd3 so that I may continue treating s-dftd3 as an external dependency otherwise feel free to close this issue.

awvwgk commented 2 years ago

I will make the real space cutoff accessible via the C/Python API, maybe I can find a way without breaking the API (while we are pre-1.0, I try to take API stability serious here).

awvwgk commented 2 years ago

I will add an API to set the realspace cutoff in the dispersion model object with

// Set realspace cutoffs (quantities in Bohr)
SDFTD3_API_ENTRY void SDFTD3_API_CALL
dftd3_set_model_realspace_cutoff(dftd3_error /* error */,
                                 dftd3_model /* model */,
                                 double /* disp2 */,
                                 double /* disp3 */,
                                 double /* cn */) SDFTD3_API_SUFFIX__V_0_5;

Let me know whether this is sufficient for your usecase.

knikhil1995 commented 2 years ago

Yes, this will be sufficient for my usecase.

Thank you very much.

awvwgk commented 2 years ago

Out of curiosity, can you share a link to the program package? Is it https://github.com/dftfeDevelopers/dftfe by chance?

knikhil1995 commented 2 years ago

Yes, that is the release version, development is being done on bitbucket.

awvwgk commented 2 years ago

Included in version 0.5.0