Skip to content

Commit a304e36

Browse files
authored
Merge branch 'develop' into fft6
2 parents eee8c7b + 9cc044e commit a304e36

Some content is hidden

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

45 files changed

+394
-639
lines changed

source/Makefile.Objects

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,10 @@ OBJS_ESOLVER=esolver.o\
245245
esolver_of.o\
246246
esolver_of_tool.o\
247247
esolver_of_interface.o\
248-
pw_init_globalc.o\
249248
pw_others.o\
250249

251250
OBJS_ESOLVER_LCAO=esolver_ks_lcao.o\
252251
esolver_ks_lcao_tddft.o\
253-
dpks_cal_e_delta_band.o\
254252
lcao_before_scf.o\
255253
esolver_gets.o\
256254
lcao_others.o\
@@ -668,7 +666,7 @@ OBJS_SRCPW=H_Ewald_pw.o\
668666
symmetry_rhog.o\
669667
wavefunc.o\
670668
wf_atomic.o\
671-
wfinit.o\
669+
psiinit.o\
672670
elecond.o\
673671
sto_tool.o\
674672
sto_elecond.o\

source/module_base/vector3.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ template <class T> class Vector3
3636
Vector3(const Vector3<T> &v) : x(v.x), y(v.y), z(v.z){}; // Peize Lin add 2018-07-16
3737
explicit Vector3(const std::array<T,3> &v) :x(v[0]), y(v[1]), z(v[2]){}
3838

39+
template <typename U>
40+
explicit Vector3(const Vector3<U>& other) : x(static_cast<T>(other.x)), y(static_cast<T>(other.y)), z(static_cast<T>(other.z)) {}
41+
3942
Vector3(Vector3<T> &&v) noexcept : x(v.x), y(v.y), z(v.z) {}
4043

