Skip to content

Commit

Permalink
[field] Fix sampling mesh to grid
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jun 3, 2024
1 parent d44db9a commit 025ed39
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions phi/field/_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ def sample(field: Union[Field, Geometry, FieldInitializer, Callable],
faces = math.unstack(slice_off_constant_faces(geometry.faces, geometry.boundary_faces, boundary), dual)
sampled = [sample(field, face, **kwargs) for face in faces]
return math.stack(sampled, dual(geometry.face_shape))
elif field.is_mesh and field.is_centered:
if not field.geometry.shallow_equals(geometry):
raise NotImplementedError("Resampling to different mesh is not yet supported")
elif field.is_mesh and field.is_centered and field.geometry.shallow_equals(geometry):
return centroid_to_faces(field, boundary, **kwargs)
elif field.is_mesh and field.is_staggered and field.geometry.shallow_equals(geometry):
return field.with_boundary(boundary)
Expand Down

0 comments on commit 025ed39

Please sign in to comment.