Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laplacian of nullspace of trace in Q for internal dof functionals TNT quadrilateral #3559

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

jmv2009
Copy link

@jmv2009 jmv2009 commented Dec 11, 2024

@mscroggs
According to https://github.com/mscroggs/symfem/blob/main/symfem/elements/tnt.py, we need to multiply by the primary bubble function, and take the Laplacian for the interior dofs. To this end tabulation which also generates the derivatives is used.
This will aid in generating 3D TNT elements in Basix.

Status: finishing hex.
Status: finishing prism. Todo: check elongated diagonal face and edges for functional scaling consistency

@jmv2009 jmv2009 force-pushed the patch-1 branch 6 times, most recently from 1f9e6da to b434058 Compare December 13, 2024 21:04
@jhale
Copy link
Member

jhale commented Dec 14, 2024

Could you tighten up the PR title and description and move the extra details to a post further down?

@jmv2009 jmv2009 changed the title Update demo_tnt-elements.py Laplacian of trace kernel for internal dofs TNT quadrilateral Dec 14, 2024
@jmv2009
Copy link
Author

jmv2009 commented Dec 14, 2024

Details:
The numerical results do not change at this point. This is because the exact definition of internal dofs does not really matter: As long as internal dof functionals are sufficiently independent from the point and edge dof functionals, the full space is spanned.
Please check contribution for form (including python conventions/requirements). Feel free to make your own version of this.
Note: Also need to check the quadrature degree to get to exactness, as it appears to be higher. [Correct: adjusted by +1]
First documented use of new tabulate_polynomial_set python function?

Reference implementation mathematica shape function tabulation (orders of vertices and edges are different):
k=3
xt={0,1,1,0,0}
yt={0,0,1,1,0}
space=Join[MonomialList[(1+x)^k(1+y)^k],{x,y}^(k+1),{x,y}^k x y]
tst=space.Inverse[Join[Table[space/.{x->xt[[i]],y->yt[[i]]},{i,4}],Flatten[Table[Integrate[space LegendreP[n,2s-1]Sqrt[2 n +1]/.{x->xt[i]+xt[[i+1]]s,y->yt[i]+yt[[i+1]]s},{s,0,1}],{i,4},{n,0,k-1}],1],Flatten[Table[Integrate[space Laplacian[s(s-1)t(t-1)LegendreP[n1,2s-1]Sqrt[2 n1+1]LegendreP[n2,2t-1]Sqrt[2 n2 +1],{s,t}]/.{x->s,y->t},{s,0,1},{t,0,1}],{n1,0,k-2},{n2,0,k-2}],1]]]
Flatten[Table[tst,{y,0,1,1/(k+1)},{x,0,1,1/(k+1)}],0]//N//MatrixForm

The only difference with symfem is that the dof functionals do not correspond to monomials but to normalized Legendre polynomials, as per the dof functional tabulation.

@jmv2009 jmv2009 changed the title Laplacian of trace kernel for internal dofs TNT quadrilateral Laplacian of kernel of trace of Q for internal dofs TNT quadrilateral Dec 14, 2024
@jmv2009 jmv2009 changed the title Laplacian of kernel of trace of Q for internal dofs TNT quadrilateral Laplacian of kernel space of trace in Q for internal dofs TNT quadrilateral Dec 14, 2024
@jmv2009 jmv2009 changed the title Laplacian of kernel space of trace in Q for internal dofs TNT quadrilateral Laplacian of nullspace of trace in Q for internal dofs TNT quadrilateral Dec 14, 2024
@jmv2009 jmv2009 changed the title Laplacian of nullspace of trace in Q for internal dofs TNT quadrilateral Laplacian of nullspace of trace in Q for internal dof functionals TNT quadrilateral Dec 14, 2024
@jmv2009 jmv2009 force-pushed the patch-1 branch 2 times, most recently from 04df188 to e13379b Compare December 15, 2024 11:38
@jmv2009 jmv2009 marked this pull request as draft December 15, 2024 14:05
According to https://github.com/mscroggs/symfem/blob/main/symfem/elements/tnt.py, we need to multiply by the primary bubble function, and take the laplacian. To this end tabulation which also generates the derivatives is used.
@jhale
Copy link
Member

jhale commented Dec 19, 2024

I appreciate that this is still a draft but the PR is drifting away from the original purpose of the demo - showing how a relatively simple but non-trivial element can be implemented at runtime with Basix.

@jmv2009
Copy link
Author

jmv2009 commented Dec 20, 2024

Yeah, this IS getting out of hand, which is a good thing. Please be patient for now: I appear on track to a reference implementation for the whole TNT de Rham complex for all elements (including a fully compatible curl - prism). Up to now, a fully compatible and admissible TNT-curl-prism element is elusive as far as I know. https://arxiv.org/pdf/1605.00132. I have already not seen an implementation of the 0-Form TNT prism, which is already included here. Also this variant for the 0-Form for the triangle and tetrahedron may be novel, although a serendipity implementation would have the same degree of freedoms, just as it does for the interval. Pyramids may be more tricky. Let's see how far we get, and then see how about implementing them in c++ Basix and/or Symfem. The advantage of doing it here first is a very simple implementation, which can be easily tested. The TNT family appears to be the most complex, and other families can be done also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants