Skip to content

Update actions in solid_mechanics#32428

Open
WilkAndy wants to merge 5 commits intoidaholab:nextfrom
WilkAndy:update_actions_32410
Open

Update actions in solid_mechanics#32428
WilkAndy wants to merge 5 commits intoidaholab:nextfrom
WilkAndy:update_actions_32410

Conversation

@WilkAndy
Copy link
Contributor

@WilkAndy WilkAndy commented Mar 4, 2026

Refs #32410

Notes

Although i'm fairly confident of all changes, these changes MAY HAVE ALTERED the fundamentals of some tests!! Therefore, a thorough (and rather boring) review is needed, sorry.

Various files that use the old Action remain unchanged because i was unsure of how I should change them

Use of AI

I used AI to do the changes. I checked the results, but my ignorance of various aspects means the results could be wrong. Here are summaries of the prompts I used

Prompt 1:

Please perform a large-scale migration of solid_mechanics test input files to modern action syntax, following these exact rules:

(1) Scope
- Work under modules/solid_mechanics/test/tests.
- Apply changes consistently across all relevant files, not just one example.

(2) QuasiStatic parameter correctness
- Only use parameters accepted by QuasiStatic validParams in:
  - QuasiStaticSolidMechanicsPhysicsBase.C
  - QuasiStaticSolidMechanicsPhysics.C
- Remove these from any Physics/SolidMechanics/QuasiStatic block:
max_NR_iterations, min_stepsize, max_stepsize_for_dumb, plastic_models, deactivation_scheme,
debug_fspb, debug_jac_at_stress, debug_jac_at_pm, debug_jac_at_intnl, debug_stress_change, debug_pm_change, debug_intnl_change
- Keep those parameters in ComputeMultiPlasticityStress/related material blocks where they belong.

(3) Strain migration policy
- Remove only explicit strain calculator material blocks being replaced by QuasiStatic.
- Do not remove constitutive/stress materials.
- Preserve mapping:
  - finite strain calculators -> strain = finite, incremental = true
  - incremental small strain calculators -> strain = small, incremental = true
  - total small strain calculators -> strain = small, incremental = false
- If removed strain calculator had eigenstrain_names and/or global_strain, add same value(s) under QuasiStatic [./all].

(4) GPS and axisymmetric cases
- For GeneralizedPlaneStrain legacy setups, migrate to QuasiStatic using:
 - planar_formulation = GENERALIZED_PLANE_STRAIN
 - scalar_out_of_plane_strain = existing scalar variable
  - Remove manual StressDivergence kernel blocks once QuasiStatic handles them.
- Remove explicit strain calculator blocks accordingly.

(5) Dynamic cases
- If input contains inertial/newmark behavior, migrate to Physics/SolidMechanics/Dynamic (not QuasiStatic), carrying over relevant dynamic params (newmark_beta/newmark_gamma/mass_damping_coefficient, etc.).

(6) Strict “do not touch” constraints
- Do not change dt.
- Do not change BC types/content unless explicitly required.
- Do not change or delete comment lines beginning with optional spaces then #.
- Do not change Outputs blocks.
- Do not accidentally rename top-level blocks (Mesh/BCs/etc.).
- Do not introduce unmatched [] or malformed nesting.

(7) Do not touch any file that mentions Cosserat.  Do not touch any file that involves plane strain.  Do not touch any file that involves "visco".

(8) GlobalParams/variables cleanup
- Prefer GlobalParams displacements with action-managed displacement variables where appropriate.
- Remove redundant manual displacement variable declarations only when safely action-managed.

(9) Verification after each batch
- Check QuasiStatic blocks contain only valid params.
- Check no malformed block closures.
- Check no unintended drift vs HEAD for dt, BC type, comments, and Outputs.
- Report exactly which files changed and why.

(10) Test execution
- Run tests in the MOOSE conda environment with:
  -j 3
  --error-unused
  --max-fails=1000
  and --error-deprecated when validating migration quality
- Use --re with focused regex for touched families to iterate quickly.
- Here is a sample of how to run the tests: <Deleted by WilkAndy>

++++++++++++
Prompt 2:

Please perform a large-scale migration of solid_mechanics test input files to modern action syntax for Dynamics, following these exact rules:

(1) Scope
- Work under modules/solid_mechanics/test/tests.
- Apply changes consistently across all relevant files, not just one example.

(2) Dynamic parameter correctness
- Only use parameters accepted by Dynamic validParams in:
  - DynamicSolidMechanicsPhysicsBase.C
  - DynamicSolidMechanicsPhysics.C
- In Physics/SolidMechanics/Dynamic blocks, keep only valid Dynamic action parameters.
- Convert legacy inertia/kernel parameters to Dynamic action names where applicable:
  - beta -> newmark_beta
  - gamma -> newmark_gamma
  - eta -> mass_damping_coefficient
  - alpha (HHT) -> hht_alpha
  - stiffness damping -> stiffness_damping_coefficient
- Remove legacy parameters from Dynamic action blocks if invalid there (leave them in their proper kernel/material context when still needed).
- Do not leave deprecated Kernels/DynamicSolidMechanics syntax behind after migration.

