- marked as critical
Wrong definition of cofactor
Issue #1
resolved
The implementation of the cofactor, in ufl/algorithms/expand_compounds.py, line 125, is misleading, since the returned value is not the cofactor matrix, but the adjoint matrix, which is the transpose of the former.
The issue can be easily addressed: for instance, the code
return as_matrix([[A[1,1], -A[0,1]], [-A[1,0], A[0,0]]])
becomes
return as_matrix([[A[1,1], -A[1,0]], [-A[0,1], A[0,0]]])
and so on for n=3 and n=4.
Then, also the inverse matrix must be fixed accordingly (line 168):
return self.cofactor(None, A) / self.determinant(None, A)
to
return self.transposed(None, self.cofactor(None, A)) / self.determinant(None, A)
An alternative could be to introduce a new operator ``adjoint'', but the name might be too generic in dolfin.
Comments (3)
-
-
-
assigned issue to
-
assigned issue to
-
- changed status to resolved
Resolved. Note that this means all previous users of cofac must update their programs.
- Log in to comment