ikarus-project / ikarus

Ikarus is a C++-based library that uses DUNE modules to solve partial differential equations with the finite element method and more.
https://ikarus-project.github.io/
Other
6 stars 3 forks source link

[IN REVIEW] Refactor EAS to handle NonLinearElastic #325

Open tarun-mitruka opened 2 months ago

tarun-mitruka commented 2 months ago

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

// 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

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 93.04813% with 13 lines in your changes missing coverage. Please review.

Project coverage is 81.22%. Comparing base (f1928da) to head (503e6bb).

Files with missing lines Patch % Lines
...finiteelements/mechanics/enhancedassumedstrains.hh 92.75% 5 Missing :warning:
...karus/finiteelements/mechanics/nonlinearelastic.hh 91.66% 4 Missing :warning:
ikarus/finiteelements/mechanics/linearelastic.hh 93.02% 3 Missing :warning:
...olver/newtonraphsonwithscalarsubsidiaryfunction.hh 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #325 +/- ## ========================================== + Coverage 80.86% 81.22% +0.36% ========================================== Files 68 69 +1 Lines 2299 2397 +98 ========================================== + Hits 1859 1947 +88 - Misses 440 450 +10 ``` | [Flag](https://app.codecov.io/gh/ikarus-project/ikarus/pull/325/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ikarus-project) | Coverage Δ | | |---|---|---| | [tests](https://app.codecov.io/gh/ikarus-project/ikarus/pull/325/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ikarus-project) | `81.22% <93.04%> (+0.36%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ikarus-project#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tarun-mitruka commented 1 month ago

@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