14-May-2025 23:21:07 fem2d_bvp_serene_test(): MATLAB/Octave version 6.4.0 Test fem2d_bvp_serene(). fem2d_bvp_serene_test01(): Solve - del ( A del U ) + C U = F on the unit square with zero boundary conditions. A1(X,Y) = 1.0 C1(X,Y) = 0.0 F1(X,Y) = 2*X*(1-X)+2*Y*(1-Y). U1(X,Y) = X * ( 1 - X ) * Y * ( 1 - Y ) The grid uses 5 by 5 nodes. The number of nodes is 21 I J X Y U Uexact Error 1 1 0.000000 0.000000 0.000000 0.000000 0.000000e+00 2 1 0.250000 0.000000 0.000000 0.000000 0.000000e+00 3 1 0.500000 0.000000 0.000000 0.000000 0.000000e+00 4 1 0.750000 0.000000 0.000000 0.000000 0.000000e+00 5 1 1.000000 0.000000 0.000000 0.000000 0.000000e+00 1 2 0.000000 0.250000 0.000000 0.000000 0.000000e+00 3 2 0.500000 0.250000 0.027644 0.046875 1.923077e-02 5 2 1.000000 0.250000 0.000000 0.000000 0.000000e+00 1 3 0.000000 0.500000 0.000000 0.000000 0.000000e+00 2 3 0.250000 0.500000 0.000000 0.046875 4.687500e-02 3 3 0.500000 0.500000 0.000000 0.062500 6.250000e-02 4 3 0.750000 0.500000 0.000000 0.046875 4.687500e-02 5 3 1.000000 0.500000 0.000000 0.000000 0.000000e+00 1 4 0.000000 0.750000 0.053268 0.000000 5.326761e-02 3 4 0.500000 0.750000 0.061861 0.046875 1.498636e-02 5 4 1.000000 0.750000 0.053268 0.000000 5.326761e-02 1 5 0.000000 1.000000 0.067733 0.000000 6.773313e-02 2 5 0.250000 1.000000 0.073165 0.000000 7.316468e-02 3 5 0.500000 1.000000 0.077108 0.000000 7.710813e-02 4 5 0.750000 1.000000 0.073165 0.000000 7.316468e-02 5 5 1.000000 1.000000 0.067733 0.000000 6.773313e-02 l1 error = 0.0312336 L2 error = 0.0342886 H1S error = 0.201832 fem2d_bvp_serene_test02(): Basis function checks. The matrix Aij = V(i)(X(j),Y(j)) should be the identity. 1 0 -0 -0 -0 -0 -0 0 -0 1 0 0 0 0 -0 -0 0 0 1 0 -0 -0 0 0 0 -0 -0 1 0 0 -0 -0 -0 0 0 -0 1 0 0 0 0 -0 -0 0 0 1 -0 -0 0 0 0 -0 -0 0 1 0 -0 -0 -0 0 0 0 0 1 The vectors dVdX(1:8)(X,Y) and dVdY(1:8)(X,Y) should both sum to zero for any (X,Y). Random evaluation point is (1.37809,3.02261) dVdX dVdY 1 -0.00125 -0.5432 2 -0.008548 0.4285 3 0.009799 -0.3627 4 -0.02235 0.6079 5 -0.1094 -0.2451 6 -0.7476 -0.4285 7 0.857 -0.8037 8 0.02235 1.347 Sum: 1.006e-16 0 fem2d_bvp_serene_test03(): Solve - del ( A del U ) + C U = F on the unit square with zero boundary conditions. A1(X,Y) = 0.0 C1(X,Y) = 1.0 F1(X,Y) = X * ( 1 - X ) * Y * ( 1 - Y ). U1(X,Y) = X * ( 1 - X ) * Y * ( 1 - Y ) This example is contrived so that the system matrix is the WATHEN matrix. The grid uses 5 by 5 nodes. The number of nodes is 21 The Wathen elementary mass matrix: ans = 6.0000 -6.0000 2.0000 -8.0000 3.0000 -8.0000 2.0000 -6.0000 -6.0000 32.0000 -6.0000 20.0000 -8.0000 16.0000 -8.0000 20.0000 2.0000 -6.0000 6.0000 -6.0000 2.0000 -8.0000 3.0000 -8.0000 -8.0000 20.0000 -6.0000 32.0000 -6.0000 20.0000 -8.0000 16.0000 3.0000 -8.0000 2.0000 -6.0000 6.0000 -6.0000 2.0000 -8.0000 -8.0000 16.0000 -8.0000 20.0000 -6.0000 32.0000 -6.0000 20.0000 2.0000 -8.0000 3.0000 -8.0000 2.0000 -6.0000 6.0000 -6.0000 -6.0000 20.0000 -8.0000 16.0000 -8.0000 20.0000 -6.0000 32.0000 I J X Y U Uexact Error 1 1 0.000000 0.000000 0.000000 0.000000 0.000000e+00 2 1 0.250000 0.000000 0.000000 0.000000 0.000000e+00 3 1 0.500000 0.000000 0.000000 0.000000 0.000000e+00 4 1 0.750000 0.000000 0.000000 0.000000 0.000000e+00 5 1 1.000000 0.000000 0.000000 0.000000 0.000000e+00 1 2 0.000000 0.250000 0.000000 0.000000 0.000000e+00 3 2 0.500000 0.250000 0.068359 0.046875 2.148438e-02 5 2 1.000000 0.250000 0.000000 0.000000 0.000000e+00 1 3 0.000000 0.500000 0.000000 0.000000 0.000000e+00 2 3 0.250000 0.500000 0.000000 0.046875 4.687500e-02 3 3 0.500000 0.500000 0.000000 0.062500 6.250000e-02 4 3 0.750000 0.500000 0.000000 0.046875 4.687500e-02 5 3 1.000000 0.500000 0.000000 0.000000 0.000000e+00 1 4 0.000000 0.750000 0.005642 0.000000 5.642361e-03 3 4 0.500000 0.750000 0.062934 0.046875 1.605903e-02 5 4 1.000000 0.750000 0.005642 0.000000 5.642361e-03 1 5 0.000000 1.000000 -0.011285 0.000000 1.128472e-02 2 5 0.250000 1.000000 -0.009983 0.000000 9.982639e-03 3 5 0.500000 1.000000 -0.032118 0.000000 3.211806e-02 4 5 0.750000 1.000000 -0.009983 0.000000 9.982639e-03 5 5 1.000000 1.000000 -0.011285 0.000000 1.128472e-02 l1 error = 0.0133205 L2 error = 0.0160768 H1S error = 0.185098 WATHEN Matrix from "gallery('wathen',1,1)" ans = 6 -6 2 -8 3 -8 2 -6 -6 32 -6 20 -8 16 -8 20 2 -6 6 -6 2 -8 3 -8 -8 20 -6 32 -6 20 -8 16 3 -8 2 -6 6 -6 2 -8 -8 16 -8 20 -6 32 -6 20 2 -8 3 -8 2 -6 6 -6 -6 20 -8 16 -8 20 -6 32 fem2d_bvp_serene_test04() Solve - del ( A del U ) + C U = F on the unit square with zero boundary conditions. Use fem2d_bvp_serene_extend() to "extend" the solution. A4(X,Y) = 1.0 C4(X,Y) = 0.0 F4(X,Y) = 2*X*(1-X)+2*Y*(1-Y). U4(X,Y) = X * ( 1 - X ) * Y * ( 1 - Y ) The grid uses 17 by 17 nodes. The number of nodes is 225 Graphics saved as "fem2d_bvp_serene_test04.png". fem2d_bvp_serene_test(): Normal end of execution. 14-May-2025 23:21:14