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