Skip to content

Commit 5d8ed7d

Browse files
authored
Re-implement DFT-D3 against the s-dftd3 reference (#7830)
* Re-implement DFT-D3 against the s-dftd3 reference * Update input keywords description * Fix Makefile objects Only make it able to compile, not ensuring it compile correctly
1 parent 2998de3 commit 5d8ed7d

39 files changed

Lines changed: 14418 additions & 36205 deletions

docs/advanced/input_files/input-main.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3988,7 +3988,7 @@
39883988
- d4: Grimme's DFT-D4 dispersion correction method using the external DFT-D4 library
39893989
- none: no vdW correction
39903990

3991-
> Note: ABACUS supports automatic setting of DFT-D3 parameters for common functionals. To benefit from this feature, please specify the parameter dft_functional explicitly, otherwise the autoset procedure will crash. If not satisfied with the built-in parameters, any manual setting on vdw_s6, vdw_s8, vdw_a1 and vdw_a2 will overwrite the automatic values.
3991+
> Note: ABACUS automatically loads DFT-D3 parameters for supported functionals according to dft_functional setting. Individual user values overwrite the corresponding tabulated values. Setting all four of vdw_s6, vdw_s8, vdw_a1 and vdw_a2 defines a fully custom set and bypasses functional lookup.
39923992
- **Default**: none
39933993

39943994
### vdw_d4_xc
@@ -4014,25 +4014,25 @@
40144014

40154015
- **Type**: String
40164016
- **Availability**: *[`vdw_method`](#vdw_method) in [d2, d3_0, d3_bj]*
4017-
- **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. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value.
4017+
- **Description**: Scale factor s6, which 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 by default. For DFT-D3, ABACUS will search in built-in dataset based on the dft_functional setting by default; user set value will overwrite the searched value.
40184018

40194019
### vdw_s8
40204020

40214021
- **Type**: String
40224022
- **Availability**: *[`vdw_method`](#vdw_method) in [d3_0, d3_bj]*
4023-
- **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. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value.
4023+
- **Description**: Scale factor s8 for D3(0) and D3(BJ). By default, ABACUS will search in built-in dataset based on the dft_functional setting. User set value will overwrite the searched value.
40244024

40254025
### vdw_a1
40264026

40274027
- **Type**: String
40284028
- **Availability**: *[`vdw_method`](#vdw_method) in [d3_0, d3_bj]*
4029-
- **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. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value.
4029+
- **Description**: Damping parameter rs6 for D3(0), or a1 for D3(BJ). If not set, ABACUS loads the s-dftd3 value for dft_functional. A user value overwrites the tabulated value.
40304030

40314031
### vdw_a2
40324032

40334033
- **Type**: String
40344034
- **Availability**: *[`vdw_method`](#vdw_method) in [d3_0, d3_bj]*
4035-
- **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. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value.
4035+
- **Description**: Damping parameter rs8 for D3(0), or a2 for D3(BJ). If not set, ABACUS loads the s-dftd3 value for dft_functional. A user value overwrites the tabulated value.
40364036

40374037
### vdw_d
40384038

@@ -4095,7 +4095,7 @@
40954095
- **Type**: String
40964096
- **Description**: Determines the method used for specifying the cutoff radius in periodic systems when applying Van der Waals correction. Available options are:
40974097
- radius: The supercell is selected within a sphere centered at the origin with a radius defined by vdw_cutoff_radius.
4098-
- period: The extent of the supercell is explicitly specified using the vdw_cutoff_period keyword.
4098+
- period: The extent of the D2 supercell is explicitly specified using the vdw_cutoff_period keyword. DFT-D3 and DFT-D4 require radius.
40994099
- **Default**: radius
41004100

41014101
### vdw_cutoff_radius
@@ -4117,7 +4117,7 @@
41174117
### vdw_cutoff_width2
41184118

41194119
- **Type**: Real
4120-
- **Availability**: *[`vdw_method`](#vdw_method)==d4*
4120+
- **Availability**: *[`vdw_method`](#vdw_method) in [d3_0, d3_bj, d4]*
41214121
- **Description**: Width of the smooth switching region for the two-body pairwise dispersion real-space cutoff.
41224122
A value of zero disables smoothing for the two-body contribution.
41234123
- **Default**: 0.05
@@ -4126,10 +4126,10 @@
41264126
### vdw_cutoff_width3
41274127

41284128
- **Type**: Real
4129-
- **Availability**: *[`vdw_method`](#vdw_method)==d4*
4129+
- **Availability**: *[`vdw_method`](#vdw_method) in [d3_0, d3_bj, d4]*
41304130
- **Description**: Width of the smooth switching region for the three-body Axilrod-Teller-Muto (ATM) dispersion real-space cutoff.
41314131
A value of zero disables smoothing for the three-body contribution.
4132-
- **Default**: 0.05
4132+
- **Default**: 0.0
41334133
- **Unit**: Bohr
41344134

41354135
### vdw_cutoff_period

docs/parameters.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4263,7 +4263,7 @@ parameters:
42634263
* d4: Grimme's DFT-D4 dispersion correction method using the external DFT-D4 library
42644264
* none: no vdW correction
42654265
4266-
[NOTE] ABACUS supports automatic setting of DFT-D3 parameters for common functionals. To benefit from this feature, please specify the parameter dft_functional explicitly, otherwise the autoset procedure will crash. If not satisfied with the built-in parameters, any manual setting on vdw_s6, vdw_s8, vdw_a1 and vdw_a2 will overwrite the automatic values.
4266+
[NOTE] ABACUS automatically loads DFT-D3 parameters for supported functionals according to dft_functional setting. Individual user values overwrite the corresponding tabulated values. Setting all four of vdw_s6, vdw_s8, vdw_a1 and vdw_a2 defines a fully custom set and bypasses functional lookup.
42674267
default_value: none
42684268
unit: ""
42694269
availability: ""
@@ -4291,31 +4291,31 @@ parameters:
42914291
category: vdW correction
42924292
type: String
42934293
description: |
4294-
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. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value.
4294+
Scale factor s6, which 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 by default. For DFT-D3, ABACUS will search in built-in dataset based on the dft_functional setting by default; user set value will overwrite the searched value.
42954295
default_value: ""
42964296
unit: ""
42974297
availability: "vdw_method in [d2, d3_0, d3_bj]"
42984298
- name: vdw_s8
42994299
category: vdW correction
43004300
type: String
43014301
description: |
4302-
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. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value.
4302+
Scale factor s8 for D3(0) and D3(BJ). By default, ABACUS will search in built-in dataset based on the dft_functional setting. User set value will overwrite the searched value.
43034303
default_value: ""
43044304
unit: ""
43054305
availability: "vdw_method in [d3_0, d3_bj]"
43064306
- name: vdw_a1
43074307
category: vdW correction
43084308
type: String
43094309
description: |
4310-
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. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value.
4310+
Damping parameter rs6 for D3(0), or a1 for D3(BJ). If not set, ABACUS loads the s-dftd3 value for dft_functional. A user value overwrites the tabulated value.
43114311
default_value: ""
43124312
unit: ""
43134313
availability: "vdw_method in [d3_0, d3_bj]"
43144314
- name: vdw_a2
43154315
category: vdW correction
43164316
type: String
43174317
description: |
4318-
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. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value.
4318+
Damping parameter rs8 for D3(0), or a2 for D3(BJ). If not set, ABACUS loads the s-dftd3 value for dft_functional. A user value overwrites the tabulated value.
43194319
default_value: ""
43204320
unit: ""
43214321
availability: "vdw_method in [d3_0, d3_bj]"
@@ -4387,7 +4387,7 @@ parameters:
43874387
description: |
43884388
Determines the method used for specifying the cutoff radius in periodic systems when applying Van der Waals correction. Available options are:
43894389
* radius: The supercell is selected within a sphere centered at the origin with a radius defined by vdw_cutoff_radius.
4390-
* period: The extent of the supercell is explicitly specified using the vdw_cutoff_period keyword.
4390+
* period: The extent of the D2 supercell is explicitly specified using the vdw_cutoff_period keyword. DFT-D3 and DFT-D4 require radius.
43914391
default_value: radius
43924392
unit: ""
43934393
availability: ""
@@ -4417,16 +4417,16 @@ parameters:
44174417
A value of zero disables smoothing for the two-body contribution.
44184418
default_value: "0.05"
44194419
unit: Bohr
4420-
availability: vdw_method==d4
4420+
availability: "vdw_method in [d3_0, d3_bj, d4]"
44214421
- name: vdw_cutoff_width3
44224422
category: vdW correction
44234423
type: Real
44244424
description: |
44254425
Width of the smooth switching region for the three-body Axilrod-Teller-Muto (ATM) dispersion real-space cutoff.
44264426
A value of zero disables smoothing for the three-body contribution.
4427-
default_value: "0.05"
4427+
default_value: "0.0"
44284428
unit: Bohr
4429-
availability: vdw_method==d4
4429+
availability: "vdw_method in [d3_0, d3_bj, d4]"
44304430
- name: vdw_cutoff_period
44314431
category: vdW correction
44324432
type: Integer Integer Integer

source/Makefile.Objects

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,9 +909,9 @@ OBJS_VDW=vdw.o\
909909
vdwd3_parameters.o\
910910
vdwd2.o\
911911
vdwd3.o\
912-
vdwd3_parameters_tab.o\
913-
vdwd3_autoset_xcname.o\
914-
vdwd3_auto_xcpar.o
912+
vdwd3_data.o\
913+
vdwd3_evaluator.o\
914+
vdw_xcname.o
915915

916916
OBJS_DFTU=dftu_nao.o\
917917
dftu_nao_fs_k.o\

source/source_hamilt/module_vdw/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
set(vdw_sources
2+
vdw_xcname.cpp
23
vdwd2_parameters.cpp
3-
vdwd3_parameters_tab.cpp
4-
vdwd3_parameters.cpp
54
vdwd2.cpp
5+
vdwd3_data.cpp
6+
vdwd3_parameters.cpp
7+
vdwd3_evaluator.cpp
68
vdwd3.cpp
7-
vdwd3_autoset_xcname.cpp
8-
vdwd3_auto_xcpar.cpp
99
vdw.cpp
1010
)
1111

0 commit comments

Comments
 (0)