Skip to content

Commit e1756e2

Browse files
author
Kai Luo
committed
Refactor ESolver_DirectMin_LCAO: Remove unused methods and clean up commented-out code
1 parent b28d5bf commit e1756e2

File tree

2 files changed

+2
-61
lines changed

2 files changed

+2
-61
lines changed

source/source_esolver/esolver_directmin_lcao.cpp

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void ESolver_DirectMin_LCAO::runner(UnitCell& ucell, const int istep)
212212
// Route 2: Joint optimization on product manifold
213213
std::cout << "Using joint optimization (Route 1)" << std::endl;
214214
this->solver->Run();
215-
215+
216216
} else if (this->rdmft_loop_layer_ == 2) {
217217
// Route 1: Hybrid two-level optimization
218218
std::cout << "Using hybrid two-level optimization (Route 2)" << std::endl;
@@ -287,10 +287,6 @@ void ESolver_DirectMin_LCAO::initialize(UnitCell& ucell, const Input_para& inp)
287287
}
288288

289289

290-
void ESolver_DirectMin_LCAO::setup_pw_basis(UnitCell& ucell, const Input_para& inp)
291-
{
292-
// Implementation of setup_pw_basis
293-
}
294290

295291

296292
// template <typename TK, typename TR>
@@ -332,15 +328,6 @@ void ESolver_DirectMin_LCAO::setup_problem(UnitCell& ucell, const Input_para& in
332328
ModuleBase::WARNING_QUIT("ESolver_DirectMin_LCAO", "Only LCAO basis is supported for RDMFT in DirectMin");
333329
}
334330

335-
// // check optimization route
336-
// if(inp.rdmftp.rdmft_loop_layer == 1)
337-
// {
338-
// this->setup_joint_optimization(ucell, inp);
339-
// }
340-
// else if(inp.rdmftp.rdmft_loop_layer == 2)
341-
// {
342-
// this->setup_hybrid_optimization(ucell, inp);
343-
// }
344331
}
345332
else
346333
{
@@ -631,47 +618,6 @@ void ESolver_DirectMin_LCAO::optimize_occupations_fixed_orbitals()
631618
std::cout << "[DirectMin] Running occupation solver (stub)." << std::endl;
632619
}
633620

634-
// void ESolver_DirectMin_LCAO::setup_joint_optimization(UnitCell& ucell, const Input_para& inp)
635-
// {
636-
// ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "setup_joint_optimization", "Stub implementation");
637-
638-
// if (inp.directmin_objective == "test")
639-
// {
640-
// this->prob = new TEST(ucell, inp);
641-
// }
642-
// else
643-
// {
644-
// this->prob = new RDMFT_LCAO
645-
// // std::cout << "[DirectMin] RDMFT joint optimization problem setup is not implemented yet." << std::endl;
646-
// // this->prob = nullptr;
647-
// }
648-
649-
// if (this->prob != nullptr)
650-
// {
651-
// Manifold* space = this->prob->GetDomain();
652-
// if (space != nullptr)
653-
// {
654-
// this->X = space->RandominManifold();
655-
// }
656-
// }
657-
// }
658-
659-
// void ESolver_DirectMin_LCAO::run_joint_optimization(UnitCell& /*ucell*/)
660-
// {
661-
// ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "run_joint_optimization", "Stub implementation");
662-
663-
// if (this->solver == nullptr)
664-
// {
665-
// std::cout << "[DirectMin] Joint optimization solver not initialized." << std::endl;
666-
// return;
667-
// }
668-
669-
// std::cout << "[DirectMin] Running joint solver." << std::endl;
670-
671-
// this->solver->Run();
672-
673-
// std::cout << "[DirectMin] Joint optimization complete." << std::endl;
674-
// }
675621

676622
// Add missing utility methods
677623
void ESolver_DirectMin_LCAO::print_iteration_info(int iter, double energy, double grad_norm) const

source/source_esolver/esolver_directmin_lcao.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ class ESolver_DirectMin_LCAO : public ESolver_DirectMin
8282

8383
// Main initialization and setup functions
8484
void initialize(UnitCell& ucell, const Input_para& inp);
85-
void setup_lcao_basis(UnitCell& ucell, const Input_para& inp);
86-
void setup_pw_basis(UnitCell& ucell, const Input_para& inp);
85+
8786
void setup_problem(UnitCell& ucell, const Input_para& inp);
8887
void setup_solver(UnitCell& ucell, const Input_para& inp);
8988
void setup_params(UnitCell& ucell, const Input_para& inp);
@@ -98,10 +97,6 @@ class ESolver_DirectMin_LCAO : public ESolver_DirectMin
9897
void optimize_orbitals_fixed_occupations();
9998
void optimize_occupations_fixed_orbitals();
10099

101-
// Route 2: Joint optimization functions
102-
// void setup_joint_optimization(UnitCell& ucell, const Input_para& inp);
103-
// void setup_multimanifold_problem(UnitCell& ucell, const Input_para& inp);
104-
// void run_joint_optimization(UnitCell& ucell);
105100

106101
// Convergence checking
107102
bool check_convergence() const;

0 commit comments

Comments
 (0)