Scale corrected ir smoother - #2036
Conversation
8770bc8 to
9a68ea5
Compare
yhmtsai
left a comment
There was a problem hiding this comment.
miss ir.hpp change, should remove scale-correction-mg-solver binary, need to add test
6861d33 to
6eaf738
Compare
| std::shared_ptr<const LinOp>(dense_b, [](const LinOp*) {}), dense_x, | ||
| residual_ptr); | ||
|
|
||
| // Matches the OpenFOAM GAMGSolver::scale function: |
There was a problem hiding this comment.
do you also have paper reference?
| if (const auto* de = | ||
| dynamic_cast<const DiagonalExtractable<ValueType>*>(local_A)) { |
There was a problem hiding this comment.
this only check whether the diagonal can be extracted.
but it might have some zero in the diagonal
There was a problem hiding this comment.
can this be replaced by Jacobi-IR with 1 iteration?
| // then accumulate into x. | ||
| apply_scale_correction(inner_solution, residual_ptr); | ||
| } | ||
| dense_x->add_scaled(relaxation_factor_, inner_solution); |
There was a problem hiding this comment.
should relaxation_factor be used together with the scale correction?
| * OpenFOAM never scales x directly, so mode 1 has no OpenFOAM | ||
| * equivalent. | ||
| */ | ||
| int GKO_FACTORY_PARAMETER_SCALAR(scale_correction, 0); |
There was a problem hiding this comment.
maybe have a tag?
ir_method::richardson, backward, forward.
Is mode 1 used in some cases?
There was a problem hiding this comment.
+1 for tag.
It could be extended to use the approach in https://dl.acm.org/doi/full/10.1145/3712285.3759807
8f86851 to
5abc13f
Compare
5dad4aa to
9bbb7d1
Compare
The IR-based scale correction (Ir scale_correction = none/forward/backward,
the scale_correction_mode enum) was superseded by the multigrid-level
scale_correction. The champion case drives scale correction entirely from
solver::Multigrid (scale_correction=true) and sets its Ir smoothers to
scale_correction=none, so the IR compute path is never exercised.
Revert ir.{hpp,cpp}, the scale_correction_mode enum (solver_base.hpp) and its
config parsing (config_helper.hpp) to develop, and drop the IR-backward
example. The multigrid scale_correction / scale_correction_pre_smooth feature
is unaffected.
develop moved copy_from from LinOp to Cloneable; the pre-smooth scale block still used r->copy_from(b). Use as<Cloneable>(r)->copy_from( as<Cloneable>(b)) to match the post-smooth block and develop.
233efb9 to
4251932
Compare
|
Error: The following files need to be formatted: You can find a formatting patch under Artifacts here or run |
This PR adds a scale corrected IR smoother which aims to improve convergence.