Skip to content

Commit edfa4c1

Browse files
Feature: build-in DFTD3 parameters (#5378)
* Feature: build-in DFTD3 parameters with fall-back parameter search strategy * update * correct parameters * correct the annotation at the end of file dftd3.h * support libxc * add annotations * update alias: hse06 -> hse * [pre-commit.ci lite] apply automatic fixes * update the autoset strategy: if user defined, then use * fix compilation error * correct the unittest * xc with _v, _d3 should be carefully treated * give up the so-called fall-back strategy * correct a minor bug * disable the output * support the dft_functional value without the XC_ header * ouch... stupid mistake * Update doc * add more unittests * correct behavior on wb97 functional family according to advice --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent ddf990f commit edfa4c1

File tree

21 files changed

+1767
-310
lines changed

21 files changed

+1767
-310
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@
243243
- [exx\_opt\_orb\_ecut](#exx_opt_orb_ecut)
244244
- [exx\_opt\_orb\_tolerence](#exx_opt_orb_tolerence)
245245
- [exx\_real\_number](#exx_real_number)
246-
- [exx\_symmetry\_realspace](#exx_symmetry_realspace)
247246
- [rpa\_ccp\_rmesh\_times](#rpa_ccp_rmesh_times)
247+
- [exx\_symmetry\_realspace](#exx_symmetry_realspace)
248248
- [out\_ri\_cv](#out_ri_cv)
249249
- [Molecular dynamics](#molecular-dynamics)
250250
- [md\_type](#md_type)
@@ -273,6 +273,9 @@
273273
- [lj\_epsilon](#lj_epsilon)
274274
- [lj\_sigma](#lj_sigma)
275275
- [pot\_file](#pot_file)
276+
- [dp\_rescaling](#dp_rescaling)
277+
- [dp\_fparam](#dp_fparam)
278+
- [dp\_aparam](#dp_aparam)
276279
- [msst\_direction](#msst_direction)
277280
- [msst\_vel](#msst_vel)
278281
- [msst\_vis](#msst_vis)
@@ -422,11 +425,12 @@
422425
- [nocc](#nocc)
423426
- [nvirt](#nvirt)
424427
- [lr\_nstates](#lr_nstates)
428+
- [lr\_unrestricted](#lr_unrestricted)
425429
- [abs\_wavelen\_range](#abs_wavelen_range)
426430
- [out\_wfc\_lr](#out_wfc_lr)
427431
- [abs\_broadening](#abs_broadening)
428432
- [ri\_hartree\_benchmark](#ri_hartree_benchmark)
429-
- [aims_nbasis](#aims_nbasis)
433+
- [aims\_nbasis](#aims_nbasis)
430434

431435
[back to top](#full-list-of-input-keywords)
432436
## System variables
@@ -2908,46 +2912,38 @@ These variables are used to control vdW-corrected related parameters.
29082912
- **Type**: String
29092913
- **Description**: Specifies the method used for Van der Waals (VdW) correction. Available options are:
29102914
- `d2`: [Grimme's D2](https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.20495) dispersion correction method
2911-
- `d3_0`: [Grimme's DFT-D3(0)](https://aip.scitation.org/doi/10.1063/1.3382344) dispersion correction method
2912-
- `d3_bj`: [Grimme's DFTD3(BJ)](https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.21759) dispersion correction method
2915+
- `d3_0`: [Grimme's DFT-D3(0)](https://aip.scitation.org/doi/10.1063/1.3382344) dispersion correction method (zero-damping)
2916+
- `d3_bj`: [Grimme's DFTD3(BJ)](https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.21759) dispersion correction method (BJ-damping)
29132917
- `none`: no vdW correction
29142918
- **Default**: none
2919+
- **Note**: ABACUS supports automatic setting on DFT-D3 parameters for common functionals after version 3.8.3 (and several develop versions earlier). To benefit from this feature, please specify the parameter `dft_functional` explicitly (for more details on this parameter, please see [dft_functional](#dft_functional)), otherwise the autoset procedure will crash with error message like `cannot find DFT-D3 parameter for XC(***)`. If not satisfied with those in-built parameters, any manually setting on `vdw_s6`, `vdw_s8`, `vdw_a1` and `vdw_a2` will overwrite.
2920+
- **Special**: There are special cases for functional family wB97 (Omega-B97): if want to use the functional wB97X-D3BJ, one needs to specify the `dft_functional` as `HYB_GGA_WB97X_V` and `vdw_method` as `d3_bj`. If want to use the functional wB97X-D3, specify `dft_functional` as `HYB_GGA_WB97X_D3` and `vdw_method` as `d3_0`.
29152921

29162922
### vdw_s6
29172923

29182924
- **Type**: Real
29192925
- **Availability**: `vdw_method` is set to `d2`, `d3_0`, or `d3_bj`
2920-
- **Description**: This scale factor is used to optimize the interaction energy deviations in van der Waals (vdW) corrected calculations. The recommended values of this parameter are dependent on the chosen vdW correction method and the DFT functional being used. For DFT-D2, the recommended values are 0.75 (PBE), 1.2 (BLYP), 1.05 (B-P86), 1.0 (TPSS), and 1.05 (B3LYP). For DFT-D3, recommended values with different DFT functionals can be found on the [here](https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3). The default value of this parameter in ABACUS is set to be the recommended value for PBE.
2926+
- **Description**: This scale factor is used to optimize the interaction energy deviations in van der Waals (vdW) corrected calculations. The recommended values of this parameter are dependent on the chosen vdW correction method and the DFT functional being used. For DFT-D2, the recommended values are 0.75 (PBE), 1.2 (BLYP), 1.05 (B-P86), 1.0 (TPSS), and 1.05 (B3LYP). If not set, will use values of PBE functional. For DFT-D3, recommended values with different DFT functionals can be found on the [here](https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml). If not set, will search in ABACUS built-in dataset based on the `dft_functional` keywords. User set value will overwrite the searched value.
29212927
- **Default**:
29222928
- 0.75: if `vdw_method` is set to `d2`
2923-
- 1.0: if `vdw_method` is set to `d3_0` or `d3_bj`
29242929

29252930
### vdw_s8
29262931

29272932
- **Type**: Real
29282933
- **Availability**: `vdw_method` is set to `d3_0` or `d3_bj`
2929-
- **Description**: This scale factor is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3). The default value of this parameter in ABACUS is set to be the recommended value for PBE.
2930-
- **Default**:
2931-
- 0.722: if `vdw_method` is set to `d3_0`
2932-
- 0.7875: if `vdw_method` is set to `d3_bj`
2934+
- **Description**: This scale factor is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml). If not set, will search in ABACUS built-in dataset based on the `dft_functional` keywords. User set value will overwrite the searched value.
29332935

29342936
### vdw_a1
29352937

29362938
- **Type**: Real
29372939
- **Availability**: `vdw_method` is set to `d3_0` or `d3_bj`
2938-
- **Description**: This damping function parameter is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3). The default value of this parameter in ABACUS is set to be the recommended value for PBE.
2939-
- **Default**:
2940-
- 1.217: if `vdw_method` is set to `d3_0`
2941-
- 0.4289: if `vdw_method` is set to `d3_bj`
2940+
- **Description**: This damping function parameter is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml). If not set, will search in ABACUS built-in dataset based on the `dft_functional` keywords. User set value will overwrite the searched value.
29422941

29432942
### vdw_a2
29442943

29452944
- **Type**: Real
29462945
- **Availability**: `vdw_method` is set to `d3_0` or `d3_bj`
2947-
- **Description**: This damping function parameter is only relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3). The default value of this parameter in ABACUS is set to be the recommended value for PBE.
2948-
- **Default**:
2949-
- 1.0: if `vdw_method` is set to `d3_0`
2950-
- 4.4407: if `vdw_method` is set to `d3_bj`
2946+
- **Description**: This damping function parameter is only relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the [webpage](https://github.com/dftd3/simple-dftd3/blob/main/assets/parameters.toml). If not set, will search in ABACUS built-in dataset based on the `dft_functional` keywords. User set value will overwrite the searched value.
29512947

29522948
### vdw_d
29532949

source/module_esolver/esolver_ks_pw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void ESolver_KS_PW<T, Device>::before_scf(const int istep)
210210
//----------------------------------------------------------
211211
// about vdw, jiyy add vdwd3 and linpz add vdwd2
212212
//----------------------------------------------------------
213-
auto vdw_solver = vdw::make_vdw(GlobalC::ucell, PARAM.inp);
213+
auto vdw_solver = vdw::make_vdw(GlobalC::ucell, PARAM.inp, &(GlobalV::ofs_running));
214214
if (vdw_solver != nullptr)
215215
{
216216
this->pelec->f_en.evdw = vdw_solver->get_energy();

source/module_esolver/lcao_before_scf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(const int istep)
198198
//----------------------------------------------------------
199199
// about vdw, jiyy add vdwd3 and linpz add vdwd2
200200
//----------------------------------------------------------
201-
auto vdw_solver = vdw::make_vdw(GlobalC::ucell, PARAM.inp);
201+
auto vdw_solver = vdw::make_vdw(GlobalC::ucell, PARAM.inp, &(GlobalV::ofs_running));
202202
if (vdw_solver != nullptr)
203203
{
204204
this->pelec->f_en.evdw = vdw_solver->get_energy();

0 commit comments

Comments
 (0)