Code covered by the BSD License  

Highlights from
FELICITY

image thumbnail

FELICITY

by

 

21 Apr 2011 (Updated )

Finite ELement Implementation and Computational Interface Tool for You

Elem2_2D_Test()
function Elem = Elem2_2D_Test()
%Elem2_2D_Test
%
%   This defines a finite element for testing the DoF allocation code.

% Copyright (c) 12-01-2010,  Shawn W. Walker

% name it!
Elem.Name = 'Elem2_Test';

% continuous galerkin space
Elem.Type = 'CG';

% intrinsic dimension and domain
Elem.Dim = 2;
Elem.Domain = 'triangle';

% basis function definitions
% NOTE: these basis functions are NOT used in this test!
Elem.Basis.Func =...
    {{'x'};
     {'y'};
     {'1 - x - y'};
     {'x'};
     {'y'};
     {'1 - x - y'};
     {'x'};
     {'y'};
     {'1 - x - y'};
     {'1 - x - y'}};
%

% nodal variables (dual basis)
% note: there can be more than one set of nodal variables (see above)
% barycentric coordinates (point evaluation)
Elem.Nodal_Var.Type  = 'point evaluation';
Elem.Nodal_Var.Basis =...
    {{'phi'}, [1,0,0];
     {'phi'}, [0,1,0];
     {'phi'}, [0,0,1];
     {'phi'}, [1,0,0];
     {'phi'}, [0,1,0];
     {'phi'}, [0,0,1];
     {'phi'}, [0,0,1];
     {'phi'}, [1,0,0];
     {'phi'}, [0,1,0];
     {'phi'}, [0,0,1]};
%

% NOTE: this IS used.
%%%%% nodal (topological) arrangement

% nodes attached to vertices
Elem.Nodal_Top.V = {[1; 2; 3]};

% nodes attached to (directed) edges
Elem.Nodal_Top.E = {[4, 7;
                     5, 8;
                     6, 9]};
%

% nodes attached to (triangles) faces
Elem.Nodal_Top.F = {[10]}; % cubic bubble

% nodes attached to tetrahedra
Elem.Nodal_Top.T = {[]}; % no tetrahedra in 2-D

end

Contact us