Skip to content

Conversation

@rishabharora236-cell
Copy link
Collaborator

This update introduces 2D J2 plasticity implementation for quadrilateral meshes.

Key Changes:

New Files:

Added a new example script implementing J2 plasticity for a 2D quad mesh.

Added a new loss function module for element-level computation (currently supports only quad meshes).

Modified Files:

FEM utilities: Updated to include computations at the Gauss point level for elastoplastic behavior.

Solver module: Added a new function that supports solving with history-dependent parameters.

fe_loss.py: Adjusted existing functions to handle optional history parameters without breaking backward compatibility. This may appear a bit messy since I prioritized maintaining compatibility with existing functions rather than introducing entirely new ones. A cleaner refactor can also be done.

@RezaNajian RezaNajian force-pushed the feat/2D_Elastoplasticity_FEM branch from df79228 to 9ba1f80 Compare November 26, 2025 16:19
@RezaNajian
Copy link
Owner

@rishabharora236-cell

Thanks a lot for your work on introducing the 2D elastoplasticity (J2) implementation — this is a great addition to the framework and a significant step forward. I went through the code in detail and refactored/cleaned several parts to improve structure, readability, and maintainability.

All relevant element-level and history-dependent computations have now been moved into:

  • mechanical_elastoplasticity.py
  • fe_nonlinear_residual_based_solver_with_history_update.py

The example script has also been moved into a dedicated elastoplasticity/ folder for better project organization and overall cleanliness.

✔ Follow-up actions

Please take a look at mechanical_2d_elastoplasticity.py and update the code after line 98 to align with the new structure.

Additionally, it would be great if you could address the following items:

  1. Add a Unit Test
    Please provide a unit test for the newly introduced mechanical_elastoplasticity loss function so we can properly validate behavior and avoid regressions.

  2. Improve Example Readability
    Please reorganize and polish mechanical_2d_elastoplasticity.py to make it more readable and structured, especially for new users exploring elastoplastic simulations.

  3. Extend to 3D and Additional Element Types
    As a next step, please consider extending the implementation to:

    • 3D elements
    • Other element types (triangles, hexahedra, etc.)

    The structure in mechanical_elastoplasticity.py was designed to allow these extensions naturally.


Thanks again for your contribution — your work is helping shape a robust and extensible elastoplastic FEM module! Let me know if you need any support with the follow-up tasks.

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.

3 participants