Skip to content

Commit 325fddc

Browse files
committed
Merge branch 'develop' of https://github.com/deepmodeling/abacus-develop into develop
2 parents cc1e82a + 4289cec commit 325fddc

File tree

177 files changed

+4552
-840
lines changed

Some content is hidden

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

177 files changed

+4552
-840
lines changed

docs/advanced/elec_properties/Mulliken.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Mulliken Charge Analysis
22

33
From version 2.1.0, ABACUS has the function of Mulliken population analysis. The example can be found in [examples/mulliken](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/mulliken). \
4-
To use this function, set [out_mul](./input-main.md#out_mul) to `1` in the INPUT file. After calculation, there will be an output file named `mulliken.txt` in the output directory. In MD calculations, the output interval is controlled by the keyword [out_interval](./input-main.md#out_interval). In the file, there are contents like (`nspin 1`):
4+
To use this function, set [out_mul](./input-main.md#out_mul) to `1` in the INPUT file. After calculation, there will be an output file named `mulliken.txt` in the output directory. In MD calculations, the output interval is controlled by the keyword [out_freq_ion](./input-main.md#out_freq_ion). In the file, there are contents like (`nspin 1`):
55

66
```
77
STEP: 0

docs/advanced/elec_properties/hs_matrix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The CSR format stores a sparse m × n matrix M in row form using three (one-dime
4545
- The arrays V and COL_INDEX are of length NNZ, and contain the non-zero values and the column indices of those values respectively.
4646
- The array ROW_INDEX is of length m + 1 and encodes the index in V and COL_INDEX where the given row starts. This is equivalent to ROW_INDEX[j] encoding the total number of nonzeros above row j. The last element is NNZ , i.e., the fictitious index in V immediately after the last valid index NNZ - 1.
4747

48-
For calculations involving ionic movements, the output frequency of the matrix is controlled by [out_interval](../input_files/input-main.md#out_interval) and [out_app_flag](../input_files/input-main.md#out_app_flag).
48+
For calculations involving ionic movements, the output frequency of the matrix is controlled by [out_freq_ion](../input_files/input-main.md#out_freq_ion) and [out_app_flag](../input_files/input-main.md#out_app_flag).
4949

5050
## get_s
5151
We also offer the option of only calculating the overlap matrix without running SCF. For that purpose, in `INPUT` file we need to set the value keyword [calculation](../input_files/input-main.md#calculation) to be `get_s`.

docs/advanced/elec_properties/position_matrix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Each file or each section of the appended file starts with "STEP: " followed by
1818

1919
Each block here contains the matrix for the corresponding cell. There are three columns in each block, giving the matrix elements in x, y, z directions, respectively. There are altogether nbasis * nbasis lines in each block, which emulates the matrix elements.
2020

21-
In molecular dynamics (MD) calculations, if [out_app_flag](../input_files/input-main.md#out_app_flag) is set to true, then `data-rR-tr` is written in an append manner. Otherwise, output files will be put in a separate directory, `matrix`, and named as `$x`_data-rR-tr, where `$x` is the number of MD step. In addition, the output frequency is controlled by [out_interval](../input_files/input-main.md#out_interval). For example, if we are running a 10-step MD with out_interval = 3, then `$x` will be 0, 3, 6, and 9.
21+
In molecular dynamics (MD) calculations, if [out_app_flag](../input_files/input-main.md#out_app_flag) is set to true, then `data-rR-tr` is written in an append manner. Otherwise, output files will be put in a separate directory, `matrix`, and named as `$x`_data-rR-tr, where `$x` is the number of MD step. In addition, the output frequency is controlled by [out_freq_ion](../input_files/input-main.md#out_freq_ion). For example, if we are running a 10-step MD with out_freq_ion = 3, then `$x` will be 0, 3, 6, and 9.
2222

2323
## get_s
2424
We also offer the option of only calculating the position matrix without running SCF. For that purpose, in `INPUT` file we need to set the keyword [calculation](../input_files/input-main.md#calculation) to `get_s`, and [out_mat_r](../input_files/input-main.md#out_mat_r) to `true`.

docs/advanced/input_files/input-main.md

Lines changed: 163 additions & 134 deletions
Large diffs are not rendered by default.

examples/relax/pw_output/INPUT

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ecutwfc 10
88
scf_nmax 20
99

1010
basis_type pw
11-
relax_nmax 5
11+
relax_nmax 4
1212

1313
cal_stress 1
1414
stress_thr 1e-6
@@ -25,18 +25,23 @@ relax_method lbfgs
2525
pseudo_dir ../../../tests/PP_ORB
2626
orbital_dir ../../../tests/PP_ORB
2727

28-
nspin 2
28+
nspin 4
29+
30+
out_freq_ion 1
31+
#out_freq_elec 0
32+
33+
out_chg 1 # chg.txt g
34+
out_pot 1 # pot.txt g
35+
out_wfc_pw 1 # wfkx_pw.txt g
36+
out_dos 1 # dos.txt g
37+
out_elf 1 # elf.txt
38+
out_band 1 # eig.txt
39+
out_stru 1 # g
40+
out_bandgap 1
2941

30-
out_chg 1
31-
out_pot 1
32-
out_wfc_pw 1
33-
out_dos 1
34-
out_stru 1
3542
out_app_flag 0
3643

37-
out_interval 1
38-
kpar 2
44+
kpar 1
3945
symmetry -1
4046

41-
#out_freq_elec 2
42-
#out_band 1
47+

examples/relax/pw_output/KPT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ K_POINTS
22
0
33
Gamma
44
2 2 2 0 0 0
5+

source/Makefile.Objects

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ OBJS_CELL=atom_pseudo.o\
202202
bcast_cell.o\
203203
read_stru.o\
204204
read_atom_species.o\
205+
sep.o\
206+
sep_cell.o\
205207

206208
OBJS_DEEPKS=LCAO_deepks.o\
207209
deepks_basic.o\
@@ -220,7 +222,7 @@ OBJS_DEEPKS=LCAO_deepks.o\
220222
deepks_phialpha.o\
221223
LCAO_deepks_io.o\
222224
LCAO_deepks_interface.o\
223-
225+
224226

225227
OBJS_ELECSTAT=elecstate.o\
226228
elecstate_energy_terms.o\
@@ -246,6 +248,7 @@ OBJS_ELECSTAT=elecstate.o\
246248
cal_nelec_nband.o\
247249
read_pseudo.o\
248250
cal_wfc.o\
251+
pot_sep.o\
249252

250253
OBJS_ELECSTAT_LCAO=elecstate_lcao.o\
251254
elecstate_lcao_cal_tau.o\
@@ -398,7 +401,7 @@ OBJS_HSOLVER=diago_cg.o\
398401
diag_const_nums.o\
399402
diag_hs_para.o\
400403
diago_pxxxgvx.o\
401-
404+
402405
OBJS_HSOLVER_LCAO=hsolver_lcao.o\
403406
diago_scalapack.o\
404407
diago_lapack.o\
@@ -416,7 +419,7 @@ OBJS_HSOLVER_PEXSI=diago_pexsi.o\
416419
dist_bcd_matrix.o\
417420
dist_ccs_matrix.o\
418421
dist_matrix_transformer.o\
419-
422+
420423
OBJS_MD=fire.o\
421424
langevin.o\
422425
md_base.o\
@@ -491,7 +494,7 @@ OBJS_RELAXATION=bfgs_basic.o\
491494
lbfgs.o\
492495
matrix_methods.o\
493496
line_search.o\
494-
497+
495498

496499
OBJS_SURCHEM=surchem.o\
497500
H_correction_pw.o\
@@ -691,7 +694,7 @@ OBJS_PARALLEL=parallel_common.o\
691694
parallel_kpoints.o\
692695
parallel_reduce.o\
693696
parallel_device.o
694-
697+
695698
OBJS_SRCPW=H_Ewald_pw.o\
696699
dnrm2.o\
697700
VL_in_pw.o\
@@ -755,7 +758,8 @@ OBJS_SRCPW=H_Ewald_pw.o\
755758
sto_elecond.o\
756759
sto_dos.o\
757760
onsite_projector.o\
758-
onsite_proj_tools.o
761+
onsite_proj_tools.o\
762+
VSep_in_pw.o
759763

760764
OBJS_VDW=vdw.o\
761765
vdwd2_parameters.o\

source/source_cell/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ add_library(
2626
print_cell.cpp
2727
read_atom_species.cpp
2828
k_vector_utils.cpp
29+
sep.cpp
30+
sep_cell.cpp
2931
)
3032

3133
if(ENABLE_COVERAGE)

source/source_cell/module_symmetry/test/symmetry_test_analysis.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
* 1-1. test if the bravis lattice analysis is right;
77
* 1-2. check if matrix-type and vector3-type;
88
* input and optimized lattice vectors are right;
9-
* 1-3. double-check for if `gtrans_convert`
9+
* 1-3. double-check for if `gtrans_convert`
1010
* gives the same results as `veccon`;
1111
* 1-4. check `invmap` function gives the right result;
1212
* 1-5 test if `gmatrix_convert` and `gmatrix_convert_int`
1313
* gives the right result;
1414
* 2. function: `atom_ordering_new:
1515
* test the new atom-sort algorithm gives the right result;
1616
*3. function: `pricell`:
17-
* test if the number of primitive cells are right,
17+
* test if the number of primitive cells are right,
1818
* using cases whose space group
1919
* is different from its point group.
2020
***********************************************/
@@ -34,6 +34,10 @@ UnitCell::UnitCell(){}
3434
UnitCell::~UnitCell(){}
3535
Magnetism::Magnetism(){}
3636
Magnetism::~Magnetism() {}
37+
SepPot::SepPot(){}
38+
SepPot::~SepPot(){}
39+
Sep_Cell::Sep_Cell() noexcept {}
40+
Sep_Cell::~Sep_Cell() noexcept {}
3741

3842
TEST_F(SymmetryTest, AnalySys)
3943
{
@@ -50,8 +54,8 @@ TEST_F(SymmetryTest, AnalySys)
5054
int cal_ibrav = symm.real_brav;
5155
EXPECT_EQ(cal_ibrav, ref_ibrav);
5256
EXPECT_EQ(cal_point_group, ref_point_group) << "ibrav=" << stru_lib[stru].ibrav;
53-
54-
//2. input and optimized lattice, gtrans_convert and veccon
57+
58+
//2. input and optimized lattice, gtrans_convert and veccon
5559
//input lattice
5660
EXPECT_EQ(symm.s1, ucell.a1);
5761
EXPECT_EQ(symm.s2, ucell.a2);
@@ -73,7 +77,7 @@ TEST_F(SymmetryTest, AnalySys)
7377
symm.gtrans_convert(symm.gtrans, gtrans_optconf.data(), symm.nrotk, ucell.latvec, symm.optlat);
7478
symm.veccon(gtrans_veccon, gtrans_optconf_veccon, symm.nrotk, symm.s1, symm.s2, symm.s3, symm.a1, symm.a2, symm.a3);
7579
for(int i=0;i<symm.nrotk;++i)
76-
EXPECT_EQ(gtrans_optconf[i], ModuleBase::Vector3<double>(gtrans_optconf_veccon[i*3],
80+
EXPECT_EQ(gtrans_optconf[i], ModuleBase::Vector3<double>(gtrans_optconf_veccon[i*3],
7781
gtrans_optconf_veccon[i*3+1], gtrans_optconf_veccon[i*3+2]));
7882
delete[] gtrans_veccon;
7983
delete[] gtrans_optconf_veccon;
@@ -108,7 +112,7 @@ TEST_F(SymmetryTest, AnalySys)
108112
symm.gmatrix_convert_int(symm.gmatrix, gmatrix_opt, symm.nrotk, ucell.latvec, symm.optlat); //1->2
109113
symm.gmatrix_convert_int(gmatrix_opt, gmatrix_input_back, symm.nrotk, symm.optlat, ucell.latvec); //2->3
110114
symm.gmatrix_convert_int(gmatrix_input_back, gmatrix_opt_back, symm.nrotk, ucell.latvec, symm.optlat); //3->4
111-
115+
112116
symm.gmatrix_convert(symm.gmatrix, kgmatrix_nonint, symm.nrotk, ucell.latvec, ucell.G);
113117
for (int i=0;i<symm.nrotk;++i)
114118
{
@@ -130,7 +134,7 @@ TEST_F(SymmetryTest, AnalySys)
130134
EXPECT_NEAR(gmatrix_opt[i].e31, gmatrix_opt_back[i].e31, DOUBLETHRESHOLD);
131135
EXPECT_NEAR(gmatrix_opt[i].e23, gmatrix_opt_back[i].e23, DOUBLETHRESHOLD);
132136
EXPECT_NEAR(gmatrix_opt[i].e32, gmatrix_opt_back[i].e32, DOUBLETHRESHOLD);
133-
137+
134138
ModuleBase::Matrix3 tmpA=symm.optlat.Inverse()*gmatrix_opt[i]*symm.optlat; //A^-1*SA*A
135139
ModuleBase::Matrix3 tmpB=ucell.latvec.Inverse()*symm.gmatrix[i]*ucell.latvec;//B^-1*SB*B
136140
ModuleBase::Matrix3 tmpG_int=ucell.G.Inverse()*symm.kgmatrix[i]*ucell.G;//G^-1*SG*G
@@ -168,7 +172,7 @@ TEST_F(SymmetryTest, AnalySys)
168172
EXPECT_NEAR(tmpA.e23, tmpG.e23, DOUBLETHRESHOLD);
169173
EXPECT_NEAR(tmpA.e32, tmpG.e32, DOUBLETHRESHOLD);
170174
}
171-
175+
172176
delete[] gmatrix_input_back;
173177
delete[] gmatrix_opt;
174178
delete[] gmatrix_opt_back;
@@ -180,7 +184,7 @@ TEST_F(SymmetryTest, AnalySys)
180184

181185
TEST_F(SymmetryTest, AtomOrderingNew)
182186
{
183-
// the old function `atom_ordering` has bugs
187+
// the old function `atom_ordering` has bugs
184188
// so here I do not compare with its results
185189
ModuleSymmetry::Symmetry symm;
186190
symm.epsilon=1e-5;
@@ -199,7 +203,7 @@ TEST_F(SymmetryTest, AtomOrderingNew)
199203
}
200204
//ordering
201205
symm.test_atom_ordering(new_pos, nat, subindex);
202-
//check
206+
//check
203207
for (int i=0;i<nat-1;++i)
204208
{
205209
//x[i]<=x[i+1]
@@ -250,7 +254,7 @@ TEST_F(SymmetryTest, SG_Pricell)
250254
std::string cal_point_group = symm.pgname;
251255
std::string ref_space_group = supercell_lib[stru].space_group;
252256
std::string cal_space_group = symm.spgname;
253-
257+
254258
int ref_ncells = supercell_lib[stru].ibrav;
255259
EXPECT_EQ(symm.ncell, ref_ncells);
256260
EXPECT_EQ(cal_point_group, ref_point_group);

source/source_cell/module_symmetry/test/symmetry_test_symtrz.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ UnitCell::UnitCell() {}
1919
UnitCell::~UnitCell() {}
2020
Magnetism::Magnetism() {}
2121
Magnetism::~Magnetism() {}
22+
SepPot::SepPot(){}
23+
SepPot::~SepPot(){}
24+
Sep_Cell::Sep_Cell() noexcept {}
25+
Sep_Cell::~Sep_Cell() noexcept {}
2226

2327
inline std::vector<double> allocate_pos(ModuleSymmetry::Symmetry& symm, UnitCell& ucell)
2428
{
@@ -46,7 +50,7 @@ TEST_F(SymmetryTest, ForceSymmetry)
4650
{
4751
auto check_force = [](stru_& conf, ModuleBase::matrix& force)
4852
{
49-
// 1. check zeros
53+
// 1. check zeros
5054
for (auto iat : conf.force_zero_iat)
5155
for (int j = 0; j < 3; ++j)
5256
EXPECT_NEAR(force(iat, j), 0.0, DOUBLETHRESHOLD);

0 commit comments

Comments
 (0)