Repository navigation
Add a cell-centered finite volume example on polygonal meshes - #4592
Merged
Merged
Conversation
roystgnr
approved these changes
Oct 6, 2026
roystgnr
left a comment
Member
There was a problem hiding this comment.
Going to add some more recipes to be safe, but at first glance this looks good.
| libMesh::out << "Grid size " << grid_size << ": " << mesh.n_active_elem() | ||
| << " cells, centroid L2 error " << error; | ||
| if (level) | ||
| libMesh::out << ", convergence rate " << std::log2(previous_error / error); |
Member
There was a problem hiding this comment.
Could we add some asserts here? Even something weak enough to be robust under different Real precisions can be useful for catching future errors.
|
Job Coverage, step Generate coverage on de17003 wanted to post the following: CoverageNo coverage report(s) were found for the base commit ab2aa4d. This comment will be updated on new commits. |
finite_volume_ex1 solves a steady advection-diffusion problem with a CONSTANT MONOMIAL variable on the C0Polygon paving produced by build_square(C0POLYGON), and reports second-order convergence of the centroid-sampled error for a manufactured solution. Least-squares cell gradients supply a non-orthogonal correction to the two-point diffusive flux, which the slanted hexagon faces require for consistency, and a linear reconstruction for second-order upwind advection. Each face flux then depends on the face neighbors of both adjacent cells, so the example sets DofMap::default_coupling() to two layers before building the mesh. This also gives the geometric ghosting a distributed mesh needs, and the example produces the same errors with replicated and distributed meshes in serial and parallel. The example starts a new finite_volume example category. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…pected Co-Authored-By: Claude <noreply@anthropic.com>
lindsayad
force-pushed
the
finite-volume-example
branch
from
October 15, 2026 22:14
4aefc6e to
de17003
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.
Adds
examples/finite_volume/finite_volume_ex1, the first example in a newfinite_volumecategory. It solves steady advection-diffusion with a cell-centered finite volume method (CONSTANT MONOMIAL) on abuild_square(C0POLYGON)mesh, and reports the centroid-sampled L2 error under uniform refinement for a manufactured solution.Least-squares cell gradients provide a non-orthogonal correction to the two-point diffusive flux and a linear reconstruction for second-order upwind advection. Face fluxes therefore reach the face neighbors of both adjacent cells, so the example sets
DofMap::default_coupling()to two layers before building the mesh, which also keeps the needed ghost elements on a distributed mesh. The observed convergence rate is 2, and errors match across serial, parallel, and--distributed-meshruns.🤖 Generated with Claude Code