Hello
I have a nonlinear problem and I want to evaluate an unknown at a point. Here is my minimal work:
from dolfin import *
mesh = Mesh()
hdf = HDF5File(mesh.mpi_comm(), "0file.h5", "r")
hdf.read(mesh, "/mesh", False)
subdomains = MeshFunction('size_t', mesh, mesh.topology().dim())
hdf.read(subdomains, "/subdomains")
boundaries = MeshFunction('size_t', mesh, mesh.topology().dim()-1)
hdf.read(boundaries, "/boundaries")
dx = Measure('dx', domain=mesh, subdomain_data=subdomains)
Element1 = FiniteElement("CG", mesh.ufl_cell(), 1)
# Defining the mixed function space
W_elem = MixedElement([Element1, Element1 ,Element1])
W = FunctionSpace(mesh, W_elem)
z = Function(W)
dz=TrialFunction(W)
alpha, beta, gamma = split(z)
(v_1, v_2,v_3) = TestFunctions(W)
# Time variables
dt = 0.5
t = 0
T = 2
F = ....
while t <= T:
bcs = [...]
J = derivative(F, z, dz)
problem = NonlinearVariationalProblem(F, z, bcs, J)
solver = NonlinearVariationalSolver(problem)
solver.solve()
(alpha, beta,gamma) = z.split(True)
print(alpha(0.0245, 0.02))
print(beta(0.0245, 0.02))
t += dt
It works well in serial without any error. The problem is when I want to do it in parallel using MPI:
mpirun -n 4 python TEST.py
I get this error:
*** Error: Unable to evaluate function at point.
*** Reason: The point is not inside the domain. Consider calling "Function::set_allow_extrapolation(true)" on this Function to allow extrapolation.
I found some similar reported issues like here and here but they did not work. It is also suspected as a bug as reported here.
Any help would be appreciated!