Skip to content

Commit 48519f1

Browse files
committed
prepare for PR
2 parents 2e95214 + e8aca90 commit 48519f1

File tree

170 files changed

+978
-1790
lines changed

Some content is hidden

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

170 files changed

+978
-1790
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@
423423
- [pexsi\_zero\_thr](#pexsi_zero_thr)
424424
- [Linear Response TDDFT](#linear-response-tddft)
425425
- [xc\_kernel](#xc_kernel)
426+
- [lr\_init\_xc\_kernel](#lr_init_xc_kernel)
426427
- [lr\_solver](#lr_solver)
427428
- [lr\_thr](#lr_thr)
428429
- [nocc](#nocc)
@@ -3946,6 +3947,15 @@ These parameters are used to solve the excited states using. e.g. LR-TDDFT.
39463947
Currently supported: `RPA`, `LDA`, `PBE`, `HSE`, `HF`.
39473948
- **Default**: LDA
39483949

3950+
### lr_init_xc_kernel
3951+
3952+
- **Type**: String
3953+
- **Description**: The method to initalize the xc kernel.
3954+
- "default": Calculate xc kerenel ($f_\text{xc}$) from the ground-state charge density.
3955+
- "file": Read the xc kernel $f_\text{xc}$ on grid from the provided files. The following words should be the paths of ".cube" files, where the first 1 (*[nspin](#nspin)==1*) or 3 (*[nspin](#nspin)==2*, namely spin-aa, spin-ab and spin-bb) will be read in. The parameter [xc_kernel](#xc_kernel) will be invalid. Now only LDA-type kernel is supproted as the potential will be calculated by directly multiplying the transition density.
3956+
- "from_charge_file": Calculate fxc from the charge density read from the provided files. The following words should be the paths of ".cube" files, where the first [nspin]($nspin) files will be read in.
3957+
- **Default**: "default"
3958+
39493959
### lr_solver
39503960

39513961
- **Type**: String

examples/bsse/water/result.ref

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
-13.31798074740440
2-
E_H2O: -466.1225988776397
3-
E_O: -427.6271689751553
4-
E_H1: -12.58872469295076
5-
E_H2: -12.58872446212924
1+
-13.49968292248493
2+
E_H2O: -466.1225988772539
3+
E_O: -427.5222287307378
4+
E_H1: -12.55034372743879
5+
E_H2: -12.55034349659238

examples/scf/lcao_Cu/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ orbital_dir ../../../tests/PP_ORB
44
nbands 10
55

66
calculation scf
7-
ecutwfc 100
87
ecutwfc 100 ###Energy cutoff needs to be tested to ensure your calculation is reliable.[1]
98
scf_thr 1.0e-8
109
scf_nmax 100

source/Makefile.Objects

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ OBJS_ESOLVER=esolver.o\
247247
esolver_of.o\
248248
esolver_of_tool.o\
249249
esolver_of_interface.o\
250-
pw_init_after_vc.o\
251250
pw_init_globalc.o\
252251
pw_others.o\
253252

@@ -258,7 +257,6 @@ OBJS_ESOLVER_LCAO=esolver_ks_lcao.o\
258257
lcao_before_scf.o\
259258
esolver_gets.o\
260259
lcao_others.o\
261-
lcao_init_after_vc.o\
262260

263261
OBJS_GINT=gint.o\
264262
gint_gamma_env.o\
@@ -729,7 +727,7 @@ OBJS_TENSOR=tensor.o\
729727
dmr_complex.o\
730728
operator_lr_hxc.o\
731729
operator_lr_exx.o\
732-
kernel_xc.o\
730+
xc_kernel.o\
733731
pot_hxc_lrtd.o\
734732
lr_spectrum.o\
735733
hamilt_casida.o\

source/module_base/module_mixing/mixing_data.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Base_Mixing
44
{
55

6-
Mixing_Data::Mixing_Data(const int& ndim, const int& length, const size_t& type_size)
6+
Mixing_Data::Mixing_Data(const int& ndim, const std::size_t& length, const size_t& type_size)
77
{
88
this->ndim_tot = ndim;
99
this->length = length;
@@ -15,16 +15,18 @@ Mixing_Data::Mixing_Data(const int& ndim, const int& length, const size_t& type_
1515

1616
Mixing_Data::~Mixing_Data()
1717
{
18-
if (this->data != nullptr)
18+
if (this->data != nullptr) {
1919
free(this->data);
2020
}
21+
}
2122

22-
void Mixing_Data::resize(const int& ndim, const int& length, const size_t& type_size)
23+
void Mixing_Data::resize(const int& ndim, const std::size_t& length, const size_t& type_size)
2324
{
2425
this->ndim_tot = ndim;
2526
this->length = length;
26-
if (this->data != nullptr)
27+
if (this->data != nullptr) {
2728
free(this->data);
29+
}
2830
if (ndim * length > 0)
2931
{
3032
this->data = malloc(ndim * length * type_size);

source/module_base/module_mixing/mixing_data.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Mixing_Data
2222
* @param type_size size of type
2323
*
2424
*/
25-
Mixing_Data(const int& ndim, const int& length, const size_t& type_size);
25+
Mixing_Data(const int& ndim, const std::size_t& length, const size_t& type_size);
2626

2727
/**
2828
* @brief Destroy the Mixing_Data object
@@ -38,7 +38,7 @@ class Mixing_Data
3838
* @param type_size size of type
3939
*
4040
*/
41-
void resize(const int& ndim, const int& length, const size_t& type_size);
41+
void resize(const int& ndim, const std::size_t& length, const size_t& type_size);
4242

4343
/**
4444
* @brief push data to the tensor
@@ -54,7 +54,7 @@ class Mixing_Data
5454
#ifdef _OPENMP
5555
#pragma omp parallel for schedule(static, 4096/sizeof(FPTYPE))
5656
#endif
57-
for (int i = 0; i < length; ++i)
57+
for (std::size_t i = 0; i < length; ++i)
5858
{
5959
FP_startdata[i] = data_in[i];
6060
}
@@ -86,7 +86,7 @@ class Mixing_Data
8686
// the number of vectors for mixing
8787
int ndim_tot = 0;
8888
// the length of each vector
89-
int length = 0;
89+
std::size_t length = 0;
9090
// the start index for vector: start = this->index_move(0)
9191
int start = -1;
9292
// the number of used vectors for mixing

source/module_base/module_mixing/pulay_mixing.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ void Pulay_Mixing::tem_push_data(Mixing_Data& mdata,
2828
std::function<void(FPTYPE*, const FPTYPE*, const FPTYPE*)> mix,
2929
const bool& need_calcoef)
3030
{
31-
const size_t length = mdata.length;
31+
const std::size_t length = mdata.length;
3232
std::vector<FPTYPE> F_tmp(length);
3333

3434
#ifdef _OPENMP
3535
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
3636
#endif
37-
for (int i = 0; i < length; ++i)
37+
for (std::size_t i = 0; i < length; ++i)
3838
{
3939
F_tmp[i] = data_out[i] - data_in[i];
4040
}
@@ -69,7 +69,7 @@ void Pulay_Mixing::tem_push_data(Mixing_Data& mdata,
6969
#ifdef _OPENMP
7070
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
7171
#endif
72-
for (int i = 0; i < length; ++i)
72+
for (std::size_t i = 0; i < length; ++i)
7373
{
7474
FP_F[i] = F_tmp[i];
7575
}
@@ -81,7 +81,7 @@ void Pulay_Mixing::tem_push_data(Mixing_Data& mdata,
8181
#ifdef _OPENMP
8282
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
8383
#endif
84-
for (int i = 0; i < length; ++i)
84+
for (std::size_t i = 0; i < length; ++i)
8585
{
8686
FP_startF[i] = F_tmp[i];
8787
}
@@ -103,7 +103,7 @@ void Pulay_Mixing::tem_cal_coef(const Mixing_Data& mdata, std::function<double(F
103103
ModuleBase::WARNING_QUIT(
104104
"Pulay_mixing",
105105
"One Pulay_Mixing object can only bind one Mixing_Data object to calculate coefficients");
106-
const int length = mdata.length;
106+
const std::size_t length = mdata.length;
107107
FPTYPE* FP_F = static_cast<FPTYPE*>(F);
108108

109109
if (mdata.ndim_use > 1)

source/module_cell/module_neighbor/sltk_atom.h

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,31 @@ class FAtom
2020
int type;
2121
int natom;
2222

23+
int cell_x;
24+
int cell_y;
25+
int cell_z;
2326
public:
2427
//==========================================================
2528
// Default Constructor and deconstructor
2629
//==========================================================
2730

2831
FAtom();
32+
FAtom(const double& x_in, const double& y_in, const double& z_in,
33+
const int& type_in, const int& natom_in,
34+
const int& cell_x_in, const int& cell_y_in, const int& cell_z_in)
35+
{
36+
d_x = x_in;
37+
d_y = y_in;
38+
d_z = z_in;
39+
type = type_in;
40+
natom = natom_in;
41+
cell_x = cell_x_in;
42+
cell_y = cell_y_in;
43+
cell_z = cell_z_in;
44+
}
2945
~FAtom();
3046
//2015-05-07
31-
void delete_vector(void);
47+
void delete_vector();
3248

3349
// static int count1;
3450
// static int count2;
@@ -47,7 +63,7 @@ class FAtom
4763
std::shared_ptr<AdjacentSet> getAdjacentSet() const
4864
{ return this->as; }
4965

50-
void allocate_AdjacentSet(void)
66+
void allocate_AdjacentSet()
5167
{ this->as = std::make_shared<AdjacentSet>(); }
5268

5369
//==========================================================
@@ -59,16 +75,9 @@ class FAtom
5975
const double& z() const { return d_z; }
6076
const int& getType() const { return type;}
6177
const int& getNatom() const { return natom;}
62-
63-
//==========================================================
64-
// MEMBER FUNCTION :
65-
// EXPLAIN : set value
66-
//==========================================================
67-
void setX(const double& r) { d_x = r; }
68-
void setY(const double& r) { d_y = r; }
69-
void setZ(const double& r) { d_z = r; }
70-
void setType(const int ntype) {type = ntype;}
71-
void setNatom(const int atom) {natom = atom;}
78+
const int& getCellX() const { return cell_x; }
79+
const int& getCellY() const { return cell_y; }
80+
const int& getCellZ() const { return cell_z; }
7281
};
7382

7483
#endif

0 commit comments

Comments
 (0)