Poisson2DSquareProblem#

Formulation of the Poisson problem in a square domain.

class Poisson2DSquareProblem[source]#

Bases: SpatialProblem

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

The problem is governed by the Poisson equation

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

where \(u = u(x, y)\) is the solution field and \(f(x, y)\) is the 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 forcing term is given by

\[f(x, y) = 2\pi^2 \sin(\pi x)\sin(\pi y).\]

The analytical solution is given by

\[u(x, y) = -\sin(\pi x)\sin(\pi y).\]
Example:
>>> problem = Poisson2DSquareProblem()

Initialization of the BaseProblem class.

solution(pts)[source]#

Implementation of the analytical solution of the Poisson problem.

Parameters:

pts (LabelTensor) – The points where the solution is evaluated.

Returns:

The analytical solution of the Poisson problem.

Return type:

LabelTensor