JoeyT1994 / ITensorNumericalAnalysis.jl

MIT License
3 stars 0 forks source link

Operator boundary conditions #18

Closed JoeyT1994 closed 3 months ago

JoeyT1994 commented 3 months ago

This PR implements boundary conditions on the shift operators.

This allows one to call stencil(s, bit_map; dimension, left_boundary, right_boundary, kwargs...)or Laplacian(...; left_boundary, right_boundary) or derivative_operator(...; left_boundary, right_boundary)

Where left_boundary corresponds to x = 0 in the corresponding dimension and right_boundary corresponds to the x = 1 in the corresponding dimension.

The options for left_boundary and right_boundary are

  1. The Default val (if unspecified): "Dirichlet" f(x = boundary_val) = 0
  2. "Neumann" d/dx [f(x = boundary_val)] = 0
  3. "Periodic" f(x = boundary_val) = f(x =opposite_boundary_val)

Tests are added. Example using these to solve a differential equation forthcoming.