Add function to remove boundary contributions#495
Conversation
|
Thank you for your PR, here are some useful tips:
|
f34669a to
3eacc3e
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to adjust how boundary contributions are tracked/applied in finite-volume operator assembly (and adds a helper to remove those contributions for testing), alongside a new lower() matrix utility declaration.
Changes:
- Update boundary-face accumulation behavior in Gauss-Green Laplacian/Div implicit assembly (boundary matrix/RHS tracking and diagonal updates).
- Add
removeBoundaryContributions(...)helper onLinearSystemfor test workflows. - Declare a new
lower(...)triangular extraction function in the linear algebra API.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/linearAlgebra/matrix.cpp |
Minor formatting-only change (extra blank line). |
src/finiteVolume/cellCentred/operators/gaussGreenLaplacian.cpp |
Changes boundary-face diagonal/RHS updates and boundary tracking. |
src/finiteVolume/cellCentred/operators/gaussGreenDiv.cpp |
Changes boundary-face diagonal/RHS updates and boundary tracking (implicit path). |
include/NeoN/linearAlgebra/matrix.hpp |
Declares lower(...) and adds Doxygen comments. |
include/NeoN/linearAlgebra/linearSystem.hpp |
Adds removeBoundaryContributions(...) testing helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return upper; | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
This diff introduces an extra blank line between functions. If the project is keeping spacing tight in this file, consider removing it to avoid noisy diffs.
3eacc3e to
7464dfe
Compare
eb9dd62 to
0036ab7
Compare
|
Is the function for removing boundary contributions solely for the purpose of testing in distributed settings? |
|
As of now, solely for testing purposes. |
0036ab7 to
8d0c64b
Compare
chihtaw
left a comment
There was a problem hiding this comment.
We need proper unit tests to validate the boundary matrix and boundary RHS in operator evaluations so that bugs won't easily sneak into the operator evaluations next time.
4519196 to
672f0b0
Compare
|
It looks like the unit test added by this PR (exasim-project/NeoFOAM#275) only validates coefficient matrix of linear system of equations for pressure-velocity coupling on NeoFOAM side. I think we need unit tests on NeoN side to validate the RHS of linear system of equations without pressure-velocity coupling which only happens on NeoFOAM. |
3d7a8f2 to
4118e8c
Compare
chihtaw
left a comment
There was a problem hiding this comment.
LGTM!
Just a comment on the documentation for removeBoundaryContributions.
Co-authored-by: Chih-Ta Wang <97195768+chihtaw@users.noreply.github.com>
Add function to remove boundary contributions
This PR adds a function to remove boundary contributions from the matrix diagonal. The reasoning is that other CFD frameworks might or might not add boundary contributions to the diagonal matrix. Currently, NeoN directly adds the boundary contributions to the diagonal matrix and stores them in the boundMatrix. To simplify testing a function is added to remove these contributions.
Additionally: