Inline interpolation kernels#557
Draft
greole wants to merge 4 commits into
Draft
Conversation
|
Thank you for your PR, here are some useful tips:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces device-callable inline interpolation weight kernels to avoid precomputing weight fields and to eliminate virtual dispatch inside Kokkos assembly kernels. The divergence and fused div+laplacian implicit assemblers are refactored to obtain a concrete kernel via inlineWeightKernel(...) and dispatch it with std::visit.
Changes:
- Added
InlineWeightKernel(std::variant) plusLinearInlineKernel/UpwindInlineKerneldevice-callable implementations. - Extended
SurfaceInterpolationFactorywith a new pure-virtualinlineWeightKernel(...)API and implemented it forlinear,upwind, andlinearUpwind. - Refactored
gaussGreenDivandgaussGreenDivLaplacianimplicit assembly paths to compute weights inline via the kernel (removing weight-field plumbing).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/finiteVolume/cellCentred/operators/gaussGreenDivLaplacian.cpp | Refactors fused operator assembly to use inline weight kernels via std::visit. |
| src/finiteVolume/cellCentred/operators/gaussGreenDiv.cpp | Refactors implicit div assembly (internal/boundary/proc) to compute weights inline. |
| include/NeoN/finiteVolume/cellCentred/interpolation/upwind.hpp | Implements inlineWeightKernel() for upwind interpolation. |
| include/NeoN/finiteVolume/cellCentred/interpolation/surfaceInterpolation.hpp | Adds new pure-virtual inlineWeightKernel() API and forwards it through SurfaceInterpolation. |
| include/NeoN/finiteVolume/cellCentred/interpolation/linearUpwind.hpp | Implements inlineWeightKernel() for linearUpwind (upwind weights + explicit correction). |
| include/NeoN/finiteVolume/cellCentred/interpolation/linear.hpp | Implements inlineWeightKernel() for linear (captures geometry weights views). |
| include/NeoN/finiteVolume/cellCentred/interpolation/inlineInterpolationKernels.hpp | New header defining the inline weight kernel types and the InlineWeightKernel variant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
298
to
300
| // Decompose face flux via linear interpolation: | ||
| // ownFluxContrib = w * F_f — part attributed to the owner cell value | ||
| // neiFluxContrib = (1-w) * F_f — part attributed to the neighbor cell value |
Comment on lines
+95
to
+99
| /* @brief Returns a device-callable weight kernel for use inside Kokkos kernels. | ||
| * The kernel computes the face interpolation weight inline per face without virtual dispatch. | ||
| */ | ||
| virtual InlineWeightKernel inlineWeightKernel(const SurfaceField<scalar>& flux) const = 0; | ||
|
|
0465179 to
5069101
Compare
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.
This PR introduces device-callable inline interpolation weight kernels to avoid precomputing weight fields and to eliminate virtual dispatch inside Kokkos assembly kernels. The divergence and fused div+laplacian implicit assemblers are refactored to obtain a concrete kernel via inlineWeightKernel(...) and dispatch it with std::visit.