Avoid recomputing residual norms for MG early exit#2786
Avoid recomputing residual norms for MG early exit#2786pcarruscag wants to merge 2 commits intodevelopfrom
Conversation
| SU2_ZONE_SCOPED | ||
|
|
||
| if (geometry->GetMGLevel() != MESH_0) return; | ||
| if (geometry->GetMGLevel() != MESH_0 && !config->GetMGOptions().MG_Smooth_EarlyExit) return; |
There was a problem hiding this comment.
We do not need to set the RMS residual on the fine mesh when we do an early exit because we already call computelinsysresRMS?
There was a problem hiding this comment.
What this does is compute the residual for all mesh levels, if MG early exit is on.
Before it was only doing the fine mesh.
| /*--- Time integration, update solution using the old solution plus the solution increment ---*/ | ||
| Time_Integration(geometry_fine, solver_container_fine, config, iRKStep, RunTime_EqSystem); | ||
|
|
||
| /*--- Capture initial RMS after the very first residual evaluation. | ||
| * This is the earliest point where LinSysRes = R(u_current) (not stale). | ||
| * ComputeLinSysResRMS must be called by all threads (uses parallel dot). ---*/ | ||
| * This is the earliest point where LinSysRes = R(u_current) (not stale). ---*/ | ||
| if (iPreSmooth == 0 && iRKStep == 0) { | ||
| const passivedouble initial_rms = ComputeLinSysResRMS(solver_fine); | ||
| BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS | ||
| { | ||
| BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { | ||
| const passivedouble initial_rms = ComputeLinSysResRMS(solver_fine); |
There was a problem hiding this comment.
ok that makes sense, so space+time gives complete update, then we compute residual of this
| BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { | ||
| const passivedouble current_rms = ComputeLinSysResRMS(solver_fine); |
There was a problem hiding this comment.
ok, we need to compute this again because of the update with the boundary conditions in postprocessing?
There was a problem hiding this comment.
This is as before, to check the convergence of the smoothing iterations.
|
|
||
| /*--- Record final correction norm for debugging output. ---*/ | ||
| if (config->GetMGOptions().MG_Smooth_Output) { | ||
| const su2double res = sqrt(solver->LinSysRes.squaredNorm() / (nVar * geometry->GetGlobal_nPointDomain())); |
There was a problem hiding this comment.
this is not the same as linsysres?
There was a problem hiding this comment.
It is equivalent, but here it needs to be computed from scratch instead of grabbing the result from the solver because this function manipulates LinSysRes directly, not through the solver (Space + Time integration).
I think the norm should include the MG part of the residual, because it is the sum of the 2 that the solver is trying to converge.