Dear TJ, If you want to initialise from a known function then you should do this by interpolating an Expression into a Function. Note that your mesh initialisation is probably not what you intended either, please check the doc-string for RectangleMesh. all the best --cjc On 5 May 2016 at 18:31, Sun, Tianjiao <tianjiao.sun14@imperial.ac.uk> wrote:
Dear team,
I have a beginner question about function initialisation in Firedrake.
I have the follow simple mesh and function space, and I want to initialise function g with values from numpy arrays (gx, gy). I'm not sure which way should I align the data in the constructor, i.e. should I concatenate gx, gy or interleave them?
mesh = RectangleMesh(nx-1,ny-1,nx,ny) V = VectorFunctionSpace(mesh, "CG", 1)
# g = Function(V, np.concatenate((gx, gy), axis=0))) ???
Many thanks, -TJ
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
-- http://www.imperial.ac.uk/people/colin.cotter www.cambridge.org/9781107663916