Closed JoshuaLampert closed 5 months ago
There are some quite significant changes in the reference values in the CG case...
It looks like some reference values changed
It looks like some reference values changed
It looks like they changed a bit too much. This, e.g., doesn't look good :grimacing:
It looks like they changed a bit too much. This, e.g., doesn't look good 😬
Ah, the system matrix is not symmetric in the CG case.
Right, something like
M * (Diagonal(h) - D1betaD1)
should be symmetric (in the usual sense) since the operator we wrap right now is symmetric with respect to the mass matrix M
, isn't it?
Yes, exactly. $M(\textrm{diag}(h) - D_1\textrm{diag}(\beta) D_1)$ is guaranteed to by symmetric and also positive definite (since $M$ positive definite, $h > 0$, and $\beta > 0$ due to $\tilde\beta > 0$ and $D > 0$):
$$ x^T(M\textrm{diag}(h) - MD_1\textrm{diag}(\beta) D1)x = \underbrace{x^TM\textrm{diag}(h)x}\{> 0} + \underbrace{(D_1x)^TM\textrm{diag}(\beta) D1x}\{\ge 0}>0 $$
Thus, it makes more sense to always apply the Cholesky decomposition to $M(\textrm{diag}(h) - D_1\textrm{diag}(\beta) D_1)$. Thanks for the hint! I've pushed an adapted version in 0643d81. Let's hope CI passes now.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 96.83%. Comparing base (
bda70af
) to head (0643d81
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Closes #107. Let's see if CI is happy with the
cholesky
decomposition this time. It is significantly faster and less allocating thanlu
. Since we know thathmD1betaD1
is sparse sinceD1betaD1
is constructed to be sparse, I only implemented the first branch in your proposal https://github.com/JoshuaLampert/DispersiveShallowWater.jl/issues/107#issuecomment-2127693468, @ranocha.Result of
julia> include("examples/svaerd_kalisch_1d/svaerd_kalisch_1d_dingemans.jl");
formain
:and this branch (note that I added some
@timeit
statements to have a better overview):cholesky!
still allocates more than I would have hoped, but I think there is not much we can do against, right? But overall this is a nice speedup.