Repository navigation
Refactor hyperelasticity demo into reusable functions - #4683
Open
wangguanyao4-netizen wants to merge 1 commit into
Open
wangguanyao4-netizen wants to merge 1 commit into
wangguanyao4-netizen wants to merge 1 commit into
Conversation
schnellerhase
left a comment
Contributor
There was a problem hiding this comment.
Check your git config and rewrite the commit.
wangguanyao4-netizen
force-pushed
the
work/restructure-demos
branch
from
November 3, 2026 14:49
694c75c to
877313a
Compare
wangguanyao4-netizen
force-pushed
the
work/restructure-demos
branch
from
November 3, 2026 14:51
877313a to
9b2624b
Compare
schnellerhase
approved these changes
Nov 3, 2026
schnellerhase
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this reads way better.
This does not resolve #3076 (please remove the autoclose statement from the PR description).
If approved by others this could be extended in a similar manner to other demos (in future PRs), i.e. breaking out mesh generation, definition of functions and/or BCs, and post processing.
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.
This refactors the C++ hyperelasticity demo into a small set of reusable functions while preserving the numerical formulation and output.
Changes
mainresponsible only for PETSc/logging lifecycle whilesolve_hyperelasticityowns the simulation.The generated UFL forms and solver callbacks are unchanged. The resulting layout gives users a concrete pattern for separating setup, boundary data, solving, and output in a larger nonlinear mechanics program.
Validation
clang-format --dry-run --Werror cpp/demo/hyperelasticity/main.cppgit diff --checkA full demo build/run was not run because this environment does not have CMake or the PETSc/DOLFINx build dependencies installed.