Repository navigation
Add the forward simulation API and package checks - #20
Open
peteryu0131 wants to merge 12 commits into
Open
peteryu0131 wants to merge 12 commits into
peteryu0131 wants to merge 12 commits into
Conversation
Prepare the forward simulation API for upstream review. Includes model building, solver runtime, examples, documentation, packaging, and CI checks. Preserve the exact file tree and pinned submodules from jingyaoyu_forward at 4440efc. Base this review commit on official main at 4f15f37 because the fork's older history has different commit IDs after signature removal. The original development branch and history remain unchanged.
Pin the spec-driven generator and keep mesh, selection and RHS behavior in the PolyFEM package. Configure project naming and ID relationships alongside the builder. Ship the builder with the Python package and let the existing CMake recipe find nanobind.
Let the backend merge common JSON settings. Reject explicit volume IDs that collide with an automatically assigned body ID, and preserve explicit mesh paths when a file is missing. Cover each case with a regression test.
Reuse the JSON cleaner, remove the unused point selection helper, and check the solver result directly. Read factory names from the generated manifest and consolidate the solve-path tests across all classic examples.
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 adds a Python API for forward simulations. Users can create a model with
polyfem.model(), attach materials and boundary conditions to its meshes, and pass the configuration topolyfempy.solve(). The builder manages the selection IDs for file and array meshes.The Python package pins the official PolyFEM backend at
836c923. The PR updates the generator and data submodules, keeps the extension build adapters in the Python repository, and adds a cantilever example, an installation check, and package checks for wheels and conda.Local validation on Windows x64 with Python 3.11
Local Triangle validation on Windows x64 with Python 3.11
I rebuilt PolyFEM
836c923withPOLYFEM_WITH_TRIANGLE=ON. All six higher-order contact examples passed with this local build. I ran each example through the Python API and its original JSON using the official regression step count. The P1, P2, P3, and P4 ball-bounce cases and the microstructure case each ran for one step. The P4 ball-bounce variant withdt=0.01ran for 20 steps.All 12 solves completed. The six reported metrics matched exactly between the API and JSON in every case. The largest relative error against a stored reference was
4.15e-11, within the official tolerance of1e-5.Open validation items