4144
/**

source/module_cell/read_pp.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,4 +478,13 @@ void Pseudopot_upf::setqfnew(const int& nqf,
478478
}
479479
rho[ir] *= pow(r[ir], l + n);
480480
}
481+
}
482+
483+
void Pseudopot_upf::skip_number(std::ifstream& ifs, bool mesh_changed)
484+
{
485+
if (mesh_changed)
486+
{
487+
double temp = 0.;
488+
ifs >> temp;
489+
}
481490
}

source/module_cell/read_pp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class Pseudopot_upf
7373

7474
private:
7575
bool mesh_changed = false; // if the mesh is even, it will be changed to odd
76+
void skip_number(std::ifstream& ifs, bool mesh_changed); // skip the last number if the mesh is even
7677

7778
int set_pseudo_type(const std::string& fn, std::string& type);
7879
std::string& trim(std::string& in_str);

source/module_cell/read_pp_upf100.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ void Pseudopot_upf::read_pseudo_mesh(std::ifstream &ifs, Atom_pseudo& pp)
236236
{
237237
ifs >> pp.r[ir];
238238
}
239+
this->skip_number(ifs, this->mesh_changed);
239240
ModuleBase::GlobalFunc::SCAN_END(ifs, "</PP_R>");
240241
}
241242

@@ -245,6 +246,7 @@ void Pseudopot_upf::read_pseudo_mesh(std::ifstream &ifs, Atom_pseudo& pp)
245246
{
246247
ifs >> pp.rab[ir];
247248
}
249+
this->skip_number(ifs, this->mesh_changed);
248250
ModuleBase::GlobalFunc::SCAN_END(ifs, "</PP_RAB>");
249251
}
250252
return;
@@ -258,6 +260,7 @@ void Pseudopot_upf::read_pseudo_nlcc(std::ifstream &ifs, Atom_pseudo& pp)
258260
{
259261
ifs >> pp.rho_atc[ir];
260262
}
263+
this->skip_number(ifs, this->mesh_changed);
261264
return;
262265
}
263266

@@ -270,7 +273,7 @@ void Pseudopot_upf::read_pseudo_local(std::ifstream &ifs, Atom_pseudo& pp)
270273
{
271274
ifs >> pp.vloc_at[ir];
272275
}
273-
276+
this->skip_number(ifs, this->mesh_changed);
274277
return;
275278
}
276279

@@ -406,6 +409,7 @@ void Pseudopot_upf::read_pseudo_nl(std::ifstream &ifs, Atom_pseudo& pp)
406409
ifs >> qfunc(nmb, ir);
407410
}
408411
}
412+
this->skip_number(ifs, this->mesh_changed);
409413

410414
if (this->nqf > 0)
411415
{
@@ -445,11 +449,7 @@ void Pseudopot_upf::read_pseudo_pswfc(std::ifstream &ifs, Atom_pseudo& pp)
445449
{
446450
ifs >> pp.chi(i, ir);
447451
}
448-
if (this->mesh_changed)
449-
{
450-
double temp = 0.0;
451-
ifs >> temp;
452-
}
452+
this->skip_number(ifs, this->mesh_changed);
453453
}
454454
return;
455455
}
@@ -461,6 +461,7 @@ void Pseudopot_upf::read_pseudo_rhoatom(std::ifstream &ifs, Atom_pseudo& pp)
461461
{
462462
ifs >> pp.rho_at[ir];
463463
}
464+
this->skip_number(ifs, this->mesh_changed);
464465
return;
465466
}
466467

source/module_cell/read_pp_upf201.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ int Pseudopot_upf::read_pseudo_upf201(std::ifstream &ifs, Atom_pseudo& pp)
3232
{
3333
ifs >> pp.rho_atc[ir];
3434
}
35+
this->skip_number(ifs, this->mesh_changed);
3536
ModuleBase::GlobalFunc::SCAN_END(ifs, "</PP_NLCC>");
3637
}
3738

@@ -53,6 +54,7 @@ int Pseudopot_upf::read_pseudo_upf201(std::ifstream &ifs, Atom_pseudo& pp)
5354
{
5455
ifs >> pp.vloc_at[ir];
5556
}
57+
this->skip_number(ifs, this->mesh_changed);
5658
ModuleBase::GlobalFunc::SCAN_END(ifs, "</PP_LOCAL>");
5759
}
5860

@@ -90,6 +92,7 @@ int Pseudopot_upf::read_pseudo_upf201(std::ifstream &ifs, Atom_pseudo& pp)
9092
{
9193
ifs >> pp.rho_at[ir];
9294
}
95+
this->skip_number(ifs, this->mesh_changed);
9396
ModuleBase::GlobalFunc::SCAN_END(ifs, "</PP_RHOATOM>");
9497

9598
//--------------------------------------
@@ -406,6 +409,7 @@ void Pseudopot_upf::read_pseudo_upf201_mesh(std::ifstream& ifs, Atom_pseudo& pp)
406409
{
407410
ifs >> pp.r[ir];
408411
}
412+
this->skip_number(ifs, this->mesh_changed);
409413
ModuleBase::GlobalFunc::SCAN_END(ifs, "</PP_R>");
410414

411415
if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_RAB", true, false))
@@ -420,6 +424,7 @@ void Pseudopot_upf::read_pseudo_upf201_mesh(std::ifstream& ifs, Atom_pseudo& pp)
420424
{
421425
ifs >> pp.rab[ir];
422426
}
427+
this->skip_number(ifs, this->mesh_changed);
423428
ModuleBase::GlobalFunc::SCAN_END(ifs, "</PP_RAB>");
424429
ModuleBase::GlobalFunc::SCAN_END(ifs, "</PP_MESH>");
425430
}
@@ -497,6 +502,7 @@ void Pseudopot_upf::read_pseudo_upf201_nonlocal(std::ifstream& ifs, Atom_pseudo&
497502
{
498503
ifs >> pp.betar(ib, ir);
499504
}
505+
this->skip_number(ifs, this->mesh_changed);
500506
word = "</PP_BETA." + std::to_string(ib + 1) + ">";
501507
ModuleBase::GlobalFunc::SCAN_END(ifs, word);
502508
}
@@ -639,6 +645,7 @@ void Pseudopot_upf::read_pseudo_upf201_nonlocal(std::ifstream& ifs, Atom_pseudo&
639645
{
640646
ifs >> pp.qfuncl(l, nmb, ir);
641647
}
648+
this->skip_number(ifs, this->mesh_changed);
642649
word = "</PP_QIJL." + std::to_string(nb + 1) + "." + std::to_string(mb + 1) + "."
643650
+ std::to_string(l) + ">";
644651
ModuleBase::GlobalFunc::SCAN_END(ifs, word);
@@ -653,6 +660,7 @@ void Pseudopot_upf::read_pseudo_upf201_nonlocal(std::ifstream& ifs, Atom_pseudo&
653660
{
654661
ifs >> this->qfunc(nmb, ir);
655662
}
663+
this->skip_number(ifs, this->mesh_changed);
656664
word = "</PP_QIJ." + std::to_string(nb + 1) + "." + std::to_string(mb + 1) + ">";
657665
ModuleBase::GlobalFunc::SCAN_END(ifs, word);
658666
}
@@ -757,6 +765,7 @@ void Pseudopot_upf::read_pseudo_upf201_pswfc(std::ifstream& ifs, Atom_pseudo& pp
757765
{
758766
assert(pp.chi.c[iw * pp.mesh + ir] == pp.chi(iw, ir));
759767
}
768+
this->skip_number(ifs, this->mesh_changed);
760769
word = "</PP_CHI." + std::to_string(iw + 1) + ">";
761770
ModuleBase::GlobalFunc::SCAN_END(ifs, word);
762771
}

source/module_esolver/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ list(APPEND objects
1010
esolver_of.cpp
1111
esolver_of_interface.cpp
1212
esolver_of_tool.cpp
13-
pw_init_globalc.cpp
1413
pw_others.cpp
1514
)
1615
if(ENABLE_LCAO)
1716
list(APPEND objects
1817
esolver_ks_lcao.cpp
1918
esolver_ks_lcao_tddft.cpp
20-
dpks_cal_e_delta_band.cpp
2119
lcao_before_scf.cpp
2220
esolver_gets.cpp
2321
lcao_others.cpp

source/module_esolver/dpks_cal_e_delta_band.cpp

Lines changed: 0 additions & 69 deletions
This file was deleted.

source/module_esolver/esolver_ks.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ ESolver_KS<T, Device>::ESolver_KS()
6767
///----------------------------------------------------------
6868
p_chgmix = new Charge_Mixing();
6969
p_chgmix->set_rhopw(this->pw_rho, this->pw_rhod);
70-
71-
///----------------------------------------------------------
72-
/// wavefunc
73-
///----------------------------------------------------------
74-
this->wf.init_wfc = PARAM.inp.init_wfc;
75-
this->wf.mem_saver = PARAM.inp.mem_saver;
76-
this->wf.out_wfc_pw = PARAM.inp.out_wfc_pw;
77-
this->wf.out_wfc_r = PARAM.inp.out_wfc_r;
7870
}
7971

8072
//------------------------------------------------------------------------------

source/module_esolver/esolver_ks.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ class ESolver_KS : public ESolver_FP
6565
//! Charge mixing method, only used in KDSFT, not in OFDFT
6666
Charge_Mixing* p_chgmix = nullptr;
6767

68-
//! wave functions, this one may be deleted in near future
69-
//! mohan note 2024-11-14
70-
wavefunc wf;
71-
7268
//! Electronic wavefunctions
7369
psi::Psi<T>* psi = nullptr;
7470

0 commit comments

Comments
 (0)