P3 Cubic Element in 2D
We explain degree of freedoms for the cubic element on triangles There are three types of dofs: vertex type, edge type and element type Given a mesh, the required data structure can be constructured by
[elem2dof,elem2edge,edge,bdDof,freeDof] = dofP3(elem)
Contents
help dofP3
DOFP3 dof structure for P3 element. [elem2dof,elem2edge,edge,bdDof] = DOFP3(elem) constructs the dof structure for the quadratic element based on a triangle. elem2dof(t,i) is the global index of the i-th dof of the t-th element. The global indices of the dof is organized according to the order of nodes, edges and elements. To be consistent, the dof on an edge depends on the orientation of edge only. See also dofP2, dof3P3. Documentation: <a href="matlab:ifem dofP3doc">P3 Cubic Element in 2D</a> Created by Jie Zhou. M-lint by Long Chen. Copyright (C) Long Chen. See COPYRIGHT.txt for details.
Local indexing of DOFs
node = [0 0; 1 0; 0.5 0.5*sqrt(3)]; elem = [1 2 3]; lambda = [1 0 0; 0 1 0; 0 0 1; ... % 1,2,3 three vertices 0 1/3 2/3; 0 2/3 1/3; ... % 4, 5 first edge 2/3 0 1/3; 1/3 0 2/3; ... % 6, 7 second edge 1/3 2/3 0; 2/3 1/3 0; ... % 8, 9 third edge 1/3 1/3 1/3]; % 10 center of element dofNode = lambda*node; figure; set(gcf,'Units','normal'); set(gcf,'Position',[0,0,0.3,0.3]); showmesh(node,elem); hold on; findnode(dofNode);
A local basis of P3
The 10 Lagrange-type basis functions are denoted by , i.e . In barycentric coordinates, they are
When transfer to the reference triangle formed by , the local bases in x-y coordinate can be obtained by substituting
Global indexing of DOFs
The global indices of the dof is organized according to the order of nodes, edges and elements. To be consistent, the dof on an edge depends on the orientation of edge only.