-
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
[IN REVIEW] Refactor EAS to handle NonLinearElastic #325
base: main
Are you sure you want to change the base?
Conversation
3f72a67
to
5761ccd
Compare
0a215a0
to
81eae4d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #325 +/- ##
==========================================
+ Coverage 78.99% 80.72% +1.72%
==========================================
Files 69 70 +1
Lines 2238 2309 +71
==========================================
+ Hits 1768 1864 +96
+ Misses 470 445 -25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
3cbc683
to
572e568
Compare
tests/src/testnonlineareas.cpp
Outdated
const auto controlInfo = lc.run(); | ||
|
||
double expectedLambda = 1.0; | ||
double expectedMaxDisp = 4.459851990227056; // abs(maxDisp) in ANSYS APDL = 4.48777 |
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 am not sure if this minor difference is acceptable here as ANSYS APDL is used more like a black box, where the control routine and nonlinear solver algorithms are not fully clear. Since the easAutoDiffTest
passes, I think the solution should be correct here.
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.
Shall I remove the APDL comment here or leave it?
@rath3t You didn't comment anything in the tests during your review process. Can it be assumed that no major changes are necessary there?
b2c03d4
to
022022c
Compare
7437c55
to
ffa7248
Compare
- A `helperfunctions.hh` file is added that contains the helper functions used by the nonlinear solvers. | ||
- This contains the function `updateStates()` that calls the `updateState()` function for every finite element. | ||
- `updateStates()` is called by nonlinear solvers during every iteration, whenever the correction vector is updated. | ||
- `NonLinearOperator` now has an additional template argument, `Assembler`. |
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.
IN my view the Nonlinear operator is by design only a collection of a function and its derivative.
There should be no template or object of an assembler. What should this be doing if all functions are just lambdas without any underlying assembler? But somehow I also dont see a nice solution to this we should chat about different posibilities of design choices. I think it can be already done with observers but this might be to indirect. E.g. all EAS element observe the non-linear solver and as soon as the solvers signals that the iteration or load step is finished the elements get notified and can update what they want. This seems nicer, since we dont have to refactor the design of nonlinearoperator.
Another thing would be a new class that contains a nonlinearoperator and the assembler.
Something similar I have done already in python branch for the solvers but Im not srue if we want that.
@@ -230,29 +232,34 @@ private: | |||
return mat_; | |||
} | |||
|
|||
protected: | |||
bool usesEASSkill() const { | |||
if constexpr (hasEAS) |
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.
We can also disable all the linear elastic functionality if eas is present and the eas method always deals with everything. Like calculateMatrix(...) requires not hasEAS
which would disable the function alltogether and we would not have the runtime switch with usesEASSkill()
.
} | ||
updateStates(nonLinearOperator().assembler(), correction_); |
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 dont like that introduction of states inside the innocent Newton-Raphson function.
This entangels unrelated functionality and might drop on our feet later, sicne extensibility is compromised since a local change somewhere else might affect this here.
@@ -377,6 +378,7 @@ public: | |||
|
|||
info_.randomPredictionString = ""; | |||
|
|||
updateStates(nonLinearOperator().assembler(), eta_); |
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.
same
*/ | ||
template <typename TypeListOne, typename TypeListTwo> | ||
template <typename TypeListOne, typename TypeListTwo, typename Assembler = Impl::NoAssembler> |
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 i said before this is not so nice
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.
See comment. But we should discuss this in person.
e9acc3d
to
ba64b12
Compare
030547e
to
4593681
Compare
To- Dos (New)
|
b733c54
to
a5ed1c9
Compare
4f1ca33
to
1729aba
Compare
@@ -100,29 +113,24 @@ public: | |||
* \tparam RT The type representing the requested result. | |||
*/ | |||
template <template <typename, int, int> class RT> | |||
requires(EnhancedAssumedStrains::template supportsResultType<RT>()) |
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 is neccesary 1) gcc won't compile otherwise and 2) that the correct function is chosen (idk why but if that is not here, then the function in nonlinear "wins" and nans are returned)
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 it due to the priority tags? For a similar reason, I added a default in feresulttypes.hh
to get zeros instead of nans, which I think is removed now
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.
My comment was in constrast to just requires(supportsResultType<RT>())
This PR focuses on refactoring
enhancedassumedstrains.hh
such that it is compatible also withnonlinearelastic.hh
.See
CHANGELOG.md
for more details.See also Issue #331.
DONE
updateState(/*...*/)
inmixin.hh
updateState()
function in nonlinear solvers. (see below the call byFEGenericObserver
as an example)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.OTHER PR