Closed gatling-nrl closed 3 months ago
I'm away from a terminal now but is it that mesh
here is very small and all boundary so that all its degrees of freedom are enforced by the essential condition?
No, I see that it is indeed only because A
is a ‘zero matrix’, not because D.size == A.shape[0]
; the behaviour is essentially unchanged by appending .refined()
to the first line.
That's right. And i first noticed it on a much larger gmsh generated mesh. You might wonder how this came up, and it's because I'm extending some codes to support complex numbers, but when using those codes to run purely real things or purely imaginary things, you end up a zero matrix like this.
Yes, I was wondering momentarily about applying essential conditions to degrees of freedom in the kernel of an operator, but I decided that that might not be up to enforce
to question, the choice being left to the user.
A fix looks easy enough. The problem is that enforce
is trying to zero rows that are already zero—or rather (and this explains why the hack A[A==0]=0
works) not there in the sparse representation of A
.
I don't think this should work. Such matrix cannot be invertible. Do you think we should add explicit zeros to the diagonal of all inputs? What is the use case?