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

Allow to disable Navier-Stokes source term in MF #1124

Closed lpsaavedra closed 3 months ago

lpsaavedra commented 3 months ago

Description of the problem

The evaluation of the source term function, even if it was zero, was affecting the performance of the matrix-free application, as the evaluation needed to be executed every time we performed a vmult using the matrix-free operators.

Description of the solution

This PR adds a new enable parameter that allows to disable the source term explicitly in the matrix free application. It allows to reset the pointer of the forcing function in mf_navier_stokes.cc and consequently to check within the matrix-free operators if the pointer exists or not, to evaluate the source term function.

How Has This Been Tested?

Documentation

Future changes

blaisb commented 3 months ago

@lpsaavedra you have a merge conflict now since I merged the other PR. Can you rebase?

lpsaavedra commented 3 months ago

I have rebased now @blaisb