scimba_torch.physical_models.elliptic_pde.abstract_elliptic_pde¶
Abstract classes for elliptic PDEs.
Classes
|
Base class for representing elliptic Partial Differential Equations (PDEs). |
|
Ritz form of an elliptic PDE. |
|
Strong form of an elliptic PDE. |
|
Weak form of an elliptic PDE. |
- class EllipticPDE(space, linear=False, **kwargs)[source]¶
Bases:
ABCBase class for representing elliptic Partial Differential Equations (PDEs).
- Parameters:
space (
AbstractApproxSpace) – Approximation space used for the PDElinear (
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:
w (
Tensor|MultiLabelTensor) – Input tensory (
Tensor|LabelTensor) – Tensor with respect to which the gradient is computed
- 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:
EllipticPDEStrong form of an elliptic PDE.
- Parameters:
space (
AbstractApproxSpace) – Approximation space used for the PDElinear (
bool) – Indicates if the PDE is linearresidual_size (
int|None) – Size of the residual, defaults to space.nb_unknownsbc_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:
w (
MultiLabelTensor) – Solution tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
The right-hand side of the PDE.
- abstract operator(w, x, mu)[source]¶
Apply the PDE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
The result of the PDE operator.
- abstract bc_rhs(w, x, n, mu)[source]¶
Compute the boundary condition RHS.
- Parameters:
w (
MultiLabelTensor) – Solution tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
The boundary condition RHS.
- abstract bc_operator(w, x, n, mu)[source]¶
Apply the boundary condition operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
The result of the boundary condition operator.
- class WeakFormEllipticPDE(space, residual_size=None, linear=False, **kwargs)[source]¶
Bases:
EllipticPDEWeak form of an elliptic PDE.
- Parameters:
space (
AbstractApproxSpace) – Approximation space used for the PDEresidual_size (
int|None) – Size of the weak form, defaults to space.nb_unknownslinear (
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:
w (
MultiLabelTensor) – Solution tensorv (
LabelTensor) – Test function tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
- Returns:
The linear form of the weak formulation.
- abstract bilinearform(w, v, x, mu)[source]¶
Compute the bilinear form of the weak formulation.
- Parameters:
w (
MultiLabelTensor) – Solution tensorv (
LabelTensor) – Test function tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
- Returns:
The bilinear form of the weak formulation.
- abstract bc_linearform(w, v, x, n, mu)[source]¶
Compute the boundary condition linear form.
- Parameters:
w (
MultiLabelTensor) – Solution tensorv (
LabelTensor) – Test function tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
- Returns:
The boundary condition linear form.
- abstract bc_bilinearform(w, v, x, n, mu)[source]¶
Compute the boundary condition bilinear form.
- Parameters:
w (
MultiLabelTensor) – Solution tensorv (
LabelTensor) – Test function tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
- Returns:
The boundary condition bilinear form.
- class RitzFormEllipticPDE(space, linear=False, residual_size=None, bc_residual_size=0, **kwargs)[source]¶
Bases:
EllipticPDERitz form of an elliptic PDE.
- Parameters:
space (
AbstractApproxSpace) – Approximation space used for the PDElinear (
bool) – Indicates if the PDE is linearresidual_size (
int|None) – Size of the weak form, defaults to space.nb_unknownsbc_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:
w (
MultiLabelTensor) – Solution tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- 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:
w (
MultiLabelTensor) – Solution tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- 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:
w (
MultiLabelTensor) – Solution tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
The boundary condition RHS.
- abstract bc_operator(w, x, n, mu)[source]¶
Apply the boundary condition operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
The result of the boundary condition operator.