@@ -231,10 +231,10 @@ def _interpolator(V, tensor, expr, subset, arguments, access):
231231 if not isinstance (expr , firedrake .Expression ):
232232 if expr .ufl_domain () and expr .ufl_domain () != V .mesh ():
233233 raise NotImplementedError ("Interpolation onto another mesh not supported." )
234- ast , oriented , needs_cell_sizes , coefficients , _ = compile_expression_dual_evaluation (expr , to_element ,
235- domain = V .mesh (),
236- parameters = parameters ,
237- coffee = False )
234+ ast , oriented , needs_cell_sizes , coefficients , first_coeff_fake_coords , _ = compile_expression_dual_evaluation (expr , to_element ,
235+ domain = V .mesh (),
236+ parameters = parameters ,
237+ coffee = False )
238238 kernel = op2 .Kernel (ast , ast .name , requires_zeroed_output_arguments = True )
239239 elif hasattr (expr , "eval" ):
240240 to_pts = []
@@ -243,8 +243,8 @@ def _interpolator(V, tensor, expr, subset, arguments, access):
243243 raise NotImplementedError ("Can only interpolate Python kernels with Lagrange elements" )
244244 pts , = dual .pt_dict .keys ()
245245 to_pts .append (pts )
246-
247246 kernel , oriented , needs_cell_sizes , coefficients = compile_python_kernel (expr , to_pts , to_element , V , coords )
247+ first_coeff_fake_coords = False
248248 else :
249249 raise RuntimeError ("Attempting to evaluate an Expression which has no value." )
250250
@@ -254,6 +254,10 @@ def _interpolator(V, tensor, expr, subset, arguments, access):
254254 cell_set = subset
255255 parloop_args = [kernel , cell_set ]
256256
257+ if first_coeff_fake_coords :
258+ # Replace with real coords coefficient
259+ coefficients [0 ] = coords
260+
257261 if tensor in set ((c .dat for c in coefficients )):
258262 output = tensor
259263 tensor = op2 .Dat (tensor .dataset )
0 commit comments