Add computeDivProcBoundImpl and computeLaplacianProcBoundImpl for pro…#512
Merged
Conversation
|
Thank you for your PR, here are some useful tips:
|
501303f to
e5df305
Compare
greole
commented
May 22, 2026
be20a4c to
2d52a75
Compare
greole
commented
May 22, 2026
greole
commented
May 22, 2026
greole
commented
May 22, 2026
greole
commented
May 22, 2026
greole
commented
May 22, 2026
2d52a75 to
9a98d27
Compare
…cessor boundaries Implements matrix-coefficient assembly at processor-boundary faces for both the Gauss-Green divergence and Laplacian operators. Includes the required LinearSystem::nonLocalMatrix() member and FaceToMatrixAddress extensions that track local/nonLocal/boundary sparsity patterns and row counts.
b6f90b2 to
142b691
Compare
greole
commented
May 23, 2026
a25feaa to
f7221a8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends NeoN’s finite-volume implicit operator assembly to properly handle processor-boundary (inter-rank) faces for Gauss-Green divergence and Laplacian, storing cross-rank coefficients separately and adding MPI unit tests to validate equivalence with the non-distributed assembly.
Changes:
- Add implicit proc-boundary coefficient assembly for
divandlaplacian, storing non-local contributions in a newLinearSystem::offDiagonalMatrix(). - Extend geometry handling to compute/exchange proc-boundary distances used in non-orthogonal delta coefficients.
- Add a new MPI unit test (
test/distributed/operator.cpp) and wire it into the distributed test CMake.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/linearAlgebra/utilities.cpp | Updates test setup to provide a dedicated boundary RHS vector. |
| test/linearAlgebra/linearSystem.cpp | Refactors test variable naming/usage around LinearSystem construction and host copying. |
| test/linearAlgebra/faceToMatrixAddress.cpp | Minor rename/cleanup in sparsity pattern test. |
| test/distributed/operator.cpp | New MPI test validating distributed operator assembly (main + off-diagonal parts) against global assembly. |
| test/distributed/CMakeLists.txt | Registers the new distributed operator test when MPI is enabled. |
| src/mesh/unstructured/unstructuredMesh.cpp | Minor cleanup in uniform mesh creation implementation. |
| src/linearAlgebra/ginkgo.cpp | Silences unused-parameter warnings for an unsupported COO(Vec3) overload. |
| src/linearAlgebra/faceToMatrixAddress.cpp | Moves FaceToMatrixAddress methods out-of-header; adds proc-boundary sparsity helper (currently TODO). |
| src/finiteVolume/cellCentred/stencil/cellToFaceStencil.cpp | Minor cleanup removing unused view extraction. |
| src/finiteVolume/cellCentred/stencil/basicGeometryScheme.cpp | Adds MPI exchange to compute proc-boundary neighbour distances for non-orth delta coeffs. |
| src/finiteVolume/cellCentred/operators/gaussGreenLaplacian.cpp | Adds computeLaplacianProcBoundImpl and integrates it into implicit Laplacian assembly. |
| src/finiteVolume/cellCentred/operators/gaussGreenDiv.cpp | Adds computeDivProcBoundImpl and integrates it into implicit divergence assembly. |
| src/finiteVolume/cellCentred/interpolation/upwind.cpp | Extends upwind weights to proc-boundary faces. |
| include/NeoN/mesh/unstructured/unstructuredMesh.hpp | Reorders/clarifies nProcBoundaryFaces() API with documentation. |
| include/NeoN/linearAlgebra/matrix.hpp | Adds a placeholder Matrix::reset() API (currently no-op). |
| include/NeoN/linearAlgebra/linearSystem.hpp | Adds offDiagonalMatrix_ storage and constructors; resets it in LinearSystem::reset(). |
| include/NeoN/linearAlgebra/faceToMatrixAddress.hpp | Moves inline implementations to .cpp. |
| include/NeoN/finiteVolume/cellCentred/operators/gaussGreenLaplacian.hpp | Header cleanup (removes declarations/extern templates). |
| include/NeoN/finiteVolume/cellCentred/operators/gaussGreenDiv.hpp | Header cleanup (removes extern templates). |
| include/NeoN/finiteVolume/cellCentred/faceNormalGradient/faceNormalGradient.hpp | Silences unused-parameter warnings in default implicitCorrection. |
| include/NeoN/distributed/partitioning.hpp | Populates proc-boundary boundary values when partitioning 1D fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
147
to
156
| [[nodiscard]] LinearSystem<ValueType, SystemMatrixType, BoundaryMatrixType> | ||
| copyToExecutor(Executor exec) const override | ||
| { | ||
| return { | ||
| matrix_.copyToExecutor(exec), | ||
| rhs_.copyToExecutor(exec), | ||
| boundaryMatrix_.copyToExecutor(exec), | ||
| boundaryRhs_.copyToExecutor(exec) | ||
| boundaryRhs_.copyToExecutor(exec), | ||
| offDiagonalMatrix_.copyToExecutor(exec) | ||
| }; |
Comment on lines
+37
to
+38
| float epsilon = 1e-32; | ||
|
|
Comment on lines
+160
to
+165
| auto solverStats = solver.solve(ls, x); | ||
| auto solverStatsDist = solver.solve(lsDst, xPart); | ||
|
|
||
| auto [numIterDist, initResNormDist, finalResNormDist, solveTimeDist] = | ||
| solverStatsDist.entries[0]; | ||
| auto [numIter, initResNorm, finalResNorm, solveTime] = solverStats.entries[0]; |
greole
commented
May 23, 2026
0d5dd9e to
a3a0153
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements matrix-coefficient assembly at processor-boundary faces for both the Gauss-Green divergence and Laplacian operators and tests it against non distributed counterparts. This is also taken from #414 and currently misses the distributed solver test.