Skip to content

- matrix transformation interface, example, tests

James Sutherland requested to merge matrix-transformation into master

This is an example and a few tests of simple matrix transformations through a nice interface, and an expression that uses them for some linear algebra. With no transformation, the DiagonalMatrixFormationInversionTestExpr computes the reciprocals of several fields by constructing a matrix inside evaluate and solving a linear system. The transformations here simply multiply the diagonal by some factor.

In the case that this factor is an expression we need to introduce a dependency, which is accomplished by providing tags required by the transformation object during construction of the expression. On execution, the transformation is fed the FieldMatrix and the vector of field requests from the expression. The matrix is transformed in place. The transformation acts on a matrix with an 'apply' method that could be a sparse mat-mat right-multiply as I've formulated the thermochemical state transformations.

This test covers the cases of no transformation, transformation with a constant that is not a field, with a constant that is a field, and with two constants that are both fields.

Merge request reports