Repository navigation
feat(examples): add a J2 plasticity example solved by Newton's method - #71
Merged
Merged
Conversation
A thick-walled cylinder under internal pressure (Hill 1950), in plane strain, with J2 plasticity and linear isotropic hardening (perfect plasticity by default). Every load step is solved by Newton's method with the consistent tangent of the radial return, so the iterations converge quadratically: three to five per plastic load step. The plastic state lives at the quadrature points. The stress and the tangent moduli reach an internal-force NodeAssembler and a tangent ElementAssembler as quadrature_data (#70), and the pressure is a FacetAssembler load along the outward normal n (#69). Displacement control follows the collapse plateau; pressure control is an option. The quarter ring of six-node triangles is built with NumPy, so the example needs no gmsh. Tests check the return map and its tangent against forward-mode autodiff, the assembled stiffness against finite differences, the Lame elastic response, first yield at the inner wall, the limit pressure (2 / sqrt 3) sigma_y ln(b / a) of perfect plasticity (within 1 %), and CUDA against CPU. Docs: gallery page and solid-mechanics index entry, with zh_CN translations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dst8zhPLnxVpZMBhR4Pvfs Signed-off-by: Shizheng Wen <wenshizheng0710@gmail.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.
Summary
Adds
examples/solid/plasticity_cylinder/: the elastic-plastic thick-walled cylinder under internal pressure (Hill 1950), in plane strain, with J2 plasticity and linear isotropic hardening (perfect plasticity by default).What it adds over the existing
plasticity_striprung (L-BFGS on an incremental energy):quadrature_dataargument (feat(assemble): pass per-quadrature-point data to the element and node assemblers #70): the stress feeds an internal-forceNodeAssembler, the tangent moduli a stiffnessElementAssembler.nof aFacetAssembler(fix(assemble): select boundary facets by incidence and add facet normals #69).Condenser.update_dirichlet), which follows the collapse plateau;--control pressureis the load-controlled variant.The default run (825 nodes, 30 load steps) takes about 2 s on a CPU. It reaches 199.7 MPa, within 0.2 % of the limit pressure (2/√3) σ_y ln(b/a) = 200.1 MPa, approached from below.
Files
examples/solid/plasticity_cylinder/plasticity_cylinder.py,README.mdtests/assemble/test_plasticity_cylinder_example.pydocs/source/example_gallery/solid/plasticity_cylinder.rstplus the solid-mechanics index (new rung, solver pattern, card), with the figure and card image in_static/solid_mechanics/Tests
tests/assemble/test_plasticity_cylinder_example.py:torch.func.jvpof the stress update (H = 0 and H > 0).Results on Clariden, CPU partition, float64:
--control pressureand--hardening 2000.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dst8zhPLnxVpZMBhR4Pvfs