-
Notifications
You must be signed in to change notification settings - Fork 3
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
[IWIP] add a wrapper for (hyper)elastic materials from the muesli library #337
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #337 +/- ##
==========================================
+ Coverage 78.99% 80.33% +1.33%
==========================================
Files 69 73 +4
Lines 2238 2349 +111
==========================================
+ Hits 1768 1887 +119
+ Misses 470 462 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Henri for this PR. Comparing it with #333, I think from this PR we not only get LinearAnisotropic
and LinearOrthotropic
as the new material models, but also now have an interface to work with Muesli material models, which can be used later for instance to incorporate plasticity, etc. I would also propose the following:
- Of course the container has to be fixed in the workflows.
LinearAnisotropic
andLinearOrthotropic
can be tested withplaneStrain
(andplaneStress
) to see if it works correctly. This can also be investigated in a separate PR with a new issue opeend to add these tests- Also, I think this PR can be merged after [IN REVIEW] Add Hyperelastic and AutoDiff-based Material models #333, as [IN REVIEW] Add Hyperelastic and AutoDiff-based Material models #333 also provides more rigorous tests on hyperelastic material models, to which Muesli models can also be exposed to. Also certain testhelpers are included there which can also be used here.
ikarus/finiteelements/mechanics/materials/muesli/mueslifinite.hh
Outdated
Show resolved
Hide resolved
ikarus/finiteelements/mechanics/materials/muesli/mueslifinite.hh
Outdated
Show resolved
Hide resolved
} | ||
|
||
/** | ||
* \brief Converts the entries of a Eigen::Matrix to a provided muesli::tensor (symmetric 2nd order tensor). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these conversions should not be needed if muesli is configured with WITHEIGEN=TRUE
. Then istensor is basically an eigen object https://bitbucket.org/ignromero/muesli/src/27e8204971602cb042d633b8b5f87761272b10df/muesli/tensor.h?at=master#lines-55
ikarus/finiteelements/mechanics/materials/muesli/mueslimaterials.hh
Outdated
Show resolved
Hide resolved
mutable itensor4 tangentModuli_{}; | ||
|
||
template <typename Derived> | ||
void updateState(const Eigen::MatrixBase<Derived>& C) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A method called updateState should not be marked const
. If the strain objects are directly Eigen types then you also do not need the evil mutable variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can of course get rid of the mutable variables, my motivation was to avoid allocating at each evaluation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we couldn't get Eigen to work, should we leave it like that or should I get rid of the mutable member variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks quite nice already. If we merge the docker container and look into some points here, then this is mergeable.
@@ -36,6 +37,12 @@ int main(int argc, char** argv) { | |||
Ikarus::LinearElasticity lin(Ikarus::toLamesFirstParameterAndShearModulus(parameter)); | |||
return Ikarus::linearElastic(lin); | |||
}; | |||
#if ENABLE_MUESLI | |||
auto linearElasticFunc3D_Muesli = [](const Ikarus::YoungsModulusAndPoissonsRatio& parameter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test here neccesary?
DO NOT MERGE YET
before