(3) Dynamic migration policy (legacy kernels -> action)
- Replace legacy DynamicSolidMechanics + InertialForce-based setups with Physics/SolidMechanics/Dynamic.
- Remove NewmarkAccelAux/NewmarkVelAux only when the Dynamic action now provides the equivalent variable management.
- Preserve constitutive/stress material blocks.
- Remove only strain calculator material blocks that are explicitly replaced by Dynamic action strain/incremental settings.
- Preserve strain mapping:
  - finite strain calculators -> strain = finite, incremental = true
  - incremental small strain calculators -> strain = small, incremental = true
  - total small strain calculators -> strain = small, incremental = false
- If removed strain calculator had eigenstrain_names and/or global_strain, carry those into Dynamic [./all].

(4) Special dynamic formulations
- For HHT/Newmark/Rayleigh-style cases, preserve behavior by carrying all relevant time-integration and damping parameters into Dynamic [./all].
- For legacy manual stress-divergence + inertia dynamic setups, remove manual kernel blocks once Dynamic action fully handles them.
- Preserve any required static initialization behavior (e.g., static_initialization) for gravity/preload startup sequences.

(5) Explicit/direct central-difference guardrail
- Do not migrate explicit direct central-difference cases that rely on implicit = false material behavior unless explicitly requested.
- Treat these as intentional exceptions if migration would alter algorithmic behavior.

(6) Strict “do not touch” constraints
- Do not change dt.
- Do not change BC types/content unless explicitly required.
- Do not change or delete comment lines beginning with optional spaces then #.
- Do not change Outputs blocks.
- Do not accidentally rename top-level blocks (Mesh/BCs/etc.).
- Do not introduce unmatched [] or malformed nesting.

(7) Exclusions
- Do not touch any file that mentions Cosserat.
- Do not touch any file that involves plane strain.
- Do not touch any file that involves visco.

(8) GlobalParams/variables cleanup
- Prefer GlobalParams displacements with action-managed displacement variables where appropriate.
- Remove redundant manual displacement variable declarations only when safely action-managed.

(9) Verification after each batch
- Check Dynamic blocks contain only valid Dynamic params.
- Check no malformed block closures.
- Check no unintended drift vs HEAD for dt, BC type, comments, and Outputs.
- Report exactly which files changed and why.
- Verify deprecated DynamicSolidMechanics usage is removed in migrated files.

(10) Test execution
- Run tests in the MOOSE conda environment with:
  - -j 3
  - --error-unused
  - --max-fails=1000
  - and --error-deprecated when validating migration quality
- Use --re with focused regex for touched families to iterate quickly.
- Sample command: <Deleted by WilkAndy>

WilkAndy added 2 commits March 4, 2026 11:36
Although i'm fairly confident of all changes, these changes MAY HAVE ALTERED the fundamentals of some tests!!   Therefore, a thorough review is needed, sorry.

This commit changes most test files, but not all.  There are some things i'm unsure of, such as plain-strain, Cosserat, visco, so in most of those cases i have not changed the test files.
Although i'm fairly confident of all changes, these changes MAY HAVE ALTERED the fundamentals of some tests!!   Therefore, a thorough review is needed, sorry.

Various files that use the old Action remain unchanged because i was unsure of how I should change them
@moosebuild
Copy link
Contributor

moosebuild commented Mar 4, 2026

Job Documentation, step Docs: sync website on 4d830b8 wanted to post the following:

View the site here

This comment will be updated on new commits.

@moosebuild
Copy link
Contributor

moosebuild commented Mar 4, 2026

Job Coverage, step Generate coverage on 4d830b8 wanted to post the following:

Framework coverage

ffba51 #32428 4d830b
Total Total +/- New
Rate 85.79% 85.79% +0.00% -
Hits 128614 128615 +1 0
Misses 21308 21307 -1 0

Diff coverage report

Full coverage report

Modules coverage

Solid mechanics

ffba51 #32428 4d830b
Total Total +/- New
Rate 85.40% 85.40% +0.01% -
Hits 28535 28538 +3 0
Misses 4880 4877 -3 0

Diff coverage report

Full coverage report

Thermal hydraulics

ffba51 #32428 4d830b
Total Total +/- New
Rate 88.87% 88.88% +0.01% -
Hits 15429 15430 +1 0
Misses 1932 1931 -1 0

Diff coverage report

Full coverage report

Full coverage reports

Reports

This comment will be updated on new commits.

@moosebuild
Copy link
Contributor

Job Coverage, step Verify coverage on 6517213 wanted to post the following:

The following coverage requirement(s) failed:

  • Failed to generate richards coverage rate (required: 93.0%)

@GiudGiud GiudGiud self-assigned this Mar 8, 2026
Copy link
Contributor

@GiudGiud GiudGiud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doco needs to be updated. I ll push a commit

if you don't want to deal with a lot of merge conflicts we need to process this soon

@GiudGiud GiudGiud force-pushed the update_actions_32410 branch from 7779509 to e1f5163 Compare March 9, 2026 03:13
@GiudGiud GiudGiud force-pushed the update_actions_32410 branch from e1f5163 to 4d830b8 Compare March 9, 2026 04:39
@GiudGiud
Copy link
Contributor

