Hi Anna,
On 12/11/15 12:38, Anna Kalogirou wrote:
Hi Lawrence,
In the email below you explained to me how to define a matrix free
operator B. Is there a way to inspect the values of the matrix behind
this operator?
Assuming that you are not running in parallel, and you do not have two
many degrees of freedom in your problem (I guess you want to look at
the values for a small system), you can do the following:
ctx = B.getPythonContext()
dense_A = ctx.A[:, :]
Q1_array = ctx.Q1.array_r
Q2_array = ctx.Q2.array_r
import numpy as np
dense_B = dense_A + np.outer(Q1_array, Q2_array)
print dense_B
Cheers,
Lawrence
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake