This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

tabulate_all_coordinates() removed in 2016.1.0?

+3 votes

Hi.
I am trying to extract the x and y coordinates of a mesh and align them with the dof structure. Some of the code is

meshgrid = RectangleMesh(p1, p2, 22, 11, "right")
F = VectorFunctionSpace(meshgrid, "CG", 1)
dim =F.dim()
N = meshgrid.geometry().dim()
coor = F.dofmap().tabulate_all_coordinates(meshgrid).reshape(dim,N)
fx_dofs=F.sub(0).dofmap().dofs()
fy_dofs=F.sub(1).dofmap().dofs()

Where I have specified the points p1 and p2 beforehand. When I try to run this code I get the error message: 'GenericDofMap' object has no attribute 'tabulate_all_coordinates'.

Is this attribute removed from the new FEniCS version or has it been replaced by something else?

asked Aug 1, 2016 by Michaela FEniCS Novice (220 points)

1 Answer

+5 votes
 
Best answer

It seems to have been moved recently to become a method of FunctionSpace instead of DofMap (not sure why, but maybe to simplify things by getting rid of the mesh argument). Anyway, here's the equivalent in 2016.1:

coor = F.tabulate_dof_coordinates().reshape(dim,N)
answered Aug 1, 2016 by FF FEniCS User (4,630 points)
selected Aug 2, 2016 by Michaela
...