Skip to content

Clean up (Navier-)Stokes operators

@marian and I just discussed a major cleanup for the Navier-Stokes operators (in particular the DG version) and have identified the following problems:

  • Right now, the implementation is very inefficient:
    • The jacobian-based implementation of the residuals in StokesDG means that every residual evaluation requires a local matrix assembly.
    • NavierStokesDG even compounds the issue by forwarding the linear part of the operator to the base class and then assembling the non-linear part on top of it, requiring two separate quadrature loops.
    • alpha_volume() in NavierStokesDG makes for the icing on the cake: It calls the jacobian-based residual evaluation of StokesDG and then directly implements the non-linear residual.
  • The current naming scheme is rather unfortunate, with TaylorHoodNavierStokes and NavierStokesDG etc.

We have come up with the following solution:

  • Merge the Stokes and the Navier-Stokes implementations into a single class and use a compile time flag in the parameter class to toggle the non-linear part of the operator.
  • Directly implement the residuals.
  • Call the new operator DGNavierStokes
  • Do the same thing for StokesDGMass and call it DGNavierStokesMass
  • Put the new operators into a new file dgnavierstokes.hh
  • Introduce a new, unified parameter class DGNavierStokesParameters' (that still inherits from NavierStokesDefaultParmaters) and put it into dgnavierstokesparameters.hh`
  • Deprecate all classes with -DG suffix and the files stokesdg.hh and stokesdgparameters.hh.

I'll also do a minor cleanup of the Taylor-Hood version, but that will be tracked separately.