fix: boundary conditions for 3d case#441
Open
gouarin wants to merge 4 commits into
Open
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 30 |
| Duplication | 5 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to fix incorrect boundary/corner handling in 3D by updating how corner/edge subsets are constructed on the mesh and how outer corner ghost cells are filled/projected during boundary-condition updates.
Changes:
- Update mesh corner subset construction to handle directions with zero components (3D edge directions).
- Rework outer-corner ghost filling to populate diagonal layers and then fill off-diagonal ghosts via sweeps.
- Adjust corner projection logic and periodic-direction skipping during outer ghost updates.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| include/samurai/mesh.hpp | Updates corner subset construction to account for nonzero direction components (3D edges/corners). |
| include/samurai/bc/apply_field_bc.hpp | Reworks polynomial extrapolation logic for outer corners, adding multi-layer diagonal fill + off-diagonal sweeps. |
| include/samurai/algorithm/update.hpp | Adjusts corner projection behavior and periodic-direction filtering for corner ghost updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
318
to
+333
| void update_outer_corners_by_polynomial_extrapolation(std::size_t level, const DirectionVector<Field::dim>& direction, Field& field) | ||
| { | ||
| if constexpr (Field::dim == 1) | ||
| { | ||
| return; // No outer corners in 1D | ||
| } | ||
|
|
||
| static constexpr std::size_t extrap_stencil_size = 2; | ||
| static constexpr std::size_t max_stencil_size_PE = PolynomialExtrapolation<Field, 2>::max_stencil_size_implemented_PE; | ||
|
|
||
| auto& domain = detail::get_mesh(field.mesh()); | ||
| PolynomialExtrapolation<Field, extrap_stencil_size> bc(domain, ConstantBc<Field>(), true); | ||
| int ghost_width = field.mesh().ghost_width(); | ||
| const auto& domain = detail::get_mesh(field.mesh()); | ||
| const auto& corner_lca = field.mesh().corner(direction); | ||
|
|
||
| auto corner = self(field.mesh().corner(direction)).on(level); | ||
| // Step 1: Fill the diagonal ghost cells layer by layer using stencil sizes 2, 4, ..., 2*ghost_width | ||
| for (int ghost_layer = 1; ghost_layer <= ghost_width; ++ghost_layer) | ||
| { |
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.
Available tags: 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test'
Description
Related issue
How has this been tested?
Code of Conduct
By submitting this PR, you agree to follow our Code of Conduct