@@ -87,43 +87,30 @@ function lazy_interpolate!(
8787 same_cells:: Bool = xgrid == target. FES. xgrid
8888 CF:: CellFinder{Tv, Ti} = CellFinder (xgrid)
8989
90- if same_cells || use_cellparents == true
91- if same_cells
92- xCellParents = 1 : num_cells (target. FES. xgrid)
93- else
94- xCellParents:: Array{Ti, 1} = target. FES. xgrid[CellParents]
95- end
90+ if same_cells || use_cellparents
91+ xCellParents:: Array{Ti, 1} = same_cells ? (1 : num_cells (target. FES. xgrid)) : target. FES. xgrid[CellParents]
92+ # @show xCellParents
9693 function point_evaluation_parentgrid! (result, qpinfo)
97- x = qpinfo. x
98- cell = xCellParents[qpinfo. cell]
99- if xtrafo != = nothing
100- xtrafo (x_source, x)
101- cell = gFindLocal! (xref, CF, x_source; icellstart = cell, eps = eps, trybrute = ! only_localsearch)
102- else
103- cell = gFindLocal! (xref, CF, x; icellstart = cell, eps = eps, trybrute = ! only_localsearch)
104- end
105- evaluate_bary! (result, PE, xref, cell)
106- return nothing
94+ x = xtrafo != = nothing ? xtrafo (x_source, qpinfo. x) : qpinfo. x
95+ # @show qpinfo.x qpinfo.cell
96+ cell = gFindLocal! (xref, CF, x; icellstart = xCellParents[qpinfo. cell], eps = eps, trybrute = ! only_localsearch)
97+ return evaluate_bary! (result, PE, xref, cell)
10798 end
10899 fe_function = point_evaluation_parentgrid!
109100 else
110101 function point_evaluation_arbitrarygrids! (result, qpinfo)
111- x = qpinfo. x
112- if xtrafo != = nothing
113- xtrafo (x_source, x)
114- cell = gFindLocal! (xref, CF, x_source; icellstart = lastnonzerocell, eps = eps, trybrute = ! only_localsearch)
115- else
116- cell = gFindLocal! (xref, CF, x; icellstart = lastnonzerocell, eps = eps, trybrute = ! only_localsearch)
117- end
102+ x = xtrafo != = nothing ? xtrafo (x_source, qpinfo. x) : qpinfo. x
103+ cell = gFindLocal! (xref, CF, x; icellstart = lastnonzerocell, eps = eps, trybrute = ! only_localsearch)
118104 if cell == 0
119- fill! (result, not_in_domain_value)
105+ return fill! (result, not_in_domain_value)
120106 else
121107 evaluate_bary! (result, PE, xref, cell)
122108 lastnonzerocell = cell
109+ return cell
123110 end
124- return nothing
125111 end
126112 fe_function = point_evaluation_arbitrarygrids!
127113 end
114+
128115 return interpolate! (target, ON_CELLS, fe_function; resultdim = resultdim, items = items, kwargs... )
129116end
0 commit comments