neumann
intsharp/boundary.py
Neumann (gradient) boundary conditions
Supports: 1D and 2D (selected automatically based on domain)
1D
Specifies the normal gradient at the two boundaries:
\[ f_0 = f_1 - g_L \cdot \Delta x, \qquad f_{N-1} = f_{N-2} + g_R \cdot \Delta x \]
where \( g_L \) is the gradient at the left (outward-normal) and \( g_R \) at the right.
2D
The same two parameters apply to all four edges:
- Left edge (x = 0): \( f_{i,0} = f_{i,1} - g_L \cdot \Delta x \)
- Right edge (x = L): \( f_{i,-1} = f_{i,-2} + g_R \cdot \Delta x \)
- Bottom edge (y = 0): \( f_{0,j} = f_{1,j} - g_L \cdot \Delta y \)
- Top edge (y = L): \( f_{-1,j} = f_{-2,j} + g_R \cdot \Delta y \)
gradient_left is used for the “min” boundaries (left, bottom); gradient_right for the “max” boundaries (right, top).
YAML
boundary:
type: neumann
gradient_left: 0.0
gradient_right: 0.0