Ok found it! It's the number of nodes. Sorry for asking silly questions! Anna. On 17/12/15 17:41, Anna Kalogirou wrote:
Thanks Lawrence,
Can you please explain where the number 42 in coords = np.empty((42, 2), dtype=float) comes from? I assumed it was N_elements + 12, but it doesn't work for a larger N_elements.
Thanks, Anna.
On 17/12/15 16:20, Lawrence Mitchell wrote:
Hi Anna,
two things:
On 17/12/15 16:00, Anna Kalogirou wrote:
Hello,
I get the error " ImportError: cannot import name _from_cell_list " when running the following code (the mesh file can be found attached):
from firedrake import * import numpy as np
mesh_data = np.loadtxt("sweVbuoy2D_mesh.in")
xcoords = mesh_data[:,[0,2,4,6]] ycoords = mesh_data[:,[1,3,5,7]] coords = np.asarray(np.meshgrid(xcoords, ycoords)).swapaxes(0, 2).reshape(-1, 2)
cells = mesh_data[:,[8,9,10,11]].astype(int) I think you want this section to be:
coords = np.empty((42, 2), dtype=float) cells = mesh_data[:,[8,9,10,11]].astype(int) - 1 coords[cells] = mesh_data[:, :8].reshape(-1, 4, 2)
from firedrake.mesh import _from_cell_list dm = _from_cell_list(2, cells, coords) I'm not sure why _from_cell_list isn't available in firedrake.mesh, it definitely works for me.
Cheers,
Lawrence
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
--
Dr Anna Kalogirou Research Fellow School of Mathematics University of Leeds
http://www1.maths.leeds.ac.uk/~matak/
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
-- Dr Anna Kalogirou Research Fellow School of Mathematics University of Leeds http://www1.maths.leeds.ac.uk/~matak/