GiudGiud commented Mar 9, 2026

Test failures are unrelated.
Can I please get a solid mechanics person quick check (no need to go over 300 inputs) on this? @bwspenc @hugary1995?

@bwspenc bwspenc self-assigned this Mar 9, 2026
@bwspenc
Copy link
Contributor

bwspenc commented Mar 9, 2026

I'll take a look.

Seeing all these input files reminds me that we really need to run hit format on our input files across MOOSE (out of scope of this PR, though)!

@GiudGiud
Copy link
Contributor

GiudGiud commented Mar 9, 2026

Seeing all these input files reminds me that we really need to run hit format on our input files across MOOSE

agree but I did that years ago and several team members shot that effort down for dubious reasons. I'm not going to touch that again

@hugary1995
Copy link
Contributor

agree but I did that years ago and several team members shot that effort down for dubious reasons. I'm not going to touch that again

Can you perhaps find the issue/PR on that? It might be worth bringing up now that we have more mature formatting support from the LSP effort. If people are onboard this time, the first step would be to add a civet format check on any new input file checked into the repo, which means more work for @loganharbour ...

Since @bwspenc has agreed to take a look, I guess I won't volunteer myself to avoid duplicate effort. But let me know if you need my help reviewing this PR.

@bwspenc
Copy link
Contributor

bwspenc commented Mar 9, 2026

Thanks, I'll take it and let you know if I have any questions, @hugary1995 !

I guess we shouldn't hijack this PR to discuss hit format. I'll just briefly add that I've seen a couple of things related to that that reminded me recently how much I'd like to do this:

  1. Seeing a demo of moosenger generating input files with the "./" and "../" syntax. The more of those inputs that are out there, the more they'll get copied and adopted by new users.
  2. The recent adoption of black to format python files.

If we can do it for python and C++ files we can do it for input files. Anyway, we can discuss this more somewhere else, because it's off-topic for this PR.

if different mesh subdomain has different generalized plane strain model, multiple subblocks with subdomain restrictions can be used.
If a generalized plane strain model is applied for the whole simulation domain, a single subblock should be used.
If different mesh subdomain has different generalized plane strain model, multiple subblocks with subdomain restrictions can be used.
This syntax is paired with the `[Kernels/SolidMechanics]` syntax which is deprecated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is there no way to do this with non-deprecated syntax? That is an important feature, so we should properly support that if we can't. Can't we do this with multiple blocks with generalized plane strain nested under
[Physics/SolidMechanics/QuasiStatic]?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think but feel free to try it

Copy link
Contributor

@GiudGiud GiudGiud Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried

do you see an error in that? This does not converge (in generalized_plain_strain_squares.i)
I think the other action syntax (all in a single Physics/SolidMechanics/QuasiStatic with the generalized_plain_.. strain parameters) is nicer


[Physics]
  [SolidMechanics]
    [./GeneralizedPlaneStrain]
      [./gps1]
        use_displaced_mesh = true
        displacements = 'disp_x disp_y' # moved to globalParams
        scalar_out_of_plane_strain = scalar_strain_zz1
        block = '1'
      [../]
      [./gps2]
        use_displaced_mesh = true
        displacements = 'disp_x disp_y'
        scalar_out_of_plane_strain = scalar_strain_zz2
        block = '2'
      [../]
    [../]

    [QuasiStatic]
      [gps1]
        use_displaced_mesh = false
        temperature = temp
        save_in = 'saved_x saved_y'

        strain = small
        incremental = false
        eigenstrain_names = eigenstrain
        block = '1'
      []
      [gps2]
        use_displaced_mesh = false
        temperature = temp
        save_in = 'saved_x saved_y'

        strain = small
        incremental = false
        eigenstrain_names = eigenstrain
        block = '2'
      []
    []
  []
[]

if different mesh subdomain has different generalized plane strain model, multiple subblocks with subdomain restrictions can be used.
If a generalized plane strain model is applied for the whole simulation domain, a single subblock should be used.
If different mesh subdomain has different generalized plane strain model, multiple subblocks with subdomain restrictions can be used.
This syntax is paired with the `[Kernels/SolidMechanics]` syntax which is deprecated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as my comment on this in another file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same action, just different syntax

@@ -41,6 +41,7 @@
add_variables = true
strain = FINITE
generate_output = 'vonmises_stress effective_alt_total_strain'
incremental = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The defaults for this generally work. I see you added incremental to a lot of files. Is your thinking that we should just be more explicit about this? I'm not opposed to that.

- typo
- add a comment on 0 density material
@GiudGiud GiudGiud force-pushed the update_actions_32410 branch from 3d9b59a to c93ac06 Compare March 11, 2026 15:58
@moosebuild
Copy link
Contributor

Job Test, step Results summary on c93ac06 wanted to post the following:

Framework test summary

Compared against 167d99f in job civet.inl.gov/job/3642141.

No change

Modules test summary

Compared against 167d99f in job civet.inl.gov/job/3642141.

No change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants