scimba_torch.physical_models.elliptic_pde.abstract_elliptic_pde

Abstract classes for elliptic PDEs.

Classes

EllipticPDE(space[, linear])

Base class for representing elliptic Partial Differential Equations (PDEs).

RitzFormEllipticPDE(space[, linear, ...])

Ritz form of an elliptic PDE.

StrongFormEllipticPDE(space[, linear, ...])

Strong form of an elliptic PDE.

WeakFormEllipticPDE(space[, residual_size, ...])

Weak form of an elliptic PDE.

class EllipticPDE(space, linear=False, **kwargs)[source]

Bases: ABC

Base class for representing elliptic Partial Differential Equations (PDEs).

Parameters:
  • space (AbstractApproxSpace) – Approximation space used for the PDE

  • linear (bool) – Indicates if the PDE is linear

  • **kwargs – Additional keyword arguments

grad(w, y)[source]

Compute the gradient of the tensor w with respect to the tensor y.

Parameters:
Return type:

Union[Tensor, Generator[Tensor, None, None]]

Returns:

Gradient tensor

class StrongFormEllipticPDE(space, linear=False, residual_size=None, bc_residual_size=0, **kwargs)[source]

Bases: EllipticPDE

Strong form of an elliptic PDE.

Parameters:
  • space (AbstractApproxSpace) – Approximation space used for the PDE

  • linear (bool) – Indicates if the PDE is linear

  • residual_size (int | None) – Size of the residual, defaults to space.nb_unknowns

  • bc_residual_size (int) – Size of the boundary condition residual, defaults to 0

  • **kwargs – Additional keyword arguments

abstract rhs(w, x, mu)[source]

Compute the right-hand side (RHS) of the PDE.

Parameters:
Return type:

Tensor

Returns:

The right-hand side of the PDE.

abstract operator(w, x, mu)[source]

Apply the PDE operator.

Parameters:
Return type:

Tensor

Returns:

The result of the PDE operator.

abstract bc_rhs(w, x, n, mu)[source]

Compute the boundary condition RHS.

Parameters:
Return type:

Tensor

Returns:

The boundary condition RHS.

abstract bc_operator(w, x, n, mu)[source]

Apply the boundary condition operator.

Parameters:
Return type:

Tensor

Returns:

The result of the boundary condition operator.

class WeakFormEllipticPDE(space, residual_size=None, linear=False, **kwargs)[source]

Bases: EllipticPDE

Weak form of an elliptic PDE.

Parameters:
  • space (AbstractApproxSpace) – Approximation space used for the PDE

  • residual_size (int | None) – Size of the weak form, defaults to space.nb_unknowns

  • linear (bool) – Indicates if the PDE is linear

  • **kwargs – Additional keyword arguments

abstract linearform(w, v, x, mu)[source]

Compute the linear form of the weak formulation.

Parameters:
Return type:

LabelTensor

Returns:

The linear form of the weak formulation.

abstract bilinearform(w, v, x, mu)[source]

Compute the bilinear form of the weak formulation.

Parameters:
Return type:

LabelTensor

Returns:

The bilinear form of the weak formulation.

abstract bc_linearform(w, v, x, n, mu)[source]

Compute the boundary condition linear form.

Parameters:
Return type:

LabelTensor

Returns:

The boundary condition linear form.

abstract bc_bilinearform(w, v, x, n, mu)[source]

Compute the boundary condition bilinear form.

Parameters:
Return type:

LabelTensor

Returns:

The boundary condition bilinear form.

class RitzFormEllipticPDE(space, linear=False, residual_size=None, bc_residual_size=0, **kwargs)[source]

Bases: EllipticPDE

Ritz form of an elliptic PDE.

Parameters:
  • space (AbstractApproxSpace) – Approximation space used for the PDE

  • linear (bool) – Indicates if the PDE is linear

  • residual_size (int | None) – Size of the weak form, defaults to space.nb_unknowns

  • bc_residual_size (int) – Size of the boundary condition residual, defaults to 0

  • **kwargs – Additional keyword arguments

abstract linearform(w, x, mu)[source]

Compute the linear form of the Ritz formulation.

Parameters:
Return type:

Tensor

Returns:

The linear form of the Ritz formulation.

abstract quadraticform(w, x, mu)[source]

Compute the bilinear form of the Ritz formulation.

Parameters:
Return type:

Tensor

Returns:

The bilinear form of the Ritz formulation.

abstract bc_rhs(w, x, n, mu)[source]

Compute the boundary condition RHS.

Parameters:
Return type:

Tensor

Returns:

The boundary condition RHS.

abstract bc_operator(w, x, n, mu)[source]

Apply the boundary condition operator.

Parameters:
Return type:

Tensor

Returns:

The result of the boundary condition operator.