MeshCoordinates broken

Issue #760 resolved
Marco Morandini created an issue

This testcase segfaults for me:

mesh = UnitSquareMesh(10,10)
POS = MeshCoordinates(mesh)
V = VectorFunctionSpace(mesh, "CG", 1)
v = Function(V)
v.interpolate(POS)

This is because the constructor of MeshCoordinates uses _mesh initilizing the constructor of the Expression base class constructor before initializing it :

MeshCoordinates::MeshCoordinates(std::shared_ptr<const Mesh> mesh)
  : Expression(_mesh->geometry().dim()), _mesh(mesh)
{
  // Do nothing
}

Comments (1)

  1. Log in to comment