supermesh projection for KMV elements #2422
Replies: 4 comments 9 replies
-
I found out the source of this issue. It is necessary to force the integration rule to be KMV too in both assembly calls, rhs and mixed mass matrix, e.g. (supermeshing.py:194): qr_x = finat.quadrature.make_quadrature( |
Beta Was this translation helpful? Give feedback.
-
Relevant Slack conversation: https://firedrakeproject.slack.com/archives/C1Q0Y6H8A/p1652626816762209 So it seems that UFL polynomial degree estimate somehow needs to be amended for KMV P2 as it contains a P3 basis. |
Beta Was this translation helpful? Give feedback.
-
My understanding of the "degree" of a finite element is the degree of the minimal complete polynomial space containing the function space of the element. So if a KMV function is (some special kind of) a cubic polynomial, its degree should be 3 (in my opinion). The quadrature estimator would then do the right thing. |
Beta Was this translation helpful? Give feedback.
-
Relabeling the degree is problematic since it will throw off the degree estimation algorithm in UFL. It’s best to let things ride and just use a custom quadrature when you need the diagonal mass matrix. You can replace project with a call to solve on a very simple L^2 inner product or, even better, interpolation since these coincide for KMV elements with KMV quadrature.
… On May 20, 2022, at 7:16 AM, santos-td ***@***.***> wrote:
Hi, thanks for looking into it and clarifying those points. I will perform some tests after relabeling the KMV elements, and then make a pull request.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
-
Dear all,
I am trying to project (supermesh projection) a solution obtained with a mesh (m1) onto another mesh (m2). I use KMV elements (Kong-Mulder-Veldhuizen, which are continuous with additional internal bubble functions). The projection works well for KMV P1, P3, P4, and P5 (max order of KMV elements), which means that f1 (a function defined over m1) is numerically equal to f2 (the function projected on m2). However, for KMV P2, f2 seems odd, with error (f1-f2) as high as 30%, at least for the code below.
Would you have any idea about the source of this error so I could try to fix it? Or maybe I am missing something and the projection will only work for Lagrange elements? Any idea would be helpful.
Thank you in advance
Thiago
from firedrake import *
m1 = RectangleMesh(15, 15, 1, 1)
m2 = RectangleMesh(10, 10, 1, 1)
P = 2
V1 = FunctionSpace(m1, 'KMV', P)
V2 = FunctionSpace(m2, 'KMV', P)
f1 = Function(V1).interpolate(Constant(1))
f2 = Function(V2)
#f2 = Projector(f1, V2).project()
f2.project(f1)
File("f1.pvd").write(f1)
File("f2.pvd").write(f2)
Beta Was this translation helpful? Give feedback.
All reactions