2 % Automatic computation of integrals with Sage
4 % This
function is used in validation tests.
6 % OptFEM2DP1 [V1.1] - Copyright (C) 2013 CJS (LAGA)
8 % This file is part of OptFEM2DP1.
9 % OptFEM2DP1 is free software: you can redistribute it and/or modify
10 % it under the terms of the GNU General Public License as published by
11 % the Free Software Foundation, either version 3 of the License, or
12 % (at your option) any later version.
14 % OptFEM2DP1 is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 % GNU General Public License
for more details.
19 % You should have received a copy of the GNU General Public License
20 % along with
this program. If
not, see <http:
22 Test(i).u=@(x,y) x + y;
24 Test(i).v=@(x,y) x - y;
26 Test(i).w=@(x,y) 2.*x + y;
28 Test(i).Mass=0.0000000000000000;
29 Test(i).MassW=0.08333333333333333;
30 Test(i).Stiff=0.0000000000000000;
33 Test(i).u=@(x,y) 3.*x + 2.*y - 1;
34 Test(i).cu=
'3*x + 2*y - 1';
35 Test(i).v=@(x,y) 2.*x - 2.*y + 1;
36 Test(i).cv=
'2*x - 2*y + 1';
37 Test(i).w=@(x,y) 2.*x - 5.*y;
38 Test(i).cw=
'2*x - 5*y';
39 Test(i).Mass=1.666666666666667;
40 Test(i).MassW=-1.083333333333333;
41 Test(i).Stiff=2.000000000000000;
44 Test(i).u=@(x,y) 3.*x.^2 - x.*y + 2.*y.^2;
45 Test(i).cu=
'3*x^2 - x*y + 2*y^2';
46 Test(i).v=@(x,y) 2.*x.^2 + x.*y - 3.*y.^2 - y;
47 Test(i).cv=
'2*x^2 + x*y - 3*y^2 - y';
48 Test(i).w=@(x,y) x.*y;
50 Test(i).Mass=-0.7500000000000000;
51 Test(i).MassW=-0.3416666666666667;
52 Test(i).Stiff=0.8333333333333333;
55 Test(i).u=@(x,y) 3.*x.^2 - 4.*x.*y + 2.*y.^2 - x + 4.*y + 4;
56 Test(i).cu=
'3*x^2 - 4*x*y + 2*y^2 - x + 4*y + 4';
57 Test(i).v=@(x,y) 2.*x.^2 + 2.*x.*y - 3.*y.^2 - 2.*y + 1;
58 Test(i).cv=
'2*x^2 + 2*x*y - 3*y^2 - 2*y + 1';
59 Test(i).w=@(x,y) x.^2 + y.^2 - 3;
60 Test(i).cw=
'x^2 + y^2 - 3';
61 Test(i).Mass=-0.3611111111111111;
62 Test(i).MassW=0.2805555555555556;
63 Test(i).Stiff=-17.33333333333333;
66 Test(i).u=@(x,y) 3.*x.^3 - 2.*x.*y + 2.*y.^2 + 3.*x;
67 Test(i).cu=
'3*x^3 - 2*x*y + 2*y^2 + 3*x';
68 Test(i).v=@(x,y) -3.*y.^3 + 2.*x.^2 + 2.*x.*y - 2.*y;
69 Test(i).cv=
'-3*y^3 + 2*x^2 + 2*x*y - 2*y';
70 Test(i).w=@(x,y) x.^2.*y + x.*y.^2 - 2.*x.*y + 1;
71 Test(i).cw=
'x^2*y + x*y^2 - 2*x*y + 1';
72 Test(i).Mass=-0.5708333333333333;
73 Test(i).MassW=-0.4377380952380952;
74 Test(i).Stiff=10.33333333333333;
77 Test(i).u=@(x,y) 3.*x.^4 + 3.*x.^3 + 2.*y.^2;
78 Test(i).cu=
'3*x^4 + 3*x^3 + 2*y^2';
79 Test(i).v=@(x,y) 2.*y.^4 - 3.*y.^3 + 2.*x.^2;
80 Test(i).cv=
'2*y^4 - 3*y^3 + 2*x^2';
81 Test(i).w=@(x,y) x.^4 + y.^3 - 3;
82 Test(i).cw=
'x^4 + y^3 - 3';
83 Test(i).Mass=1.400515873015873;
84 Test(i).MassW=-3.020477994227994;
85 Test(i).Stiff=16.00000000000000;
88 Test(i).u=@(x,y) x.^5 + 3.*x.^3.*y.^2 - y.^5;
89 Test(i).cu=
'x^5 + 3*x^3*y^2 - y^5';
90 Test(i).v=@(x,y) 3.*x.^5 + 2.*x.^3.*y.^2 + 2.*y.^5 + 2.*x.^2.*y.^2;
91 Test(i).cv=
'3*x^5 + 2*x^3*y^2 + 2*y^5 + 2*x^2*y^2';
92 Test(i).w=@(x,y) -3.*x.^3.*y.^2 + x.^2 + y.^2 + 1;
93 Test(i).cw=
'-3*x^3*y^2 + x^2 + y^2 + 1';
94 Test(i).Mass=0.9669672919672920;
95 Test(i).MassW=1.011666243809101;
96 Test(i).Stiff=18.73777777777778;
99 Test(i).u=@(x,y) x.^6 - x.^5 + 3.*x.^3.*y.^2 - y.^5;
100 Test(i).cu=
'x^6 - x^5 + 3*x^3*y^2 - y^5';
101 Test(i).v=@(x,y) y.^6 + 3.*x.^5 + 2.*x.^3.*y.^2 + 2.*y.^5 + 2.*x.^2.*y.^2;
102 Test(i).cv=
'y^6 + 3*x^5 + 2*x^3*y^2 + 2*y^5 + 2*x^2*y^2';
103 Test(i).w=@(x,y) 4.*x.^6 - 3.*x.^3.*y.^3 - y.^6;
104 Test(i).cw=
'4*x^6 - 3*x^3*y^3 - y^6';
105 Test(i).Mass=0.4305452484023913;
106 Test(i).MassW=0.5553725794902266;
107 Test(i).Stiff=6.920317460317460;