In this class the problem is implemented in the way that the spatial part is solved using FEniCS[1]. Hence, the problem
is reformulated to the weak formulation
The part containing the forcing term is treated explicitly, where it is interpolated in the function space.
The other part will be treated in an implicit way.
Parameters:
c_nvars (int, optional) – Spatial resolution, i.e., numbers of degrees of freedom in space.
t0 (float, optional) – Starting time.
family (str, optional) – Indicates the family of elements used to create the function space
for the trail and test functions. The default is 'CG', which are the class
of Continuous Galerkin, a synonym for the Lagrange family of elements, see [2].
order (int, optional) – Defines the order of the elements in the function space.
refinements (int, optional) – Denotes the refinement of the mesh. refinements=2 refines the mesh by factor \(2\).
nu (float, optional) – Diffusion coefficient \(\nu\).
c (float, optional) – Constant for the Dirichlet boundary condition \(c\).
Variables:
V (FunctionSpace) – Defines the function space of the trial and test functions.
M (scalar, vector, matrix or higherranktensor) – Denotes the expression \(\int_\Omega u_t v\,dx\).
K (scalar, vector, matrix or higherranktensor) – Denotes the expression \(- \nu \int_\Omega \nabla u \nabla v\,dx\).
g (Expression) – The forcing term \(f\) in the heat equation.
bc (DirichletBC) – Denotes the Dirichlet boundary conditions.
Solve \(\delta - factor\,[f(w+\delta) - f(w)] = r\), i.e.
\((M - factor\,K)\,\delta = M r\) with zero boundary data.
This is the piece linear_implicit=True cannot supply on this backend. That shortcut
reuses the stock solve_system, which applies inhomogeneous Dirichlet data to whatever
right-hand side it is handed, and a correction must carry zero boundary data. Applying
bc_hom instead is the whole difference.
Without this the sweeper falls back to the substitution \(y = w + \delta\), which is
exact but reads the level’s \(\mathcal{O}(1)\) state. That is merely no benefit while
the level is at backend precision, and is a wrong answer once it is not – measured here as
1.4e-05 with the coarse level at float32.
Parameters:
r (dtype_u) – Right-hand side of the correction equation.
factor (float) – Implicit prefactor assembled by the sweeper.
base (dtype_u) – Base state, unused: the implicit operator is linear.
f_base (dtype_f) – f evaluated at base, unused for the same reason.
t (float) – Physical time, accepted for interface compatibility.
In this class the problem is implemented in the way that the spatial part is solved using FEniCS[3]. Hence, the problem
is reformulated to the weak formulation
The forcing term is treated explicitly, and is expressed via the mass matrix resulting from the left-hand side term
\(\int_\Omega u_t v\,dx\), and the other part will be treated in an implicit way.
Parameters:
c_nvars (int, optional) – Spatial resolution, i.e., numbers of degrees of freedom in space.
t0 (float, optional) – Starting time.
family (str, optional) – Indicates the family of elements used to create the function space
for the trail and test functions. The default is 'CG', which are the class
of Continuous Galerkin, a synonym for the Lagrange family of elements, see [4].
order (int, optional) – Defines the order of the elements in the function space.
refinements (int, optional) – Denotes the refinement of the mesh. refinements=2 refines the mesh by factor \(2\).
nu (float, optional) – Diffusion coefficient \(\nu\).
c (float, optional) – Constant for the Dirichlet boundary condition \(c\).
Variables:
V (FunctionSpace) – Defines the function space of the trial and test functions.
M (scalar, vector, matrix or higherranktensor) – Denotes the expression \(\int_\Omega u_t v\,dx\).
K (scalar, vector, matrix or higherranktensor) – Denotes the expression \(- \nu \int_\Omega \nabla u \nabla v\,dx\).
g (Expression) – The forcing term \(f\) in the heat equation.
bc (DirichletBC) – Denotes the Dirichlet boundary conditions.
bc_hom (DirichletBC) – Denotes the homogeneous Dirichlet boundary conditions, potentially required for fixing the residual
fix_bc_for_residual (boolean) – flag to indicate that the residual requires special treatment due to boundary conditions
In this class the problem is implemented in the way that the spatial part is solved using FEniCS[5]. Hence, the problem
is reformulated to the weak formulation
The forcing term is treated explicitly, and is expressed via the mass matrix resulting from the left-hand side term
\(\int_\Omega u_t v\,dx\), and the other part will be treated in an implicit way.
Parameters:
c_nvars (int, optional) – Spatial resolution, i.e., numbers of degrees of freedom in space.
t0 (float, optional) – Starting time.
family (str, optional) – Indicates the family of elements used to create the function space
for the trail and test functions. The default is 'CG', which are the class
of Continuous Galerkin, a synonym for the Lagrange family of elements, see [6].
order (int, optional) – Defines the order of the elements in the function space.
refinements (int, optional) – Denotes the refinement of the mesh. refinements=2 refines the mesh by factor \(2\).
nu (float, optional) – Diffusion coefficient \(\nu\).
c (float, optional) – Constant \(c\) added to the exact solution and hence to the time-dependent Dirichlet boundary condition.
Variables:
V (FunctionSpace) – Defines the function space of the trial and test functions.
M (scalar, vector, matrix or higherranktensor) – Denotes the expression \(\int_\Omega u_t v\,dx\).
K (scalar, vector, matrix or higherranktensor) – Denotes the expression \(- \nu \int_\Omega \nabla u \nabla v\,dx\).
g (Expression) – The forcing term \(f\) in the heat equation.
bc (DirichletBC) – Denotes the time-dependent Dirichlet boundary conditions.
bc_hom (DirichletBC) – Denotes the homogeneous Dirichlet boundary conditions, potentially required for fixing the residual
fix_bc_for_residual (boolean) – flag to indicate that the residual requires special treatment due to boundary conditions