scimba_torch.physical_models.temporal_pde.abstract_temporal_pde¶
Module for abstract temporal PDEs.
Functions
|
Function returning a zero right-hand side for the boundary conditions. |
|
Function returning a zero initial condition. |
|
Function returning a zero right-hand side. |
Classes
|
Base class for representing elliptic Partial Differential Equations (PDEs). |
|
First order temporal equations extending a spatial equation. |
|
Base class for representing elliptic Partial Differential Equations (PDEs). |
|
Base class for representing elliptic Partial Differential Equations (PDEs). |
- class TemporalPDE(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) – Whether 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:
Tensor|tuple[Tensor,...]- Returns:
Gradient tensor
- abstract rhs(w, t, x, mu)[source]¶
Compute the right-hand side (RHS) of the PDE.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
RHS tensor
- abstract space_operator(w, t, x, mu)[source]¶
Apply the PDE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Operator tensor
- abstract time_operator(w, t, x, mu)[source]¶
Apply the PDE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Operator tensor
- operator(w, t, x, mu)[source]¶
Apply the PDE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Operator tensor
- abstract bc_rhs(w, t, x, n, mu)[source]¶
Compute the boundary condition RHS.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
Boundary condition RHS tensor
- abstract bc_operator(w, t, x, n, mu)[source]¶
Apply the boundary condition operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
Boundary condition operator tensor
- abstract initial_condition(x, mu)[source]¶
Compute the initial condition.
- Parameters:
x (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Initial condition tensor
- class FirstOrderTemporalPDE(space, linear=False, **kwargs)[source]¶
Bases:
TemporalPDEBase class for representing elliptic Partial Differential Equations (PDEs).
- Parameters:
space (
AbstractApproxSpace) – Approximation space used for the PDElinear (
bool) – Whether the PDE is linear**kwargs – Additional keyword arguments
- time_operator(w, t, x, mu)[source]¶
Apply the PDE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Operator tensor
- functional_time_operator(func, t, x, mu, theta)[source]¶
Compute the functional time operator.
- Parameters:
func (
VarArgCallable) – Callable representing the functiont (
Tensor) – Temporal coordinate tensorx (
Tensor) – Spatial coordinate tensormu (
Tensor) – Parameter tensortheta (
Tensor) – Additional parameters tensor
- Return type:
Tensor- Returns:
Functional time operator tensor
- functional_operator_ic(func, x, mu, theta)[source]¶
Compute the functional operator for initial conditions.
- Parameters:
func (
VarArgCallable) – Callable representing the functionx (
Tensor) – Spatial coordinate tensormu (
Tensor) – Parameter tensortheta (
Tensor) – Additional parameters tensor
- Return type:
Tensor- Returns:
Functional operator tensor for initial conditions
- class SecondOrderTemporalPDE(space, linear=False, **kwargs)[source]¶
Bases:
TemporalPDEBase class for representing elliptic Partial Differential Equations (PDEs).
- Parameters:
space (
AbstractApproxSpace) – Approximation space used for the PDElinear (
bool) – Whether the PDE is linear**kwargs – Additional keyword arguments
- time_operator(w, t, x, mu)[source]¶
Apply the PDE operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Operator tensor
- zeros_rhs(w, t, x, mu, nb_func=1)[source]¶
Function returning a zero right-hand side.
- Parameters:
w (
MultiLabelTensor) – Solution tensor.t (
LabelTensor) – Temporal coordinates tensor.x (
LabelTensor) – Spatial coordinates tensor.mu (
LabelTensor) – Parameter tensor.nb_func (
int) – Number of functions to return (default is 1).
- Return type:
Tensor- Returns:
A tensor of zeros with shape (number of points, nb_func).
- zeros_bc_rhs(w, t, x, n, mu, nb_func=1)[source]¶
Function returning a zero right-hand side for the boundary conditions.
- Parameters:
w (
MultiLabelTensor) – Solution tensor.t (
LabelTensor) – Temporal coordinates tensor.x (
LabelTensor) – Spatial coordinates tensor.n (
LabelTensor) – Normal vector tensor.mu (
LabelTensor) – Parameter tensor.nb_func (
int) – Number of functions to return (default is 1).
- Return type:
Tensor- Returns:
A tensor of zeros with shape (number of points, nb_func).
- zeros_init(x, mu, nb_func=1)[source]¶
Function returning a zero initial condition.
- Parameters:
x (
LabelTensor) – Spatial coordinates tensor.mu (
LabelTensor) – Parameter tensor.nb_func (
int) – Number of functions to return (default is 1).
- Return type:
Tensor- Returns:
A tensor of zeros with shape (number of points, nb_func).
- class GenericFirstOrderTemporalPDE(space, space_component, init=None, f=None, g=None, **kwargs)[source]¶
Bases:
FirstOrderTemporalPDEFirst order temporal equations extending a spatial equation.
- Parameters:
space (
AbstractApproxSpace) – The approximation space for the problemspace_component (
StrongFormEllipticPDE|LinearOrder2PDE) – The stationary part of the equation as a PDEinit (
Optional[Callable]) – Callable for the initial condition (default is zero)f (
Optional[Callable]) – Source term function (default is zero)g (
Optional[Callable]) – Boundary condition function (default is zero)**kwargs – Additional keyword arguments
- space_operator(w, t, x, mu)[source]¶
Apply the spatial operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor|tuple[Tensor,...]- Returns:
Spatial operator tensor
- bc_operator(w, t, x, n, mu)[source]¶
Apply the boundary condition operator.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
Boundary condition operator tensor
- rhs(w, t, x, mu)[source]¶
Compute the right-hand side (RHS) of the PDE.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
RHS tensor
- bc_rhs(w, t, x, n, mu)[source]¶
Compute the boundary condition RHS.
- Parameters:
w (
MultiLabelTensor) – Solution tensort (
LabelTensor) – Temporal coordinate tensorx (
LabelTensor) – Spatial coordinate tensorn (
LabelTensor) – Normal vector tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
Boundary condition RHS tensor
- initial_condition(x, mu)[source]¶
Compute the initial condition.
- Parameters:
x (
LabelTensor) – Spatial coordinate tensormu (
LabelTensor) – Parameter tensor
- Return type:
Tensor- Returns:
Initial condition tensor
- functional_operator(func, t, x, mu, theta)[source]¶
Compute the functional operator.
- Parameters:
func (
VarArgCallable) – Callable representing the functiont (
Tensor) – Temporal coordinate tensorx (
Tensor) – Spatial coordinate tensormu (
Tensor) – Parameter tensortheta (
Tensor) – Additional parameters tensor
- Return type:
Tensor- Returns:
Functional operator tensor
- functional_operator_bc(func, t, x, n, mu, theta)[source]¶
Compute the functional operator for boundary conditions.
- Parameters:
func (
VarArgCallable) – Callable representing the functiont (
Tensor) – Temporal coordinate tensorx (
Tensor) – Spatial coordinate tensorn (
Tensor) – Normal vector tensormu (
Tensor) – Parameter tensortheta (
Tensor) – Additional parameters tensor
- Return type:
Tensor- Returns:
Functional operator tensor for boundary conditions