Skip to content
Snippets Groups Projects
Commit f6c2db7e authored by Stephan Hilb's avatar Stephan Hilb
Browse files

fix offset for ImageFunction evaluation

parent 67276d38
No related branches found
No related tags found
No related merge requests found
......@@ -255,6 +255,7 @@ function evaluate(df::Derivative, x)
return SArray{Tuple{df.f.space.size..., length(x)}}(jac)
end
# TODO: inherit from some abstract function type
struct ImageFunction{Img}
mesh::Mesh
......@@ -266,8 +267,9 @@ ImageFunction(mesh, img) =
ImageFunction(mesh, img, Ref(1))
bind!(f::ImageFunction, cell) = f.cell[] = cell
# TODO: precompute the offset from minimum mesh vertex
evaluate(f::ImageFunction, xloc) =
interpolate_bilinear(f.img, elmap(f.mesh, f.cell[])(xloc))
interpolate_bilinear(f.img, elmap(f.mesh, f.cell[])(xloc) .+ (0.5, 0.5))
struct FacetDivergence{F}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment