Skip to content

Share the common return-map code of the three plasticity materials through plasticity_utils.h #75

Description

@petlenz

j2_plasticity, j2_rk_plasticity and drucker_prager_plasticity share about half their code by copy: trial state, elastic-branch handling, history writes, tangent assembly. J2 is effectively written twice.

The cost already showed up once: the explicit RK stage passed G where the other two pass effective_modulus(G), a 3x error in the multiplier that the copy in j2_plasticity did not have.

Approach

Additive, in the style plasticity_utils.h already uses (evaluate_at_state, make_isotropic_tangent): extract free functions and have the materials call them one at a time, each behind the existing tests. No common base class and no change to the materials' public parameters or outputs. A draft YieldFunctionPolicy concept would document what the yield-function policies must provide.

All references are to main at 91bd26f.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions