HelmholtzProblem#

Formulation of the Helmholtz problem.

class HelmholtzProblem(k=1.0, alpha_x=1, alpha_y=4)[source]#

Bases: SpatialProblem

Implementation of the two-dimensional Helmholtz problem on the square domain \(\Omega = [-1, 1] \times [-1, 1]\).

The problem is governed by the forced Helmholtz equation

\[\Delta u + k u = f(x, y),\]

where \(u = u(x, y)\) is the solution field, \(k\) is the squared wavenumber, and \(f(x, y)\) is a forcing term.

Homogeneous Dirichlet boundary conditions are imposed on the boundary of the domain:

\[u(x, y) = 0, \qquad (x, y) \in \partial \Omega.\]

The analytical solution is given by

\[u(x, y) = \sin(\alpha_x \pi x) \sin(\alpha_y \pi y),\]

with forcing term

\[f(x, y) = \left[ k - (\alpha_x^2 + \alpha_y^2)\pi^2 \right] \sin(\alpha_x \pi x) \sin(\alpha_y \pi y).\]

See also

Original reference: Si, Chenhao, et al. Complex Physics-Informed Neural Network. arXiv preprint arXiv:2502.04917 (2025). DOI: arXiv:2502.04917.

Example:
>>> problem = HelmholtzProblem()

Initialization of the HelmholtzProblem class.

Parameters:
  • k (float | int) – The squared wavenumber. Default is 1.0.

  • alpha_x (int) – The frequency in the x-direction. Default is 1.

  • alpha_y (int) – The frequency in the y-direction. Default is 4.

solution(pts)[source]#

Implementation of the analytical solution of the Helmholtz problem.

Parameters:

pts (LabelTensor) – Points where the solution is evaluated.

Returns:

The analytical solution of the Helmholtz problem.

Return type:

LabelTensor