refactor(nmNum): 清理 LM 冗余代码与 Swi 拟合残留

- 删除无效分支和重复计算,统一中文注释。

- 移除 Swi 参数占位,同步参数索引与拟合记录。
feature/AutoFit-Optimize-20260914
lvjunjie 2 weeks ago
parent b501816f6b
commit 61fc42af7b

@ -13,7 +13,7 @@
#include "nmCalculation_global.h"
// 双对数曲线误差分解。预调整使用纵向偏差,形状阶段使用双曲线斜率残差,
// 整体阶段只使用 total 接受候选;两个 LM 目标均联合调整有效参数。
// 总误差部分只使用 total 接受候选;两个 LM 目标均联合调整有效参数。
struct AutoFitObjectiveBreakdownLM {
bool valid;
double total;
@ -61,7 +61,6 @@ struct AutoFitObjectiveBreakdownLM {
enum StopReasonLM {
LM_CONTINUE_OPTIMIZATION = 0,
LM_TARGET_ACHIEVED = 1,
LM_TRUE_CONVERGENCE = 2,
LM_LOCAL_OPTIMUM = 3,
LM_MAX_ITERATIONS = 4,
LM_USER_STOPPED = 5,
@ -100,7 +99,7 @@ signals:
QVector<QVector<double> > bestData,
int iteration,
double fitness);
/** @brief 优化迭代结束,开始用当前最优参数生成正式结果。 */
// 优化迭代结束,开始用当前最优参数生成正式结果。
void finalizingStarted();
void logMessageGenerated(const QString& message);
@ -130,10 +129,8 @@ private:
void updateReservoirParameters(const QVector<double>& parameters);
void updateWellParameters(const QVector<double>& parameters);
QVector<QVector<double> > runSolver();
QVector<QVector<double> > runSolverDll();
bool runFinalFullSolver();
void saveOptimizationResult();
void validateAndProtectFinalResult();
QString getStopReasonDescription(StopReasonLM reason) const;
int getEnabledParameterCount() const;
@ -177,12 +174,11 @@ private:
AutoFitObjectiveBreakdownLM m_globalBestObjectiveBreakdown;
QVector<QVector<double> > m_lastEvaluatedLogLogData;
QVector<QVector<double> > m_globalBestLogLogData;
mutable AutoFitObjectiveBreakdownLM m_lastObjectiveBreakdown;
AutoFitObjectiveBreakdownLM m_lastObjectiveBreakdown;
QVector<QVector<double> > m_userInitialLogLogData;
AutoFitObjectiveBreakdownLM m_userInitialObjectiveBreakdown;
// 参数索引:0 k,1 skin,2 wellboreC,3 phi,4 Swi,
// 5 Dfc,6 fractureHalfLength。
// 参数索引:0 k,1 skin,2 wellboreC,3 phi,4 Dfc,5 fractureHalfLength。
QVector<bool> m_parameterSelected;
QVector<double> m_parameterLower;
QVector<double> m_parameterUpper;
@ -200,7 +196,6 @@ private:
int m_successfulEvaluations;
volatile int m_evaluationInProgress;
int m_consecutiveFailures;
int m_maxConsecutiveFailures;
QVector<double> m_userInitialSolution;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save