Skip to content

Refactor the relax module#7456

Open
mohanchen wants to merge 24 commits into
deepmodeling:developfrom
mohanchen:20260608-relax
Open

Refactor the relax module#7456
mohanchen wants to merge 24 commits into
deepmodeling:developfrom
mohanchen:20260608-relax

Conversation

@mohanchen

Copy link
Copy Markdown
Collaborator

Refactor the relax module

@mohanchen mohanchen requested a review from 19hello June 8, 2026 13:55
@mohanchen mohanchen added the Refactor Refactor ABACUS codes label Jun 8, 2026
abacus_fixer added 17 commits June 9, 2026 13:48
主要修改:
1. 移除了 relax_driver.h 中未使用的 Ions_Move_BFGS2 bfgs_trad 成员变量及其头文件包含
2. 将 relax_driver.cpp 中 while 循环内的逻辑拆分为多个独立函数:
   - init_relax(): 初始化弛豫方法
   - iter_info(): 打印迭代信息
   - esolve(): 电子结构计算
   - relax_step(): 执行单次弛豫步骤
   - stru_out(): 输出结构文件
   - json_out(): 输出 JSON 结果
   - stop_cond(): 检查停止条件
   - final_out(): 最终输出

3. 添加了成员变量用于缓存计算结果:force_, stress_, force_step, stress_step
4. 优化了 final_out() 函数,将重复的条件判断合并为早期返回
5. 所有成员变量和成员函数调用都添加了 this-> 前缀,提高代码可读性
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant