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

mesh.xml inconsistent import

0 votes

Hello,
I have solved some nonlinear problem on

self.mesh = dolfin.Mesh(meshXML);
V = FunctionSpace(self.mesh, 'Lagrange', self.lagrangeSpaceDim)

where meshXML is a XML file with double precision specification of the points.
I created some initial guess for u

u_ = self.solveLinear(meshXML)

solveLinear function calls again

self.mesh = dolfin.Mesh(meshXML);
V = FunctionSpace(self.mesh, 'Lagrange', self.lagrangeSpaceDim)

The problem is that then when I call nonlinear solver I obtain an Error message

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at


*** fenics@fenicsproject.org


*** Remember to include the error message listed below and, if possible,
*** include a minimal running example to reproduce the error.


*** -------------------------------------------------------------------------
*** Error: Unable to evaluate function at point.
*** Reason: The point is not inside the domain. Consider setting "allow_extrapolation" to allow extrapolation.
*** Where: This error was encountered inside Function.cpp.
*** Process: unknown


*** DOLFIN version: 1.3.0+
*** Git changeset: 470cb4300bfd07ac56f85051973dc5b9d02dd188
*** -------------------------------------------------------------------------

I guess this is a bug since it happens only on particular mesh files. I would expect that mesh and V object will be the same. I fixed it by calling solveLinear with a space argument but wanted to point out this bug/feature.

Vojtech.

asked May 14, 2014 by kulvv1am FEniCS Novice (270 points)

Why would you want to load your mesh at several places in the code? This will almost certainly fail in parallel at least, not sure why it fails in serial.

Also, both loading the mesh as well as creating the function space several places is very costly, both in terms of memory and cpu.

Not the answer you were looking for, but I would suggest you write your code so that you only have a single Mesh- and FunctionSpace-object.

For example if I do some computation on the mesh defined in XML file and then afterwards recompute the solution on different machine, day, etc. using the same mesh I would expect that FeniCS will create identical space if it is identically defined without needing to store space object.

...