Closed Ziemnono closed 2 years ago
Arnaud did you find where the difference came from?
Hi @jnbrunet, Yes indeed, as Jack pointed out, FEniCS is choosing automatically the quadrature degree. For quadratic tetrahedron, we used quadrature of degree 2 in Caribou, so I forced FEniCS to also use the same quadrature degree. This is the result of the same previous example. We see that FEniCS is 10 times faster than before and also slightly faster than Caribou :)
Time step : 0
Context : /sofa_node
Max number of iterations : 25
Residual tolerance (abs) : 1e-05
Residual tolerance (rel) : 1e-10
Correction tolerance (abs) : 1e-05
Correction tolerance (rel) : 1e-15
Newton iteration #1 |R| = 1.687765e+05 |R|/|R0| = 1.000000e+00 |du| = 3.533437e+02 |du| / |U| = 1.000000e+00 Time = 60 ms
Newton iteration #2 |R| = 3.190437e+04 |R|/|R0| = 1.890333e-01 |du| = 8.710124e+01 |du| / |U| = 2.703041e-01 Time = 22 ms
Newton iteration #3 |R| = 1.854729e+03 |R|/|R0| = 1.098926e-02 |du| = 3.032463e+01 |du| / |U| = 1.017289e-01 Time = 18 ms
Newton iteration #4 |R| = 1.113557e+03 |R|/|R0| = 6.597823e-03 |du| = 1.337765e+01 |du| / |U| = 4.329553e-02 Time = 18 ms
Newton iteration #5 |R| = 6.940493e+01 |R|/|R0| = 4.112239e-04 |du| = 6.147766e+00 |du| / |U| = 1.951930e-02 Time = 16 ms
Newton iteration #6 |R| = 3.601234e+00 |R|/|R0| = 2.133729e-05 |du| = 1.262625e+00 |du| / |U| = 3.993332e-03 Time = 18 ms
Newton iteration #7 |R| = 1.631458e-03 |R|/|R0| = 9.666382e-09 |du| = 2.773893e-02 |du| / |U| = 8.772310e-05 Time = 19 ms
Newton iteration #8 |R| = 3.711575e-09 |R|/|R0| = 2.199106e-14 |du| = 3.061373e-05 |du| / |U| = 9.681453e-08 Time = 16 ms
[CONVERGED] The residual's norm |R| = 3.71157e-09 is smaller than the threshold of 1e-05.
[INFO] [StaticSolver] ======= Starting static ODE solver =======
Time step : 0
Context : /fenics_node
Max number of iterations : 25
Residual tolerance (abs) : 1e-05
Residual tolerance (rel) : 1e-10
Correction tolerance (abs) : 1e-05
Correction tolerance (rel) : 1e-15
Newton iteration #1 |R| = 1.687765e+05 |R|/|R0| = 1.000000e+00 |du| = 3.533437e+02 |du| / |U| = 1.000000e+00 Time = 40 ms
Newton iteration #2 |R| = 3.190439e+04 |R|/|R0| = 1.890333e-01 |du| = 8.710124e+01 |du| / |U| = 2.703041e-01 Time = 20 ms
Newton iteration #3 |R| = 1.854733e+03 |R|/|R0| = 1.098928e-02 |du| = 3.032469e+01 |du| / |U| = 1.017292e-01 Time = 18 ms
Newton iteration #4 |R| = 1.113562e+03 |R|/|R0| = 6.597851e-03 |du| = 1.337769e+01 |du| / |U| = 4.329566e-02 Time = 16 ms
Newton iteration #5 |R| = 6.940510e+01 |R|/|R0| = 4.112249e-04 |du| = 6.147781e+00 |du| / |U| = 1.951935e-02 Time = 15 ms
Newton iteration #6 |R| = 3.601271e+00 |R|/|R0| = 2.133751e-05 |du| = 1.262632e+00 |du| / |U| = 3.993356e-03 Time = 17 ms
Newton iteration #7 |R| = 1.631277e-03 |R|/|R0| = 9.665311e-09 |du| = 2.773915e-02 |du| / |U| = 8.772381e-05 Time = 15 ms
Newton iteration #8 |R| = 3.310869e-09 |R|/|R0| = 1.961688e-14 |du| = 3.061413e-05 |du| / |U| = 9.681580e-08 Time = 15 ms
[CONVERGED] The residual's norm |R| = 3.31087e-09 is smaller than the threshold of 1e-05.
During the NR iterations, we observed slight differences between FEniCS and SOFA forcefield. For example with NeoHooke, linear tetrahedron we even observe that FEniCS is faster than SOFA:
But for quadratic tetrahedron FEniCS is much much slower:
What could cause this difference? @Ziemnono check the number of quadrature points used in FEniCS compared with SOFA.