topoptlab.fdm module

topoptlab.fdm.laplacian_2d(f: ndarray, dx: float) ndarray[source]

Laplacian operator in 2D on rectangular even spaced grid with periodic boundary conditions.

Parameters:
  • f (np.ndarray shape (ngrid_x,ngrid_y)) – function values.

  • dx (float) – lattice spacing

Returns:

laplacian – laplacian values.

Return type:

np.ndarray shape (ngrid_x,ngrid_y)

topoptlab.fdm.laplacian_3d(f: ndarray, dx: float) ndarray[source]

Laplacian operator in 3D on rectangular even spaced grid with periodic boundary conditions.

Parameters:
  • f (np.ndarray shape (ngrid_x,ngrid_y,ngrid_z)) – function values.

  • dx (float) – lattice spacing

Returns:

laplacian – laplacian values.

Return type:

np.ndarray shape (ngrid_x,ngrid_y,ngrid_z)