I’m working on a linear time-evolution problem with a symmetric differential operator. By chance, I have discovered that the matrix assembled by assemble_system
, denote it A
, is not symmetric. Inquiring further however, I have discovered that A
is “almost” symmetric, meaning that the entries of the difference A-A.T
are very small compared to the entries of A
itself (the max(abs(A-A.T))
ca. 7e-15
and max(abs(A))
ca. 40
). So it appears that A
is a symmetric matrix plus some numerical distortion.
Next, playing around with simple variational forms I have discovered that “almost symmetric” matrices are in fact quite common output of assemble_system
. So I assume there must be some good practices to deal with such matrices.
I would like to find out a bit about such good practices. To start, I would like to ask the following questions:
-
Does “almost symmetry” have a negative impact on the behavior of symmetric solvers? For example, Conjugate Gradient is known to suffer from the loss of conjugacy of subsequent search directions which may result from the accumulation of numerical error. Isn’t even a small distortion to the matrix symmetry an issue likely to amplify such undesired effects and so obstruct the convergence of Conjugate Gradient?
-
Are there any tricks in FEniCS that help make the assembled matrix symmetric? I have been trying to obtain symmetry by changing the
epsilon
parameter passed toassemble_system
via the argumentform_compiler_parameter
, but with no success. I have also tried to clip very small entries of the already assembled matrix to zero (since such elements are likely to be just distorted zeros), but the resulting matrix also was non-symmetric. -
Would it be a good idea to replace the “almost symmetric” matrix
A
with the exactly symmetric matrixB=0.5*(A+A.T)
and callsolve
onB
rather thanA
? Would there be any ill side effects of such trick which I should beware of?
If anyone feels wizard enough to shed some light on these issues, please do not hesitate to answer.
FEniCS version: 2019.1.0
Installation method: Docker image
I don’t attach an MWE since I find it not necessary in the context of this topic. If an MWE will turn out helpful in the run of discussion, I will post one.