Add a capability to load 1D tabulated data - #1654
Merged
Merged
Conversation
…ed by pchip splines (which respects local data bounds, total variation). Demo how to use within a user defined solid mechanics integral.
ebchin
reviewed
Aug 28, 2026
ebchin
approved these changes
Sep 9, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new PchipData API/test usage likely won’t compile as written with std::vector arguments to std::span, and the PR also needs a release-notes entry for the new user-facing feature.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a 1D tabulated-data capability via a shape-preserving PCHIP spline evaluator in smith/numerics, along with regression tests and an end-to-end demonstration using temperature-dependent solid mechanics callbacks.
Changes:
- Introduces
PchipData/PchipViewfor clamped, shape-preserving PCHIP interpolation over tabulated 1D data. - Adds numerics and physics tests validating the interpolant and demonstrating use in solid mechanics material/traction callbacks.
- Registers the new header and tests in the corresponding CMake test/source lists.
File summaries
| File | Description |
|---|---|
| src/smith/numerics/pchip.hpp | Adds new PCHIP interpolant data structure and evaluator API. |
| src/smith/numerics/CMakeLists.txt | Exposes the new numerics header in the module header list. |
| src/smith/numerics/tests/test_pchip.cpp | Adds unit tests for clamping and monotonicity/bounds behavior. |
| src/smith/numerics/tests/CMakeLists.txt | Adds the new numerics test to the serial test sources. |
| src/smith/physics/tests/test_tabulated_solid_properties.cpp | Demonstrates tabulated Young’s modulus in a solid mechanics setup and validates solution accuracy. |
| src/smith/physics/tests/CMakeLists.txt | Adds the new physics test to the serial test sources. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| equation_solver.hpp | ||
| nonlinear_convergence.hpp | ||
| odes.hpp | ||
| pchip.hpp |
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.
have it be approximated by pchip splines (which respects local data bounds, total variation). Demo how to use within a user defined solid mechanics integral.