refactor(nmNum): 取消高度调整次数限制

feature/AutoFit-Optimize-20260914
lvjunjie 2 weeks ago
parent 452123b06a
commit 8d807413c4

Binary file not shown.

@ -1113,8 +1113,8 @@ Reason: %1</source>
<translation>目标井名称为空</translation> <translation>目标井名称为空</translation>
</message> </message>
<message> <message>
<source>LM stage 1: align curve height using permeability only (up to %1 evaluations).</source> <source>LM stage 1: align curve height using permeability only; no fixed evaluation limit, effective improvement threshold 10%.</source>
<translation>LM 阶段一:仅调整渗透率对齐曲线高度(最多求解 %1 次)。</translation> <translation>LM 阶段一:仅调整渗透率对齐曲线高度,不限制试算次数,有效改善门槛为 10%。</translation>
</message> </message>
<message> <message>
<source>Permeability alignment: k=%1, height error=%2, shape error=%3, result=%4</source> <source>Permeability alignment: k=%1, height error=%2, shape error=%3, result=%4</source>
@ -1141,8 +1141,8 @@ Reason: %1</source>
<translation>渗透率高度对齐结束:%1</translation> <translation>渗透率高度对齐结束:%1</translation>
</message> </message>
<message> <message>
<source>height evaluation budget reached</source> <source>no feasible permeability step or step too small</source>
<translation>达到高度调整求解预算</translation> <translation>无可行的渗透率调整步或步长过小</translation>
</message> </message>
<message> <message>
<source>stopped by user</source> <source>stopped by user</source>

@ -2087,15 +2087,14 @@ StopReasonLM nmCalculationAutoFitLM::runTrustRegionFitting()
// 高度预调整只改变用户勾选的渗透率。ln(k) 的初始变化由有符号高度差 // 高度预调整只改变用户勾选的渗透率。ln(k) 的初始变化由有符号高度差
// 给出,真实求解后用割线估计修正;拒绝时缩步,不让其他参数补偿高度。 // 给出,真实求解后用割线估计修正;拒绝时缩步,不让其他参数补偿高度。
const int permeabilityColumn = m_enabledParamIndices.indexOf(0); const int permeabilityColumn = m_enabledParamIndices.indexOf(0);
const int heightBudget = qMin(4, qMax(0, (maximumEvaluations - m_totalEvaluations - dimensions - 2) / 6));
double heightBaseline = current.breakdown.verticalLoss; double heightBaseline = current.breakdown.verticalLoss;
int heightStagnation = 0; int heightStagnation = 0;
double heightScale = 1.0; double heightScale = 1.0;
double heightSlope = -1.0; double heightSlope = -1.0;
if(permeabilityColumn >= 0) { if(permeabilityColumn >= 0) {
emit logMessageGenerated(tr("LM stage 1: align curve height using permeability only (up to %1 evaluations).") emit logMessageGenerated(tr("LM stage 1: align curve height using permeability only; no fixed evaluation limit, effective improvement threshold 10%."));
.arg(heightBudget)); // 不限制试算次数,由高度对齐、改善停滞及可行步长决定何时结束。
for(int trial = 0; trial < heightBudget && processPauseAndStop(); ++trial) { while(processPauseAndStop()) {
const double bias = current.breakdown.verticalCommonBias; const double bias = current.breakdown.verticalCommonBias;
if(!current.breakdown.verticalReliable || qAbs(bias) <= 0.01 || heightStagnation >= 2) break; if(!current.breakdown.verticalReliable || qAbs(bias) <= 0.01 || heightStagnation >= 2) break;
const double k = current.parameters[permeabilityColumn]; const double k = current.parameters[permeabilityColumn];
@ -2127,7 +2126,7 @@ StopReasonLM nmCalculationAutoFitLM::runTrustRegionFitting()
heightScale *= 0.5; heightScale *= 0.5;
} }
restoreEvaluationState(current); restoreEvaluationState(current);
if(heightBaseline - current.breakdown.verticalLoss >= qMax(1.0e-4, 0.01 * heightBaseline)) { if(heightBaseline - current.breakdown.verticalLoss >= qMax(1.0e-4, 0.10 * heightBaseline)) {
heightBaseline = current.breakdown.verticalLoss; heightBaseline = current.breakdown.verticalLoss;
heightStagnation = 0; heightStagnation = 0;
} else ++heightStagnation; } else ++heightStagnation;
@ -2136,7 +2135,7 @@ StopReasonLM nmCalculationAutoFitLM::runTrustRegionFitting()
.arg(candidate.breakdown.verticalLoss, 0, 'e', 4).arg(candidate.breakdown.shapeLoss, 0, 'e', 4) .arg(candidate.breakdown.verticalLoss, 0, 'e', 4).arg(candidate.breakdown.shapeLoss, 0, 'e', 4)
.arg(accepted ? tr("accepted") : tr("rejected"))); .arg(accepted ? tr("accepted") : tr("rejected")));
} }
QString heightReason = tr("height evaluation budget reached"); QString heightReason = tr("no feasible permeability step or step too small");
if(m_shouldStop) heightReason = tr("stopped by user"); if(m_shouldStop) heightReason = tr("stopped by user");
else if(!current.breakdown.verticalReliable) heightReason = tr("pressure and derivative height directions conflict"); else if(!current.breakdown.verticalReliable) heightReason = tr("pressure and derivative height directions conflict");
else if(current.breakdown.verticalLoss <= 0.01) heightReason = tr("curve height is approximately aligned"); else if(current.breakdown.verticalLoss <= 0.01) heightReason = tr("curve height is approximately aligned");

Loading…
Cancel
Save