-
Notifications
You must be signed in to change notification settings - Fork 50
Improve Poisson tutorial with clearer explanations #198
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
base: master
Are you sure you want to change the base?
Conversation
Improved Poisson tutorial with explanations and added clarity
Expanded explanations of weak form, FE spaces, mesh tags, transitions, and math-code mapping. Also improved visualization description.
JordiManyer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed. I think some stuff is unnecessary, but I am happy to keep parts of it. Thank you for the contribution!
|
|
||
| degree = 2 | ||
| Ω = Triangulation(model) | ||
| # dΩ represents integration over the 3D domain Ω (a volume integral), matching the dΩ notation in the weak form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this makes sense. What does "represents integration mean"? I think the current explanation, a.k.a it's a quadrature of order degree the cells, is more precise.
| # In the strong form we have: | ||
| # -Δu = f in Ω, u = g on Γ_D, ∂u/∂n = h on Γ_N. | ||
| # | ||
| # To obtain the weak form, we multiply by a test function v (which vanishes on Γ_D) and integrate by parts, giving: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary. My point of view is that this is an implementation tutorial, not a math class. In the initial header, we state both the strong and weak formulations of the problem and give a reference so that people can have a look at the derivation. If you go to the given reference, you will find an explanation on exactly this, thus making it unnecessary.
| a(u,v) = ∫( ∇(v)⋅∇(u) )*dΩ | ||
| b(v) = ∫( v*f )*dΩ + ∫( v*h )*dΓ | ||
| # Math ⇔ Code mapping: | ||
| # a(u,v) = ∫( ∇(v)⋅∇(u) )*dΩ ↔ ∫_Ω ∇u⋅∇v dΩ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I do not see the point of this. The API is expressive enough that this "translation" is unnecessary, I think. If you look at both sides, the changes are minimal. I do not think people struggle with making this translation themselves.
| # Summary so far: | ||
| # - V0 implements the test space V_h^0 (zero on Γ_D). | ||
| # - Ug implements the trial space U_h^g (Dirichlet value g). | ||
| # - a(u,v) and b(v) encode the variational problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the tutorial so long that we need a summary?
This PR expands the Poisson tutorial with additional explanations to help beginners.
I added:
• Intro explanation of the weak form and how it connects to a(u,v) and b(v)
• Clarification on the mesh file (model.json) and boundary tags
• Explanation of test space (V0) and trial space (Ug)
• Small transition explanations between sections
• Math-to-code comments showing how the weak form maps to Gridap expressions
• Clearer visualization guidance to interpret results
Please let me know if anything should be changed, thank you.