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

Add stress test for 3d and combine in one function #208

Closed henrij22 closed 11 months ago

henrij22 commented 11 months ago

This is a small PR adding a stress test for linear 3D cube elements . We should discuss for a different PR how and if we want to modify this whole testing framework, maybe storing the expected values in the element formulation or sth like that.

For reference: my calulations come from these notebooks: https://github.tik.uni-stuttgart.de/HenrikJakob/elements-notebooks/tree/main

I might also add a test for 3d cube with EAS tommorow, so we can also add this to this PR

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7e793d0) 89.81% compared to head (878870b) 91.55%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #208 +/- ## ========================================== + Coverage 89.81% 91.55% +1.73% ========================================== Files 44 42 -2 Lines 1904 1787 -117 ========================================== - Hits 1710 1636 -74 + Misses 194 151 -43 ``` | [Flag](https://app.codecov.io/gh/ikarus-project/ikarus/pull/208/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/208/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ikarus-project) | `91.55% <ø> (+1.73%)` | :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.

henrij22 commented 11 months ago

I think that should work nicely. The good thing, is that we can then test everything (where we have nodal resutlts), not just stresses. I think for now i will stick to Eigen::Matrix to keep it simple, but in the feature we can also think about C++ 23 with its std::mdspan (here)

henrij22 commented 11 months ago

@rath3t i think I have found a rather elegant way for the generalization. In the new file resultcollection.hh i created a lambda that gives the appropriate expectedResults, and then they are tested in the checkCalulateAt() Function

henrij22 commented 11 months ago

If the CI is successfull, this should be ready from my side

rath3t commented 11 months ago

Thanks Henri. Nice addition!