Hello,
I wish to create a numerical conductivity coefficient matrix, C, which would be part of the variational statement
a = dot(C*grad(u),grad(v))*dx
for TrialFunction u and TestFunction v.
I have the elements of the coefficient matrix at each node in the mesh stored in files and I intend to read the data into a numpy array, for example, for the numpy array c00:
c00 = read_data(“c00.dat”)
…
(read_data() is just some routine to get the numbers from the file c00.dat into the numpy array c00.)
I also know that I can create the matrix C using as_matrix:
C = as_matrix(((C00,C01,C02),(C01,C11,C12),(C02,C12,C22)))
(C is symmetric).
My question is how do I convert the numpy arrays c00, etc, into the quantities C00, etc, (and what type are the quantities C00)?
Perhaps I should not be using as_matrix in this instance? If so, what is the alternative? Can I simply write
C = ((c00,c01,c02),(c01,c11,c12),(c02,c12,c22))?
Also, should I have the conductivity values specified at each node or for each element in the mesh?
Thanks very much,
Peter.