Repository navigation
Add the rigid wall in its penalty form - #109
Merged
Merged
Conversation
A static step that follows a dynamic one was refused (decision ST6 of the steps note). Handoff K asks for it, as FEBio does it. FESolidSolver2 tests the analysis type where the mass and the inertial forces enter and where velocity and acceleration follow the displacement, but not in PrepStep: its predictor runs in every time step of a static step too, with nothing to correct it. So the nodes keep a velocity and an acceleration (with the default parameters the velocity changes sign in every time step), and a mass damping load of the static step, which FEBio adds in every analysis type, reads the velocity of the material points: the one the dynamic step ended with on a solid or a shell, the nodal one on a three-field solid or a truss. A dynamic step after the static one starts from what it left. The State of such a time step carries these, the system applies the damping force through its mass blocks, the coverage report says what happens, and gradients through such a step are refused. A model with beams is refused, whose rotations have a predictor of their own. Against FEBio 4.13.0 at e4df3f8, on CPU and on a Tesla P100 with cuDSS: three generated inputs (a shell patch, a three-field hex8, a block on trusses in dynamic, static and dynamic steps) on FEBio's iterations in every time step, with displacement, velocity, acceleration and stress to 3e-12 (references/small_problems/generate_static_after_dynamic.py). tests/test_activity.py asserted the refusal and now asserts the report. After a dynamic step with alpha_f below 1 the velocity kept for a solid or a shell is the interpolated one of the last dynamic update (State.domain_v): on the shell patch with rhoi 0.5 in its dynamic step the static states are then FEBio's to 1e-12 and its 344 iterations are reproduced (a run made once, not a stored case). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
Main gained history at the integration points with FEBio's viscoelastic material (pull request 98). New input ve_block_dynamic_then_static: the viscoelastic block under a held force through 6 dynamic time steps, which end with the block in motion, and 6 static ones. FEBio 4.13.0 at e4df3f8 takes 18 and 22 iterations, this code the same in every time step, with displacements and stresses to 2e-12 on CPU and on a GPU. No code was needed: the domain commits its history at the end of every converged time step of either kind of step, and the static predictor does not touch it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
Design only. The adjoint refuses every term that keeps something from one converged state to the next: the attachments of sticky contact, the multipliers of an augmented constraint, a beam's rotations. Handoff K asks what it would take to carry such history in the State, first for the anchors of a tied or sticky interface and then for a material with internal variables. Section 14 of the sensitivity note lists the history there is, the reverse sweep with one more adjoint for it, what that needs of the State and of the terms, and which gradients are the derivative of the run and which are not because the run depends on its iterates. Three decisions are put for MJ (S11 to S13). The section names inputs and a section of the steps note that are on the branches of K3-2 and K3-3 and not on main at this date. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
Main has a first material with history since pull request 98, with a committed and a trial array in the brick domain and the pair held by every converged State, and the reverse sweep through it since pull request 99. The note said such history was not built for solids and shells. What stays design in section 14 is the rest: anchors, multipliers, the kept velocity. No code. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
FEBio's rigid_wall constraint holds the nodes of a surface on one side of a plane. Four suite inputs miss nothing else (co08, co10, tu03 and the dynamic dy03); it is the first piece of Handoff K, thread K1, and independent of rigid bodies. Read from FERigidWallInterface.cpp at e4df3f8. The facets are integrated at their nodes, since the base class asks for nodal integration; on the curved surface of dy03 a Gauss rule gives another result. Newton uses FEBio's stiffness and the adjoint the derivative, which differ by the squared length of the plane's vector. The four inputs take FEBio's time steps and iterations on CPU and on a Tesla P100. Augmented Lagrangian is refused: it is not built for the wall yet. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
3 of 5 tasks
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 pull request sits on #108 (
mattjolley/history-gradients-note) and is to be merged after it. Until that is merged, the diff here also shows its commits; the commits of this pull request are the last one.What does this change, and why?
FEBio's
rigid_wallconstraint (FERigidWallInterface) holds the nodes of a surface on one side of a plane. Four inputs of FEBio's test suite miss nothing else (co08,co10,tu03, and the dynamicdy03), and it is the first piece of Handoff K, thread K1; it has nothing to do with rigid bodies. Design note:docs/design/rigid_bodies.md(the next pull request), sections 4.6 and 13; this pull request records it in docs/design/constraints.md.What is built (
constraints/rigid_wall.py), read fromFERigidWallInterface.cppate4df3f8:offset; a force of penalty times gap times the nodal area along the constant normal where the gap is positive; one stiffness block per node, in the fixed pattern of the system.FESurfaceConstraintasks for nodal integration. On a curved quad4 surface that differs from a Gauss rule: with a Gauss ruledy03(a ball on a wall) gave 165 iterations and a norm 7 percent from FEBio's, and a FEBio run beside it showed the two part at the first iterate in contact.penaltyandoffseton load curves, so the wall can move (co08).linearize(exact=True)gives the derivative, which differs by the squared length of the plane's vector (1 for a unit vector, which every suite input but one has).penaltyis a parameter.Refused, with the reason in the coverage report: augmented Lagrangian (not built for the wall; the hook of #103 is what it would use), a wall declared in a step, facets other than quad4 and tri3. Not compared with FEBio: the wall force at a prescribed component is left out of the nodal reaction force, as for the contact terms.
Validation
All of the following with Warp 1.20.0.
Tests added or changed:
tests/test_rigid_wall.py, new (9 tests): the four suite inputs; the nodal area of a skewed quad4 and a tri3 against the cross products written out; the gap, the force and both stiffness blocks for a plane whose vector is not a unit vector, withoffsetandpenaltyon load curves; the exact block against central differences of the force; the gradient with respect topenaltyagainst central differences of a run; what is refused.FEBio reference (input file, quantity compared, tolerance, FEBio version), or N/A: FEBio's test suite at
986005f, with the presetFEBIO_4_13: the suite's stored steps, iterations and solution norm.co08(the wall moves by itsoffset)dtol1e-3)co10tu03dy03(a ball falling on a wall, dynamic)The same counts on CPU and on a Tesla P100. These need a checkout of the suite (
FEBIO_TEST_SUITE) and are skipped without one. The small cases are made frombk_body_forceofreferences/small_problemsand are not compared with FEBio.Devices the full tier ran on (CPU, and the GPU model if CUDA; say so clearly if no GPU was used):
cedd204, on CPU:tests/test_rigid_wall.pyin the full tier and the document links, 10 tests, none failed.mattjolley/rigid-body-dynamicsd876c2e, which contains this one), Warp 1.20.0: quick tier of the whole repository on CPU, 1,187 tests, none failed (91 skipped); on a Tesla P100 (cuDSS; the versions of thegpuextra), 1,187 tests, one failure (82 skipped):tests/test_history_adjoint.py,ForwardSweep.test_the_jacobian_of_a_static_run_goes_through_the_steps(from History in the forward sweep #101), which fails on unchangedmainat25b5aacon the same GPU and passes on CPU; it is not of this pull request. The full tier of the nine test files these five pull requests add, change or meet (test_rigid_wall,test_reduction,test_rigid_unknowns,test_rigid_dynamics,test_rigid_moved,test_rigid_refusals,test_sticky,test_alpha_f,test_static_after_dynamic): 125 tests, none failed, on CPU and on a Tesla P100.rigid-wallat its earlier tip: 1,037 tests on each, none failed), with Warp 1.19.0. The suite scoreboard was not run again on this base.Checklist
uvx pre-commit run --all-filespasses. (Run on the files of this change: passes.)FEBIO_WARP_TEST_LEVEL=full uv run -m unittest discover -s tests, and withFEBIO_WARP_TEST_DEVICE=cuda:0for code that runs on the device. (Not run in full; see Validation.)git commit -s).🤖 Generated with Claude Code