-
Notifications
You must be signed in to change notification settings - Fork 35
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
Poisson: hanging node constraints not enforced #650
Comments
update on the DG iteration count: cph takes 33 iterations, reducing the residual by 1e8 from zero initial guess. That is reasonable I guess; I have only one global refinement level so the GMG hierarchy is relatively "flat", Chebyshev smoother, 5 smoothing sweeps. |
I must admit I do not yet understand the complete picture. We don't call |
Thanks for taking a look. |
just tested with the same example. that one line would fix it. I will make a PR, but to me it is still unclear, why this has not surfaced earlier ... anyone using periodic constraints or hanging nodes with CG would have encountered that. Am I overlooking something? |
We did not use continuous FEM very often yet; so in that sense this fix is very much appreciated. |
The status of inspection here still seems to be "visualization only"
Could you explain what you found out so far, so that I can better understand the problem? |
The problem is in this application visualization only, if we ignore that the final solution vector we have has zeroes at the hanging nodes. If we want to compute some error in the postprocessor with a hanging node solution, we run into trouble though. The problem is that the system is solved correctly, but the postprocessor gets a vector exadg/include/exadg/poisson/driver.cpp Lines 109 to 116 in 0075db2
I would rather not construct the hanging node constraints via the DoFHandler again, but enforce them at the end of solve() , where we also enforced inhomogeneous BCs when using CG discretizations already:
where we have that AffineConstraints object at hand. Here, I did not see any change in iteration counts, so I think this is really visualization. And the point where these constraints are enforced is somewhat free, but I would not put that in the Postprocessor, simply because it does not have the constraints and probably should not have. |
In my opinion, adding these lines to where the solver is called is also inconsistent from a software design perspective. Because now, having added these lines around the solver call, it appears arbitrary who has to care about these constraints, who is responsible for imposing the constraints. We do not want to have an implementation where every "module"/"class" imposes the constraints for "safety reasons". I argue that we need a clear "single responsibility" design. Right now, I would prefer not having these lines of code on the "solver call" level. On the solver level, our implementation in ExaDG should be in line with / driven by |
Solving a Poisson problem with hanging nodes I saw that the hanging node constraints are not enforced. Down below there is an example. It does not seem like there are no constraints enforced on the hanging nodes (I would guess the solution would then be closer to the expected value), but we are actually actively enforcing zero constraints (since we have clear zeroes enforced and otherwise it might just be some reasonably close value to the actual solution, system would still be solveable since this would be like an interior Neumann boundary on the refined interior edge).
Polynomial degree is 2 in both cases. Solver converges "fine": DG: 98, CG: 44 iters; ph geom multigtid + AMG coarse grid solver in both cases.
Any better ideas? Any hints where to start looking? I did not investigate yet and will not have time before GAMM, but could do that afterwards.
DG solution:
CG solution:
The text was updated successfully, but these errors were encountered: