07-Jan-2022 20:00:35 fem2d_bvp_serene_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 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.62945,4.81158) dVdX dVdY 1 0.9377 0.9176 2 -1.14 0.3019 3 0.2026 0.09206 4 -0.1707 -0.3007 5 0.09753 0.2087 6 -0.1186 -0.3019 7 0.02107 0.4048 8 0.1707 -1.322 Sum: 0 2.22e-16 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 = Columns 1 through 7 6.0000 -6.0000 2.0000 -8.0000 3.0000 -8.0000 2.0000 -6.0000 32.0000 -6.0000 20.0000 -8.0000 16.0000 -8.0000 2.0000 -6.0000 6.0000 -6.0000 2.0000 -8.0000 3.0000 -8.0000 20.0000 -6.0000 32.0000 -6.0000 20.0000 -8.0000 3.0000 -8.0000 2.0000 -6.0000 6.0000 -6.0000 2.0000 -8.0000 16.0000 -8.0000 20.0000 -6.0000 32.0000 -6.0000 2.0000 -8.0000 3.0000 -8.0000 2.0000 -6.0000 6.0000 -6.0000 20.0000 -8.0000 16.0000 -8.0000 20.0000 -6.0000 Column 8 -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 = Columns 1 through 7 6.0000 -6.0000 2.0000 -8.0000 3.0000 -8.0000 2.0000 -6.0000 32.0000 -6.0000 20.0000 -8.0000 16.0000 -8.0000 2.0000 -6.0000 6.0000 -6.0000 2.0000 -8.0000 3.0000 -8.0000 20.0000 -6.0000 32.0000 -6.0000 20.0000 -8.0000 3.0000 -8.0000 2.0000 -6.0000 6.0000 -6.0000 2.0000 -8.0000 16.0000 -8.0000 20.0000 -6.0000 32.0000 -6.0000 2.0000 -8.0000 3.0000 -8.0000 2.0000 -6.0000 6.0000 -6.0000 20.0000 -8.0000 16.0000 -8.0000 20.0000 -6.0000 Column 8 -6.0000 20.0000 -8.0000 16.0000 -8.0000 20.0000 -6.0000 32.0000 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. 07-Jan-2022 20:00:46