Repository navigation
Conversation
…n_boundary_condition modules. Example adapted from Octave and C++ of the same name
…tion, and robin_boundary_condition modules. Example adapted from Octave and C++ of the same name
…les. Example adapted from Octave and C++ of the same name
…e test_curl test.
…on the test_grad2DCurv octave test. Also update Pymole README with all examples
cpaolini
approved these changes
Nov 19, 2026
cpaolini
left a comment
Collaborator
There was a problem hiding this comment.
All five new Python examples run successfully, produce correct numerical results, and pass all existing Python tests. I approve the PR.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
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.
What type of PR is this? (check all applicable)
Description
Adds five self-contained examples to
python/examples/. Together they use every PyMole module (grid, gradient, divergence, laplacian, curl, boundary_condition, robin_boundary_condition, mimetic_operator). File names match the existing Octave/C++ examples.elliptic1DHomogeneousDirichlet.py: -u'' = 1 with u(0) = u(1) = 0. Uses Grid,Laplacian, RobinBoundaryCondition. Ported from the Octave/C++ example of the same name.
elliptic1DLeftNeumannRightDirichlet.py: -u'' = 1 with u'(0) = 0, u(1) = 0.Defines a
LeftRightBoundaryCondition(BoundaryCondition)subclass that combines twoRobinBoundaryCondition objects, because RobinBoundaryCondition applies the same
coefficients at both ends. Ported from the Octave/C++ example of the same name.
hyperbolic1D.py: periodic advection with leapfrog time stepping. Defines anInterpol(MimeticOperator)subclass that portsinterpol.m. Ported from theOctave/C++ example of the same name.
curl2D.py: curl of F = (-y, x), which is 2 everywhere. Adapted from Octavetest_curl.m(renamed so pytest does not collect it).gradient1D.py: convergence of the 1D mimetic gradient for k = 2, 4, 6.New example, based on Octave
test_grad2DCurv.m.Also adds run commands to
python/README.mdand Python links to the Sphinx pages forElliptic1D-Homogeneous-Dirichlet, Elliptic1D-Left-Neumann-Right-Dirichlet, and Hyperbolic1D.
Related Issues & Documents
QA Instructions, Screenshots, Recordings
Tested on Windows 11 (Used WSL for C++)

Keep-open request
keep-open.Reason:
Added/updated tests?
_We encourage you to test all code included with MOLE, including examples.
Read Contributing Guide and Code of Conduct
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?