dolfinx icon indicating copy to clipboard operation
dolfinx copied to clipboard

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

Open jmv2009 opened this issue 1 year ago • 4 comments

@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 avatar Dec 11 '24 19:12 jmv2009

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

jhale avatar Dec 14 '24 07:12 jhale

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 avatar Dec 14 '24 08:12 jmv2009

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.

jhale avatar Dec 19 '24 17:12 jhale

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.

jmv2009 avatar Dec 20 '24 15:12 jmv2009