Skip to content

Commit 4cf918e

Browse files
author
Kai Luo
committed
Refactor ESolver classes: Remove old LCAO solver and implement new RDMFT LCAO solver
- Deleted the obsolete ESolver_DirectMin_LCAO class and its header file. - Introduced the ESolver_RDMFT_LCAO class with comprehensive methods for RDMFT optimization. - Implemented initialization, problem setup, solver configuration, and hybrid optimization methods. - Added support for orbital and occupation optimization with respective solvers. - Enhanced convergence checking and iteration information logging. - Updated includes and namespaces for proper compilation and functionality.
1 parent 6b35f0e commit 4cf918e

File tree

5 files changed

+432
-424
lines changed

5 files changed

+432
-424
lines changed

source/source_esolver/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ list(APPEND objects
44
esolver_fp.cpp
55
esolver_ks_pw.cpp
66
esolver_ks_lcaopw.cpp
7-
esolver_directmin.cpp #kluo added 2025-10-16
8-
# esolver_directmin_rdmft.cpp #kluo added 2025-10-16
97
# esolver_rdmft_pw.cpp #kluo added 2025-05-06
108
esolver_sdft_pw.cpp
119
esolver_lj.cpp
@@ -20,13 +18,13 @@ if(ENABLE_LCAO)
2018
list(APPEND objects
2119
esolver_ks_lcao.cpp
2220
esolver_ks_lcao_tddft.cpp
23-
esolver_directmin_lcao.cpp #kluo added 2025-05-06
2421
lcao_before_scf.cpp
2522
lcao_after_scf.cpp
2623
esolver_gets.cpp
2724
lcao_others.cpp
2825
esolver_dm2rho.cpp
2926

27+
esolver_rdmft_lcao.cpp #kluo added 2025-05-06
3028
directmin_problems/test.cpp
3129
directmin_problems/rdmft_lcao.cpp #kluo added 2025-10-16
3230
# directmin_problems/rdmft_tools.cpp #kluo added 2025-10-16

source/source_esolver/esolver.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C"
2323

2424
#include <stdexcept>
2525

26-
#include "esolver_directmin_lcao.h" // kluo added 2025-05-06
26+
#include "esolver_rdmft_lcao.h" // kluo added 2025-05-06
2727
// #include "esolver_rdmft_pw.h" // kluo added 2025-05-06
2828

2929
namespace ModuleESolver
@@ -251,25 +251,15 @@ ESolver* init_esolver(const Input_para& inp, UnitCell& ucell)
251251
{
252252
if (PARAM.globalv.gamma_only_local)
253253
{
254-
return new ESolver_DirectMin_LCAO(); // will add type later
254+
return new ESolver_RDMFT_LCAO<double, double>(); // will add type later
255255
}
256256
else
257257
{
258-
return new ESolver_DirectMin_LCAO();
258+
return new ESolver_RDMFT_LCAO<std::complex<double>, double>();
259259
}
260260
}
261261

262-
// else if (esolver_type == "rdmft_lcao") // kluo added 2025-05-06
263-
// {
264-
// if (PARAM.globalv.gamma_only_local)
265-
// {
266-
// return new ESolver_DirectMin<double, double>();
267-
// }
268-
// else
269-
// {
270-
// return new ESolver_DirectMin<std::complex<double>, double>();
271-
// }
272-
// }
262+
273263
else if (esolver_type == "ksdft_lcao_tddft")
274264
{
275265
if (PARAM.inp.nspin < 4)

source/source_esolver/esolver_directmin_lcao_old.h

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

0 commit comments

Comments
 (0)