Finite element exterior calculus (FEEC) implementation - problems. #2456
-
Dear community, I'm trying to implement some of the methods in D.N. Arnold's textbook on FEEC, in Firedrake. (I think) I have set up a 2D Hodge Laplacian problem for a vector field, but the type of function spaces Arnold recommends do not seem to work well - the vector field output looks "messy" (and I cannot get higher polynomial orders than one to converge) and just using ordinary Lagrange elements appears to work better. Can anyone say anything to this, please, e.g. are there any obvious mistakes (code, or maths) in my file (I only started using Firedrake a week ago, so there probably are). Thanks, Ed. Firedrake script, which I've attempted to comment suitably: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
So the problem is you're trying to solve a 1-form Hodge-Laplacian problem in 2D, the mixed formulation (4.32) of Arnold is: Find For all Eq (7.10) of Arnold gives FEEC names for pairs of spaces that are stable for discretisation of the k-form Hodge Laplacian, in your code you wanted to use the But we have to be slightly careful, there are two versions of the "RT" elements in 2D, related by a rotation of the dofs by 90 degrees. You want the You code asks for the "face" version of the RT elements So this works: from firedrake import *
mesh = ...
# The V^1 space
SRT = FunctionSpace(mesh, "RTE", 1)
# The V^0 space
SP = FunctionSpace(mesh, "CG", 1)
V = SRT * SP
u, sigma = TrialFunctions(V)
v, tau = TestFunctions(V)
a = (
inner(sigma, tau)
- inner(u, grad(tau))
+ inner(grad(sigma), v)
+ inner(curl(u), curl(v))
) * dx
x, y = SpatialCoordinate(mesh)
f = as_vector([-1, 0])
L = inner(f, v) * dx
g = Function(V)
solve(a == L, g) |
Beta Was this translation helpful? Give feedback.
-
Also, Ed, are you the same Ed Threlfall who went to Farlingaye High School in the 1990s?
|
Beta Was this translation helpful? Give feedback.
-
Wow! Drop me a line by email if you want to catch up.
On 27 May 2022, at 21:14, ethrelfall ***@***.***> wrote:
Colin, I try not to think too much about my years at FHS, but yes, it's me. Good to hear from you :)
|
Beta Was this translation helpful? Give feedback.
So the problem is you're trying to solve a 1-form Hodge-Laplacian problem in 2D, the mixed formulation (4.32) of Arnold is:
Find$(\sigma, u) \in H^1 \times H(\text{curl})$ such that
For all$(\tau, v) \in H^1 \times H(\text{curl})$ .
Eq (7.10) of Arnold gives FEEC names for pairs of spaces that are stable for discretisation of the k-form Hodge Laplacian, in your code you wanted to use the$P^-$ spaces: $V^{k-1} := P_r^{-}\Lambda^{k-1} \subset H^1$ , $V^k := P_{r}^{-}\Lambda^{k} \subset H(\text{curl})$ . Loo…