Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update multigrid usage in test/mpi/solver #1737

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Conversation

yhmtsai
Copy link
Member

@yhmtsai yhmtsai commented Dec 3, 2024

This PR change the multigrid preconditioner setting in the test/mpi/solver
The original preconditioner criterion also check the absolute residual norm.
However, it will lead no update on the result from preconditioner when it meets the criterion already with initial input.
It makes the all thing stays the same in Cg from that point.
Thus, the previous CgWithMg will run until reaching iteration limit, which leads long time execution

It use the syntex from wiki cg
image

Assume the following $z_2$ is equal to $z_1$ when $z_1$ is initial guess and meet the criterion
$Mz_2 = r_2$
$\beta_1 = \frac{r_2'z_2}{r_1'z_1}$
$r_2'z_2 = (r_1-\alpha A p_1)'z_1 = r_1'z_1 - \frac{r_1'z_1}{p_1'Ap_1}(Ap_1)'z_1$
$= r_1'z_1 - \frac{r_1'z_1}{p_1'A(z_1+\beta_0p_0)}(p_1'A'z_1)$

$p_1'Ap_0 = 0$ and A is symmetric
Thus, we get it to

$r_1'z_1 -\frac{r_1'z_1}{p_1'Az_1}(p_1'Az_1) = r_1'z_1 - r_1'z_1 = 0$

Other than this, I also delete the unused part which is mentioned in #1736

@yhmtsai yhmtsai added the 1:ST:ready-for-review This PR is ready for review label Dec 3, 2024
@yhmtsai yhmtsai self-assigned this Dec 3, 2024
@ginkgo-bot ginkgo-bot added type:solver This is related to the solvers type:matrix-format This is related to the Matrix formats labels Dec 3, 2024
@yhmtsai yhmtsai added 1:ST:no-changelog-entry Skip the wiki check for changelog update 1:ST:ready-to-merge This PR is ready to merge. and removed 1:ST:ready-for-review This PR is ready for review labels Dec 3, 2024
@yhmtsai yhmtsai force-pushed the change_solver_test branch from 491b970 to a85daa5 Compare December 3, 2024 15:37
@yhmtsai yhmtsai force-pushed the change_solver_test branch from a85daa5 to 1308825 Compare December 4, 2024 09:39
@yhmtsai yhmtsai merged commit b7fa9a2 into develop Dec 4, 2024
8 of 11 checks passed
@yhmtsai yhmtsai deleted the change_solver_test branch December 4, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:no-changelog-entry Skip the wiki check for changelog update 1:ST:ready-to-merge This PR is ready to merge. type:matrix-format This is related to the Matrix formats type:solver This is related to the solvers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants