Code covered by the BSD License

# FELICITY

### Shawn Walker (view profile)

21 Apr 2011 (Updated )

Finite ELement Implementation and Computational Interface Tool for You

test_L1_code.m
```% test_L1_code
% unofficial test code
clc;
clear all classes;

Omega = Domain('triangle');
Sigma = Domain('interval') < Omega;

C0 = Element(Sigma);
W1 = Element(Omega,lagrange_deg1_dim2,1);
V1 = Element(Sigma,lagrange_deg1_dim1,2);

w = Test(W1,Sigma); % need to restrict this function!

v = Test(V1);
u = Trial(V1);
f = Coef(V1);

gf = GeoFunc(Sigma);

% v.val
% u.val
% f.val
%
%
% v.ds
% u.ds
% f.ds

% gf.X
% gf.Tangent_Space_Proj
% gf.deriv_X
% gf.T
% gf.N
% gf.VecKappa
% gf.Kappa
% gf.Kappa_Gauss
% gf.
% gf.
% gf.
% gf.

% FEM matrices
Mass_Matrix = Bilinear(V1,V1);
I1 = Integral(Sigma,f.val(1) * v.val' * u.val,u,f,v);

Stiff_Matrix = Bilinear(V1,V1);

RHS_Matrix = Linear(V1);
I3 = Integral(Sigma,v.val' * [1; 1],v);

Bdy_Matrix = Bilinear(W1,V1);

Small_Matrix = Real(2,2);
ffoo = sym('foo(F)');
ffoo = subs(ffoo,'F',f.val);
I5 = Integral(Sigma,ffoo(2) * gf.X(2),f);

G1 = GeoElement(Omega,lagrange_deg1_dim2);
MATS = Matrices(Quadrature_Order,G1); % include C code!!!
% this has the definition of "foo" (see "Body_Force_Matrix")
MATS = MATS.Include_C_Code('my_foo_code.c');

MATS = MATS.Append_Matrix(Mass_Matrix);
MATS = MATS.Append_Matrix(Stiff_Matrix);
MATS = MATS.Append_Matrix(RHS_Matrix);
MATS = MATS.Append_Matrix(Bdy_Matrix);
MATS = MATS.Append_Matrix(Small_Matrix);

CONVERT = L1toL3(MATS);
Main_Dir = 'C:\TEMP\CODES\';
Snippet_Dir = 'C:\TEMP\CODES\';
[FS, FM, C_Codes] = CONVERT.Run_Conversion(Main_Dir,Snippet_Dir);

FS
FM

% END %```