18-Apr-2019 15:54:38 fem2d_bvp_serene_test MATLAB version 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 (0.966648,3.18083) dVdX dVdY 1 -0.04005 -0.404 2 0.006031 0.4994 3 0.03402 -0.4146 4 -0.1645 0.8465 5 -0.4029 -0.4319 6 0.06067 -0.4994 7 0.3422 -0.3879 8 0.1645 0.7918 Sum: -2.776e-17 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.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 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 image saved as "fem2d_bvp_serene_test04.png". fem2d_bvp_serene_test Normal end of execution. 18-Apr-2019 15:54:43