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