Hi Ian, Sorry for the slow response.
On Thu, Jan 12, 2017 at 12:20 PM, Campbell, Ian <i.campbel...@imperial.ac.uk> wrote: > > 1) Applying numerix.array() to ‘L’, when ’L’ is of type > 'fipy.matrices.scipyMatrix._ScipyMeshMatrix', creates a zero-dimensional > ndarray, with no shape. This isn’t what we expected because L has diagonal > numerical values & ‘---‘ where its sparse “entries” are. > Our goal is to obtain ‘L’ using your suggested method and then to convert it > into the SciPy sparse.csc_matrix format for further processing. The input to > SciPy’s csc_matrix function must be a rank-2 ndarray, but (reasonably > enough!) this fails when we pass csc_matrix a zero-dimensional ‘L’ matrix. See, https://github.com/usnistgov/fipy/blob/develop/fipy/matrices/scipyMatrix.py#L266 I think you need the "matrix" attribute of "fipy.matrices.scipyMatrix._ScipyMeshMatrix" and I think that is the raw Scipy version of the matrix (whatever format that is). You can then call "toarray()" on that is seems. My previous instructions were wrong. So just using "L.numpyArray" should also achieve the same. > 2) We see from the 2009 paper that it’s a three-point stencil used for the > generation of the discretisation matrix in a first order scheme. What > stencil is used for 2nd order schemes? Depends on the term of course, but for a diffusion term on a square grid it is the same as finite difference which would be a 5 point stencil. The convection terms are mostly first order as currently implemented in FiPy. This is a good book for FV method, http://www.springer.com/us/book/9783319168739, which describes some of the schemes. > 3) How do we implement a higher (e.g. 8th & 12th order central-difference) > order schemes in FiPy? That's not easy at all. I don't think it is designed well enough for that. It would require a major rewrite to easily add new convection schemes. Cheers, Daniel -- Daniel Wheeler _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]