AdvectionProblem#
Formulation of the advection problem.
- class AdvectionProblem(c=1.0)[source]#
Bases:
SpatialProblem,TimeDependentProblemImplementation of the one-dimensional advection problem on the space-time domain \(\Omega\times T = [0, 2\pi] \times [0, 1]\).
The problem is governed by the linear advection equation
\[\frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0,\]where \(u = u(x, t)\) is the solution field and \(c\) is the advection velocity.
Periodic boundary conditions are imposed at the spatial boundaries:
\[u(0, t) = u(2\pi, t), \qquad t \in [0, 1].\]The initial condition is prescribed as
\[u(x, 0) = \sin(x), \qquad x \in [0, 2\pi].\]The analytical solution is given by
\[u(x, t) = \sin(x - ct).\]See also
Original reference: Wang, Sifan, et al. An expert’s guide to training physics-informed neural networks. arXiv preprint arXiv:2308.08468 (2023). DOI: arXiv:2308.08468.
- Example:
>>> problem = AdvectionProblem()
Initialization of the
AdvectionProblem.- solution(pts)[source]#
Implementation of the analytical solution of the advection problem.
- Parameters:
pts (LabelTensor) – Points where the solution is evaluated.
- Returns:
The analytical solution of the advection problem.
- Return type: