scimba_torch.physical_models.temporal_pde.heat_equation¶
Heat equation in strong form.
Classes
|
Implementation of a 1D heat equation with Dirichlet BCs in strong form. |
|
Implementation of a 1D heat equation with Neumann BCs in strong form. |
|
Implementation of a 2D Laplacian problem with Dirichlet BCs in strong form. |
|
2D heat equation for implicit discrete_pinns. |
- class HeatEquation1DStrongForm(space, init, f, g, **kwargs)[source]¶
Bases:
FirstOrderTemporalPDEImplementation of a 1D heat equation with Neumann BCs in strong form.
- Parameters:
space (
AbstractApproxSpace) – The approximation space for the probleminit (
Callable) – Callable for the initial conditionf (
Callable) – Source term functiong (
Callable) – Neumann boundary condition function**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
- 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 HeatEquation1DDirichletStrongForm(space, init, f, g, **kwargs)[source]¶
Bases:
FirstOrderTemporalPDEImplementation of a 1D heat equation with Dirichlet BCs in strong form.
- Parameters:
space (
AbstractApproxSpace) – The approximation space for the probleminit (
Callable) – Callable for the initial conditionf (
Callable) – Source term functiong (
Callable) – Dirichlet boundary condition function**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- 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
- 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 HeatEquation2DStrongForm(space, init, f, g, **kwargs)[source]¶
Bases:
FirstOrderTemporalPDEImplementation of a 2D Laplacian problem with Dirichlet BCs in strong form.
- Parameters:
space (
AbstractApproxSpace) – The approximation space for the probleminit (
Callable) – Callable for the initial conditionf (
Callable) – Source term functiong (
Callable) – Dirichlet boundary condition function**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- 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
- class HeatEquation2DStrongFormImplicit(space, init, f, g, **kwargs)[source]¶
Bases:
FirstOrderTemporalPDE2D heat equation for implicit discrete_pinns.
- Parameters:
space (
AbstractApproxSpace) – the approx. space.init (
Callable) – the rhs of the initial condition.f (
Callable) – the rhs of the residual.g (
Callable) – the rhs of the boundary condition.**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- 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, x, mu, theta)[source]¶
Compute the functional operator.
- 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
- functional_operator_bc(func, t, x, n, mu, theta)[source]¶
Compute the functional operator for boundary conditions.
- Parameters:
func (
VarArgCallable) – Callable representing the functiont (
LabelTensor) – 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
- 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