Refactor the relax module#7456
Open
mohanchen wants to merge 24 commits into
Open
Conversation
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-> 前缀,提高代码可读性
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor the relax module