from
FELICITY
by Shawn Walker Finite ELement Implementation and Computational Interface Tool for You
test_L1_genericform()
function status = test_L1_genericform()
%test_L1_genericform
%
% Test code for FELICITY class.
% Copyright (c) 08-01-2011, Shawn W. Walker
status = 0;
% define some domains
Omega = Domain('triangle');
Sigma = Domain('interval') < Omega;
% define FEM spaces
V1 = Element(Sigma,lagrange_deg1_dim1,2);
v = Test(V1);
u = Trial(V1);
f = Coef(V1);
% just test Bilinear
Mass_Matrix = Bilinear(V1,V1);
I1 = Integral(Sigma,f.val(1) * v.val' * u.val);
Mass_Matrix = Mass_Matrix.Add_Integral(I1);
if ~strcmp(Mass_Matrix.Integral.TestF.Name,'v')
status = 1;
end
if ~strcmp(Mass_Matrix.Integral.TrialF.Name,'u')
status = 1;
end
if ~strcmp(Mass_Matrix.Integral.CoefF.Name,'f')
status = 1;
end
if ~(Mass_Matrix.Integral.Integrand==sym('f_v1_t1*u_v1_t1*v_v1_t1 + f_v1_t1*u_v1_t2*v_v1_t2'))
status = 1;
end
if ~strcmp(Mass_Matrix.Integral.Domain.Name,'Sigma')
status = 1;
end
if ~strcmp(Mass_Matrix.Integral.Domain.Subset_Of,'Omega')
status = 1;
end
%%%%%%%%%%%%%
if (status==0)
disp('Test passed!');
else
disp('Test failed!');
end
end