You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Returns GridVariable with correct boundary values.
351
351
352
352
Some grid points of GridVariable might coincide with boundary, thus this function is only used with the trimmed GridVariable.
353
353
Args:
354
354
- u: a `GridVariable` object that specifies only scalar values on the internal nodes.
355
355
- offset_to_pad_to: a Tuple of desired offset to pad to. Note that if the function is given just an interior array in dirichlet case, it can pad to both 0 offset and 1 offset.
356
-
- mode: type of padding to use in non-periodic case. Mirror mirrors the flow across the boundary. Extend extends the last well-defined value past the boundary.
356
+
- mode: type of padding to use in non-periodic case. Mirror mirrors the flow across the boundary. Extend extends the last well-defined value past the boundary. None means no ghost cell padding.
357
357
358
358
Returns:
359
359
A GridVariable that has correct boundary values.
@@ -364,16 +364,27 @@ def pad_and_impose_bc(
364
364
fordiminrange(-u.grid.ndim, 0):
365
365
_=self._is_aligned(u, dim)
366
366
ifself.types[dim][0] !=BCType.PERIODIC:
367
-
# if the offset is either 0 or 1, u is aligned with the boundary and is defined on cell edges on one side of the boundary, if trim_boundary is called before this function.
368
-
# u needs to be padded on both sides
369
-
# if the offset is 0.5, one ghost cell is needed on each side.
370
-
# it will be taken care by grids.pad function automatically.
# if the offset is either 0 or 1, u is aligned with the boundary and is defined on cell edges on one side of the boundary, if trim_boundary is called before this function.
369
+
# u needs to be padded on both sides
370
+
# if the offset is 0.5, one ghost cell is needed on each side.
371
+
# it will be taken care by grids.pad function automatically.
A GridVariable that has correct boundary values with ghost cells added on the other side of DoFs living at cell center if the bc is Dirichlet or Neumann.
396
+
A GridVariable that has correct boundary values. If ghost_cell == True, then ghost cells are added on the other side of DoFs living at cell center if the bc is Dirichlet or Neumann.
0 commit comments