Skip to content

Commit

Permalink
[geom] Fix Mesh.pad_boundary for periodic meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jan 10, 2025
1 parent 6381b8c commit 7cd9390
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phi/geom/_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ def interior_faces(self) -> Dict[str, slice]:
return {self.face_shape.dual.name: slice(0, instance(self).volume)}

def pad_boundary(self, value: Tensor, widths: Dict[str, Dict[str, slice]] = None, mode: Extrapolation or Tensor or Number = 0, **kwargs) -> Tensor:
if isinstance(widths, dict) and len(widths) == 0:
return value
mode = as_extrapolation(mode)
if self.face_shape.dual.name not in value.shape:
value = rename_dims(value, instance, self.face_shape.dual)
else:
raise NotImplementedError
if widths is None:
widths = self.boundary_faces
if isinstance(widths, dict) and len(widths) == 0:
return value
if isinstance(widths, (tuple, list)):
if len(widths) == 0 or isinstance(widths[0], dict): # add sliced-off slices
pass
Expand Down

0 comments on commit 7cd9390

Please sign in to comment.