-
Notifications
You must be signed in to change notification settings - Fork 27
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
Slow nonlinear convergence in ustruct/LV_Guccione_active #197
Comments
The original simulations I did for
|
That looks much better than the current convergence. However, it's still hard to say if the original simulation converged well. We would have to see how many iterations it takes the nonlinear solver to converge (i.e. not change anymore at something like It's a different setup, but that's the convergence of
|
The results matched Fortran (if that is meaningful). The Fortran tolerances are set to 1e-4. |
Note that when using svSolver a residual of 1e-3 is considered to be a converged solution. |
What I find concerning with
There's a clear difference between physics that converge quadratically ( You can also nicely see when the simulations converge: The residual becomes asymptotic and just oscillates through noise. For testing, we need a converged solution to compare it across different platforms, library versions, number of processors, ... . The specific tolerance for that varies from test case to test case because it's a relative norm. That's why I went through all test cases in #175 and adapted that value for each test case. From the discussions this week, it seems like |
@mrp089
Something is probably not right in the
|
Sorry for the delay. Just adding another data point to this discussion. I just ran my 0D-coupled biventricular case with ustruct and the HO-ma material model, using https://github.com/vvedula22/svFSI. Here is the convergence history
(The not-quite-quadratic convergence may be related to the 0D-coupling) |
I found some likely typos/discrepancies in the 1) ustruct Guccione model and 2) ustruct follower pressure load. These changes can be found in this commit: 751b966 I made these changes to match the following lines in svFSI (Fortran) code Unfortunately, after making these changes, the convergence for ustruct/LV_Guccione_active is still not good. There must be another bug in the tangent somewhere, but I've gone through the Guccione model in get_pk2cc_dev() several times and can't find anything. Still, these appear to be typos so I'll submit a pull request for this. |
I just added some material model tests to test the correct implementation of the 2nd PK stress and it's linearization, the material elasticity tensor (#225, #229). I'm wondering if it's possible and worthwhile to try a similar approach to test the linearization of various implementations in a general way. I'm thinking, for example, we could use finite difference to testing whether struct_3d_carray(..., lR, lK) produces a local tangent Alternatively, maybe it would be more generalizable to test higher level functions, like I think by extending the mock objects currently used for material model testing, these things should be possible with a bit of work. Let me know any thought, potential issues, or other ideas! |
I think this is a great idea! I used an FD tangent on an element and global level in an abandoned G&R approach (maybe there's something useful in there). You need to make an additional modification to the assembly, which currently does residual and tangent simultaneously. If you calculate the residual repeatedly as in FD, it adds to your tangent every time. I thus split up the assembly of residual and tangent (there might be a more elegant way to do this). |
I'm making changes in this branch. I'm not sure I need to split up the assembly of residual and tangent. So far, I've encapsulated the residual and tangent calculation into a single function, called |
@aabrown100-git Like you mentioned above I think it is important to ask if this is And this Issue seems to be moving away from its initial purpose. Open another Issue so your testing ideas are not buried in an unrelated Issue. |
@ktbolt Thanks for the thoughts. I think testing if the tangent is consistent with the residual would be somewhat useful. To provide the argument against doing this, we can more or less tell if the tangent is consistent with the residual by just observing the convergence behavior, essentially as Martin did earlier in this issue. @mrp089 Any additional thoughts on this? |
@aabrown100-git If this testing helps understand the code then have at it! @alisonmarsden @dcodoni It would be good to identify tasks and set priorities that will help evolve the code towards a real C++ implementation. |
Description
While adding missing results to test cases (#175), I noticed that the test
ustruct/LV_Guccione_active
has a very slow nonlinear convergence.Reproduction
In
./tests
, runpytest -vrP -k LV_Guccione_active
or have a look at this pipeline.I increased
Max_iterations
and setTolerance = 1e-12
.Expected behavior
Should converge to this tolerance in ~5 Newton iterations.
Additional context
@ktbolt, @aabrown100-git, similar to #189, was there anything changed recently in
ustruct
or in theGuccione
material? Have you used a setup like this in a more "real world" example?Code of Conduct
The text was updated successfully, but these errors were encountered: