Closed mrp089 closed 3 months ago
I checked my old results when I created this test case, and the convergence is much better
---------------------------------------------------------------------
Eq N-i T dB Ri/R1 Ri/R0 R/Ri lsIt dB %t
---------------------------------------------------------------------
ST 1-1 1.930e-01 [0 1.000e+00 1.000e+00 9.859e-07] [113 -11 7]
ST 1-2 3.680e-01 [-19 1.073e-01 1.073e-01 9.834e-07] [98 -62 7]
ST 1-3 5.670e-01 [-59 1.101e-03 1.101e-03 9.644e-07] [97 -60 6]
ST 1-4s 7.740e-01 [-154 1.977e-08 1.977e-08 1.332e-05] [79 -34 5]
Perhaps something changed since I added this test? Maybe during material model restructuring here: https://github.com/SimVascular/svFSIplus/pull/159
Found a tiny bug in mat_models_carray.h line 946
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
for (int k = 0; k < N; k++) {
for (int l = 0; l < N; l++) {
CCb[i][j][k][l] += g1 * Hss_prod[i][j][k][l];
}
}
}
}
//CCb = CCb + g2*ten_dyad_prod(Hss, Hss, nsd);
As shown in the commented line, it should be g2
instead of g1
.
With this change, convergence is excellent
---------------------------------------------------------------------
Eq N-i T dB Ri/R1 Ri/R0 R/Ri lsIt dB %t
---------------------------------------------------------------------
ST 1-1 4.700e-02 [0 1.000e+00 1.000e+00 8.962e-07] [84 -45 17]
ST 1-2 9.500e-02 [-25 5.159e-02 5.159e-02 9.870e-07] [92 -55 15]
ST 1-3 1.440e-01 [-74 1.835e-04 1.835e-04 9.218e-07] [89 -51 18]
ST 1-4s 2.060e-01 [-194 1.800e-10 1.800e-10 1.448e-03] [47 -65 5]
Will make a pull request
Raises an interesting question. Is it possible to make our testing detect poor convergence, not just incorrect results?
Thank you for looking into it! That's a good point. I'm currently cranking up all tolerances (#175) to get more reproducible results. I could then set the max number of Newton iterations to the current one. If the tests are sensitive enough, they should fail if the solver takes way more iterations.
Description
While adding missing results to test cases (#175), I noticed that the test
struct/LV_Holzapfel_passive
(using theHolzapfel
material) has a very slow nonlinear convergence.Reproduction
In
tests
, runpytest -vrx -k LV_Holzapfel
This is the output I get:
I increased
Max_iterations
and setTolerance = 1e-10
.Expected behavior
Should converge to this tolerance in ~5 Newton iterations.
Additional context
@ktbolt, @aabrown100-git, have you used this material outside this test case? If this slow convergence also appears outside of this test case, the linearization is incorrect.
Code of Conduct