Skip to content

[IN REVIEW] Refactor EAS to handle NonLinearElastic #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 2, 2025

Conversation

tarun-mitruka
Copy link
Collaborator

@tarun-mitruka tarun-mitruka commented Sep 19, 2024

This PR focuses on refactoring enhancedassumedstrains.hh such that it is compatible also with nonlinearelastic.hh.

See CHANGELOG.md for more details.

See also Issue #331.

DONE

  • Include updateState(/*...*/) in mixin.hh
  • Get rid of noAssembler() argument for nonlinop construcor
  • Does updateStateImpl() need to be a template of scalartype?
  • Incorporate the call of the updateState() function in nonlinear solvers. (see below the call by FEGenericObserver as an example)
  • Check if AutoDiff tests could be refactored even further
  • Can we make a default implementation for updateState() or does every element need to implement this - Every element has to implement as it can then also be used for instance to update history variables while working with plasticity.
  • Add tests performing a nonlinear analysis along with the EAS method.
  • Fix/Add Python bindings accordingly
// In newtonraphson.hh
this->notify(NonLinearSolverMessages::SOLUTION_UPDATED, correction_);

// In main.cpp
auto updateStateObserver = std::make_shared<Ikarus::FEGenericObserver<Ikarus::NonLinearSolverMessages>>(
    Ikarus::NonLinearSolverMessages::SOLUTION_UPDATED, [&](const Eigen::VectorXd& correction_) {
      for (auto& fe : fes) {
        req.insertGlobalSolution(Ikarus::FESolutions::displacement, D_Glob)
            .insertParameter(Ikarus::FEParameter::loadfactor, lambda);
        fe.updateState(req, correction_);
      }
});

nr->subscribeAll({updateStateObserver });

OTHER PR

@tarun-mitruka tarun-mitruka added enhancement New request to enhance existing features feature New feature labels Sep 19, 2024
@tarun-mitruka tarun-mitruka mentioned this pull request Sep 19, 2024
6 tasks
@tarun-mitruka tarun-mitruka force-pushed the NonlinearEAS branch 3 times, most recently from 3f72a67 to 5761ccd Compare September 27, 2024 13:42
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 75.14286% with 87 lines in your changes missing coverage. Please review.

Project coverage is 52.33%. Comparing base (7ba0bcb) to head (b3d4685).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rainenhancements/easvariants/linearandglstrains.hh 23.75% 61 Missing ⚠️
...ements/mechanics/strainenhancements/easvariants.hh 64.28% 10 Missing ⚠️
ikarus/utils/tensorutils.hh 0.00% 10 Missing ⚠️
...finiteelements/mechanics/enhancedassumedstrains.hh 97.19% 3 Missing ⚠️
ikarus/finiteelements/mixin.hh 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
+ Coverage   51.98%   52.33%   +0.34%     
==========================================
  Files          84       86       +2     
  Lines        2697     2725      +28     
==========================================
+ Hits         1402     1426      +24     
- Misses       1295     1299       +4     
Flag Coverage Δ
tests 52.33% <75.14%> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tarun-mitruka tarun-mitruka force-pushed the NonlinearEAS branch 2 times, most recently from 3cbc683 to 572e568 Compare October 10, 2024 12:57
@tarun-mitruka tarun-mitruka marked this pull request as ready for review October 10, 2024 13:02
@tarun-mitruka tarun-mitruka requested a review from rath3t October 10, 2024 13:02
@tarun-mitruka
Copy link
Collaborator Author

@rath3t The C++ side of this PR is ready for the first review, the Python bindings side will be updated after the C++ side is converged in either this PR or via a separate PR by @henrij22

@tarun-mitruka tarun-mitruka changed the title [DRAFT] Refactor EAS to handle NonLinearElastic [IN REVIEW] Refactor EAS to handle NonLinearElastic Oct 10, 2024
@tarun-mitruka tarun-mitruka force-pushed the NonlinearEAS branch 4 times, most recently from b2c03d4 to 022022c Compare October 21, 2024 15:08
@tarun-mitruka tarun-mitruka force-pushed the NonlinearEAS branch 2 times, most recently from 7437c55 to ffa7248 Compare October 29, 2024 15:53
@tarun-mitruka tarun-mitruka marked this pull request as draft October 30, 2024 08:04
@tarun-mitruka
Copy link
Collaborator Author

This PR is converted to draft as it can only be fixed after #349 is merged.

@henrij22 henrij22 force-pushed the NonlinearEAS branch 2 times, most recently from 800cc86 to d9c6b54 Compare March 14, 2025 12:35
@henrij22 henrij22 requested a review from rath3t March 14, 2025 14:45
@tarun-mitruka tarun-mitruka marked this pull request as ready for review March 14, 2025 15:24
@tarun-mitruka tarun-mitruka changed the title [DRAFT] Refactor EAS to handle NonLinearElastic [IN REVIEW] Refactor EAS to handle NonLinearElastic Mar 14, 2025
Copy link
Collaborator

@rath3t rath3t left a comment

Choose a reason for hiding this comment

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

See comments

@tarun-mitruka tarun-mitruka requested a review from rath3t March 21, 2025 15:29
@tarun-mitruka
Copy link
Collaborator Author

Hey @rath3t , apart from my comments above, I did the remaining changes

Copy link
Collaborator

@rath3t rath3t left a comment

Choose a reason for hiding this comment

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

You can check both of my comments and then merge this thing. Thanks!

@tarun-mitruka
Copy link
Collaborator Author

@rath3t and @henrij22 I am sorry I refactored everything again because the older implementation still disregarded the geometric stiffness contribution for L_ and D matrices making them still not applicable for the general case. I now use a design similar to dune-localfefunctions which makes it much more convenient to add more EAS variants. Once the CI runs, this PR can be reviewed (or merged :D)

Copy link
Collaborator

@henrij22 henrij22 left a comment

Choose a reason for hiding this comment

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

Maybe mention the interface change of EAS in the CHANGELOG?

@tarun-mitruka
Copy link
Collaborator Author

@rath3t I am now merging this PR. If you have see (major) corrections to be done, of course let me know and I will incorporate it in a separate PR. Thanks both of you for all the comments and corrections until now.

@tarun-mitruka tarun-mitruka merged commit c451510 into main Apr 2, 2025
33 of 34 checks passed
@tarun-mitruka tarun-mitruka deleted the NonlinearEAS branch April 2, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New request to enhance existing features feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants