Skip to content

Commit

Permalink
Merge pull request #184 from deepmodeling/develop
Browse files Browse the repository at this point in the history
Merge: v2.3.5
  • Loading branch information
dyzheng authored Sep 8, 2022
2 parents 429fdd6 + b8e0b47 commit b054731
Show file tree
Hide file tree
Showing 65 changed files with 6,165 additions and 2,867 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ target_link_libraries(${ABACUS_BIN_NAME}
driver
xc_
hsolver
genelpa
elecstate
hamilt
psi
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ ABACUS provides the following features and functionalities:
20. (subsidiary tool)Generator for second generation numerical orbital basis.
21. Interface with DPGEN
22. Interface with phonopy
23. Implicit solvation model

[back to top](#readme-top)

Expand Down Expand Up @@ -161,6 +162,7 @@ The following provides basic sample jobs in ABACUS. More can be found in the dir
- [BSSE for molecular formation energy](docs/examples/BSSE.md)
- [ABACUS-DPGEN interface](docs/examples/dpgen.md)
- [ABACUS-phonopy interface](docs/examples/phonopy.md)
- [Implicit solvation model](docs/examples/implicit-sol.md)

[back to top](#readme-top)

Expand Down
63 changes: 63 additions & 0 deletions docs/examples/implicit-sol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Implicit solvation model

[back to main page](../../README.md)

Solid-liquid interfaces are ubiquitous in nature and frequently encountered and employed in materials simulation. The solvation effect should be taken into account in accurate first-principles calculations of such systems.
Implicit solvation model is a well-developed method to deal with solvation effects, which has been widely used in finite and periodic systems. This approach treats the solvent as a continuous medium instead of individual “explicit” solvent molecules, which means that the solute embedded in an implicit solvent and the average over the solvent degrees of freedom becomes implicit in the properties of the solvent bath.

## Input
```
INPUT_PARAMETERS
imp_sol 1
eb_k 80
tau 0.000010798
sigma_k 0.6
nc_k 0.00037
```
- imp_sol

If set to 1, an implicit solvation correction is considered. 0:vacuum calculation(default).
- eb_k

The relative permittivity of the bulk solvent, 80 for water. Used only if `imp_sol` == true.
- tau

The effective surface tension parameter, which describes the cavitation, the dispersion, and the repulsion interaction between the solute and the solvent that are not captured by the electrostatic terms.
We use the values of `tau`, `sigma_k`, `nc_k` that were obtained by a fit of the model to experimental solvation energies for molecules in water. tau = 0.525 $meV/Å^{2}$ = 1.0798e-05 $Ry/Bohr^{2}$.
- sigma_k

We assume a diffuse cavity that is implicitly determined by the electronic structure of the solute.
`sigma_k` is the parameter that describes the width of the diffuse cavity. The specific value is sigma_k = 0.6.
- nc_k

`nc_k` determines at what value of the electron density the dielectric cavity forms.
The specific value is nc_k = 0.0025 $Å^{-3}$ = 0.00037 $Bohr^{-3}$.

## Output
In this example, we calculate the implicit solvation correction for H2O.
The results of the energy calculation are written in the “running_nscf.log” in the OUT folder.
```
Energy Rydberg eV
E_KohnSham -34.3200995971 -466.948910448
E_Harris -34.2973698556 -466.639656449
E_band -7.66026117767 -104.223200184
E_one_elec -56.9853883251 -775.325983964
E_Hartree +30.0541108968 +408.907156521
E_xc -8.32727420734 -113.298378028
E_Ewald +0.961180728747 +13.0775347188
E_demet +0 +0
E_descf +0 +0
E_efield +0 +0
E_exx +0 +0
E_sol_el -0.0250553663339 -0.340895747619
E_sol_cav +0.00232667606131 +0.031656051834
E_Fermi -0.499934383866 -6.8019562467
```
- E_sol_el: Electrostatic contribution to the solvation energy.
- E_sol_cav: Cavitation and dispersion contributions to the solvation energy.
Both `E_sol_el` and `E_sol_cav` corrections are included in `E_KohnSham`.



[back to top](#implicit-solvation-model)
4 changes: 2 additions & 2 deletions docs/examples/phonopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[back to main page](../../README.md)


[Phonopy](https://github.com/phonopy/phonopy) is a powerful package to calculate phonon and related properties. It has provided interface with ABACUS. In the following, we take the FCC aluminum as an example:
[Phonopy](https://github.com/phonopy/phonopy) (Note: please use the `develop` branch, rather than the `master` branch until the abacus interface has been merged into phonopy's `master` branch.) is a powerful package to calculate phonon and related properties. It has provided interface with ABACUS. In the following, we take the FCC aluminum as an example:


1. Prepare a 'setting.conf' with following tags:
Expand Down Expand Up @@ -39,4 +39,4 @@ PRIMITIVE_AXES = 0 1/2 1/2 1/2 0 1/2 1/2 1/2 0
BAND= 1 1 1 1/2 1/2 1 3/8 3/8 3/4 0 0 0 1/2 1/2 1/2
BAND_POINTS = 21
BAND_CONNECTION = .TRUE.
```
```
9 changes: 7 additions & 2 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ ATOMIC_SPECIES
Si 28.00 Si_ONCV_PBE-1.0.upf
```

The user can download the pseudopotential files from our [website](http://abacus.ustc.edu.cn/pseudo.html).
You can download the pseudopotential files from our [website](http://abacus.ustc.edu.cn/pseudo/list.htm).

For more information of different types of pseudopotentials, please visit the Quantum espresso [website](http://www.quantum-espresso.org/pseudopotentials/).
There are pseudopotential files in these websites which are also supported by ABACUS:
1. [Quantum ESPRESSO](http://www.quantum-espresso.org/pseudopotentials/).
2. [SG15-ONCV](http://quantum-simulation.org/potentials/sg15_oncv/upf/).
3. [DOJO](http://www.pseudo-dojo.org/).

If LCAO base is used, the numerical orbital files should match the pseudopotential files. The [official orbitals package](http://abacus.ustc.edu.cn/pseudo/list.htm) only matches SG15-ONCV pseudopotentials.

[back to top](#features)

Expand Down
40 changes: 40 additions & 0 deletions docs/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@

[cal_cond](#cal_cond) | [cond_nche](#cond_nche) | [cond_dw](#cond_dw) | [cond_wcut](#cond_wcut) | [cond_wenlarge](#cond_wenlarge) | [cond_fwhm ](#cond_fwhm )

- [Implicit solvation model](#implicit-solvation-model)

[imp_sol](#imp_sol) | [eb_k](#eb_k) | [tau](#tau) | [sigma_k](#sigma_k) | [nc_k](#nc_k)

[back to main page](../README.md)

## Structure of the file
Expand Down Expand Up @@ -1662,3 +1666,39 @@ Thermal conductivities: $\kappa = \lim_{\omega\to 0}\kappa(\omega)$
- **Type**: Integer
- **Description**: We use gaussian functions to approxiamte $\delta(E)\approx \frac{1}{\sqrt{2\pi}\Delta E}e^{-\frac{E^2}{2{\Delta E}^2}}$. FWHM for conductivities, $FWHM=2*\sqrt{2\ln2}\cdot \Delta E$. The unit is eV.
- **Default**: 0.3
### Implicit solvation model
This part of variables are used to control the usage of implicit solvation model. This approach treats the solvent as a continuous medium instead of individual “explicit” solvent molecules, which means that the solute embedded in an implicit solvent and the average over the solvent degrees of freedom becomes implicit in the properties of the solvent bath.
#### imp_sol
- **Type**: Boolean
- **Description**: If set to 1, an implicit solvation correction is considered.
- **Default**: 0
#### eb_k
- **Type**: Real
- **Description**: The relative permittivity of the bulk solvent, 80 for water. Used only if `imp_sol` == true.
- **Default**: 80
#### tau
- **Type**: Real
- **Description**: The effective surface tension parameter, which describes the cavitation, the dispersion, and the repulsion interaction between the solute and the solvent that are not captured by the electrostatic terms. The unit is $Ry/Bohr^{2}$.
- **Default**: 1.0798e-05
#### sigma_k
- **Type**: Real
- **Description**: We assume a diffuse cavity that is implicitly determined by the electronic structure of the solute.
`sigma_k` is the parameter that describes the width of the diffuse cavity.
- **Default**: 0.6
#### nc_k
- **Type**: Real
- **Description**: It determines at what value of the electron density the dielectric cavity forms.
The unit is $Bohr^{-3}$.
- **Default**: 0.00037
13 changes: 0 additions & 13 deletions modules/FindELPA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,4 @@ if(ELPA_FOUND)
endif()

set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ELPA_INCLUDE_DIR})
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <elpa/elpa_version.h>
#if ELPA_API_VERSION < 20210430
#error ELPA version is too old.
#endif
int main(){}
"
ELPA_VERSION_SATISFIES
)
if(NOT ELPA_VERSION_SATISFIES)
message(FATAL_ERROR "ELPA version is too old. We support version 2017 or higher.")
endif()
mark_as_advanced(ELPA_INCLUDE_DIR ELPA_LIBRARY)
1 change: 1 addition & 0 deletions source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ VPATH=./src_global\
:./module_xc\
:./module_esolver\
:./module_hsolver\
:./module_hsolver/genelpa\
:./module_elecstate\
:./module_psi\
:./module_hamilt\
Expand Down
6 changes: 6 additions & 0 deletions source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ hsolver_lcao.o\
hsolver_pw.o\
hsolver_pw_sdft.o

OBJ_GENELPA=elpa_new_complex.o\
elpa_new_real.o\
elpa_new.o\
utils.o

OBJ_ELECSTATES=elecstate.o\
dm2d_to_grid.o\
elecstate_lcao.o\
Expand Down Expand Up @@ -304,6 +309,7 @@ $(OBJ_HSOLVER)\
$(OBJ_ELECSTATES)\
$(OBJ_PSI)\
${OBJ_OPERATOR}\
${OBJ_GENELPA}\
charge.o \
charge_mixing.o \
charge_pulay.o \
Expand Down
4 changes: 4 additions & 0 deletions source/input_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ void Input_Conv::Convert(void)

if (GlobalC::exx_global.info.hybrid_type != Exx_Global::Hybrid_Type::No)
{
//EXX case, convert all EXX related variables
GlobalC::exx_global.info.hybrid_alpha = INPUT.exx_hybrid_alpha;
XC_Functional::get_hybrid_alpha(INPUT.exx_hybrid_alpha);
GlobalC::exx_global.info.hse_omega = INPUT.exx_hse_omega;
Expand Down Expand Up @@ -406,6 +407,9 @@ void Input_Conv::Convert(void)
Exx_Abfs::Jle::Lmax = INPUT.exx_opt_orb_lmax;
Exx_Abfs::Jle::Ecut_exx = INPUT.exx_opt_orb_ecut;
Exx_Abfs::Jle::tolerence = INPUT.exx_opt_orb_tolerence;

//EXX does not support any symmetry analyse, force symmetry setting to -1
ModuleSymmetry::Symmetry::symm_flag = -1;
}
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion source/module_deepks/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target_link_libraries(
test_deepks
base cell symmetry md surchem xc_
neighbor orb io relax gint lcao parallel mrrr pdiag pw ri driver esolver hsolver psi elecstate hamilt planewave
pthread
pthread genelpa
deepks
${ABACUS_LINK_LIBRARIES}
)
Expand Down
4 changes: 3 additions & 1 deletion source/module_elecstate/elecstate_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ void ElecStateLCAO::print_psi(const psi::Psi<double>& psi_in)

// output but not do "2d-to-grid" conversion
double** wfc_grid = nullptr;
#ifdef __MPI
this->lowf->wfc_2d_to_grid(ElecStateLCAO::out_wfc_lcao, psi_in.get_pointer(), wfc_grid, this->ekb, this->wg);
#endif
return;
}
void ElecStateLCAO::print_psi(const psi::Psi<std::complex<double>>& psi_in)
Expand All @@ -159,7 +161,7 @@ void ElecStateLCAO::print_psi(const psi::Psi<std::complex<double>>& psi_in)
{
for (int iw = 0; iw < GlobalV::NLOCAL; iw++)
{
this->lowf->wfc_k_grid[ik][ib][iw] = psi(ib,iw);
this->lowf->wfc_k_grid[ik][ib][iw] = psi_in(ib, iw);
}
}
#endif
Expand Down
Loading

0 comments on commit b054731

Please sign in to comment.