chaos-polymtl / lethe

Repository for the open-source lethe CFD/DEM/CFD-DEM project
https://chaos-polymtl.github.io/lethe/index.html
GNU Lesser General Public License v2.1
267 stars 59 forks source link

Precalculate stabilization parameters for MF operators #1117

Closed lpsaavedra closed 3 months ago

lpsaavedra commented 3 months ago

Description of the problem

The stabilization parameter was being computed every time the vmult and evaluate_residual functions of the matrix-free operators were called. However, this is not needed and was affecting the performance of the matrix-free application.

Description of the solution

The stabilization parameter is now precomputed and stored in a table before using it in those function calls. Since its computation involves the values of the velocity of the previous newton step, the stabilization parameter is now calculated within the evaluate_non_linear_term(...) function, which has been now renamed to evaluate_non_linear_term_and_calculate_tau(...) for consistency.

How Has This Been Tested?