12-Jul-2023 13:54:32 fem2d_bvp_serene_test(): MATLAB/Octave version 5.2.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.90687,4.28376) dVdX dVdY 1 0.6732 0.7029 2 -1.164 0.08879 3 0.491 -0.007901 4 -0.4597 -0.02643 5 0.3756 0.03433 6 -0.6495 -0.08879 7 0.274 -0.1618 8 0.4597 -0.5411 Sum: 1.11e-16 1.11e-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 = 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 saved as "fem2d_bvp_serene_test04.png". fem2d_bvp_serene_test(): Normal end of execution. 12-Jul-2023 13:54:41