Skip to content

Commit b53a473

Browse files
committed
Merge branch 'develop' into Exx_Opt_Orb
2 parents 429ad10 + b63aad4 commit b53a473

File tree

144 files changed

+2964
-2296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+2964
-2296
lines changed

.gitmodules

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
[submodule "deps/LibRI"]
2-
path = deps/LibRI
3-
url = https://github.com/abacusmodeling/LibRI.git
4-
branch = master
5-
[submodule "deps/LibComm"]
6-
path = deps/LibComm
7-
url = https://github.com/abacusmodeling/LibComm.git
8-
branch = master
91
[submodule "deps/libpaw_interface"]
102
path = deps/libpaw_interface
113
url = https://github.com/wenfei-li/libpaw_interface

CMakeLists.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -538,13 +538,10 @@ endif()
538538
if(ENABLE_LIBRI)
539539
set_if_higher(CMAKE_CXX_STANDARD 14)
540540
if(LIBRI_DIR)
541-
include_directories(${LIBRI_DIR}/include)
542-
elseif(GIT_SUBMODULE)
543-
git_submodule_update()
544-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/LibRI/include)
545541
else()
546-
message(FATAL_ERROR "Must provide LIBRI_DIR for RI related features.")
542+
find_package(LibRI REQUIRED)
547543
endif()
544+
include_directories(${LIBRI_DIR}/include)
548545
target_link_libraries(${ABACUS_BIN_NAME} ri module_exx_symmetry)
549546
add_compile_definitions(__EXX EXX_DM=3 EXX_H_COMM=2 TEST_EXX_LCAO=0
550547
TEST_EXX_RADIAL=1)
@@ -555,13 +552,10 @@ if(ENABLE_LIBRI OR DEFINED LIBCOMM_DIR)
555552
endif()
556553
if(ENABLE_LIBCOMM)
557554
if(LIBCOMM_DIR)
558-
include_directories(${LIBCOMM_DIR}/include)
559-
elseif(GIT_SUBMODULE)
560-
git_submodule_update()
561-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/LibComm/include)
562555
else()
563-
message(FATAL_ERROR "Must provide LIBCOMM_DIR for RI related features.")
556+
find_package(LibComm REQUIRED)
564557
endif()
558+
include_directories(${LIBCOMM_DIR}/include)
565559
endif()
566560

567561
if(ENABLE_PAW)

cmake/FindLibComm.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
###############################################################################
2+
# - Find LibComm
3+
# Find the native LibComm files.
4+
#
5+
# LIBCOMM_FOUND - True if LibComm is found.
6+
# LIBCOMM_DIR - Where to find LibComm files.
7+
8+
find_path(LIBCOMM_DIR
9+
include/Comm/Comm_Tools.h
10+
HINTS ${LIBCOMM_DIR}
11+
HINTS ${LibComm_DIR}
12+
HINTS ${libcomm_DIR}
13+
)
14+
15+
if(NOT LIBCOMM_DIR)
16+
include(FetchContent)
17+
FetchContent_Declare(
18+
LibComm
19+
URL https://github.com/abacusmodeling/LibComm/archive/refs/tags/v0.1.1.tar.gz
20+
)
21+
FetchContent_Populate(LibComm)
22+
set(LIBCOMM_DIR ${libcomm_SOURCE_DIR})
23+
endif()
24+
# Handle the QUIET and REQUIRED arguments and
25+
# set LIBCOMM_FOUND to TRUE if all variables are non-zero.
26+
include(FindPackageHandleStandardArgs)
27+
find_package_handle_standard_args(LibComm DEFAULT_MSG LIBCOMM_DIR)
28+
29+
# Copy the results to the output variables and target.
30+
mark_as_advanced(LIBCOMM_DIR)

cmake/FindLibRI.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
###############################################################################
2+
# - Find LibRI
3+
# Find the native LibRI files.
4+
#
5+
# LIBRI_FOUND - True if LibRI is found.
6+
# LIBRI_DIR - Where to find LibRI files.
7+
8+
find_path(LIBRI_DIR
9+
include/RI/version.h
10+
HINTS ${LIBRI_DIR}
11+
HINTS ${LibRI_DIR}
12+
HINTS ${libri_DIR}
13+
)
14+
15+
if(NOT LIBRI_DIR)
16+
include(FetchContent)
17+
FetchContent_Declare(
18+
LibRI
19+
URL https://github.com/abacusmodeling/LibRI/archive/refs/tags/v0.2.1.1.tar.gz
20+
)
21+
FetchContent_Populate(LibRI)
22+
set(LIBRI_DIR ${libri_SOURCE_DIR})
23+
endif()
24+
# Handle the QUIET and REQUIRED arguments and
25+
# set LIBRI_FOUND to TRUE if all variables are non-zero.
26+
include(FindPackageHandleStandardArgs)
27+
find_package_handle_standard_args(LibRI DEFAULT_MSG LIBRI_DIR)
28+
29+
# Copy the results to the output variables and target.
30+
mark_as_advanced(LIBRI_DIR)

deps/LibComm

Lines changed: 0 additions & 1 deletion
This file was deleted.

deps/LibRI

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/advanced/input_files/input-main.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
- [scf\_thr](#scf_thr)
8989
- [scf\_ene\_thr](#scf_ene_thr)
9090
- [scf\_thr\_type](#scf_thr_type)
91+
- [scf\_os\_stop](#scf_os_stop)
92+
- [scf\_os\_thr](#scf_os_thr)
93+
- [scf\_os\_ndim](#scf_os_ndim)
9194
- [chg\_extrap](#chg_extrap)
9295
- [lspinorb](#lspinorb)
9396
- [noncolin](#noncolin)
@@ -1205,6 +1208,29 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12051208

12061209
- **Default**: 1 (plane-wave basis), or 2 (localized atomic orbital basis).
12071210

1211+
### scf_os_stop
1212+
1213+
- **Type**: bool
1214+
- **Description**: For systems that are difficult to converge, the SCF process may exhibit oscillations in charge density, preventing further progress toward the specified convergence criteria and resulting in continuous oscillation until the maximum number of steps is reached; this greatly wastes computational resources. To address this issue, this function allows ABACUS to terminate the SCF process early upon detecting oscillations, thus reducing subsequent meaningless calculations. The detection of oscillations is based on the slope of the logarithm of historical drho values.. To this end, Least Squares Method is used to calculate the slope of the logarithmically taken drho for the previous `scf_os_ndim` iterations. If the calculated slope is larger than `scf_os_thr`, stop the SCF.
1215+
1216+
- **0**: The SCF will continue to run regardless of whether there is oscillation or not.
1217+
- **1**: If the calculated slope is larger than `scf_os_thr`, stop the SCF.
1218+
1219+
- **Default**: false
1220+
1221+
### scf_os_thr
1222+
1223+
- **Type**: double
1224+
- **Description**: The slope threshold to determine if the SCF is stuck in a charge density oscillation. If the calculated slope is larger than `scf_os_thr`, stop the SCF.
1225+
1226+
- **Default**: -0.01
1227+
1228+
### scf_os_ndim
1229+
1230+
- **Type**: int
1231+
- **Description**: To determine the number of old iterations' `drho` used in slope calculations.
1232+
- **Default**: `mixing_ndim`
1233+
12081234
### chg_extrap
12091235

12101236
- **Type**: String
File renamed without changes.

examples/vdw/si2/INPUT2 renamed to examples/vdw/si2-vdwd2/INPUT2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#INPUT file for applying D3(BJ) correction
2-
#with default VdW parameters
1+
#INPUT file for applying D2 correction
2+
#where I chose to manually set the C6 parameter
3+
#in file c6.txt
34
#in pw basis
45

56
INPUT_PARAMETERS
@@ -12,4 +13,5 @@ ecutwfc 50
1213
scf_nmax 100
1314
scf_thr 1e-6
1415
basis_type pw
15-
vdw_method d3_bj
16+
vdw_method d2
17+
vdw_C6_file c6.txt
File renamed without changes.

0 commit comments

Comments
 (0)