% Program to produce the triangulation, % boundary condition and initial values % at the interior nodes for a Washer. clear all % V contains vertices V = [% interior points 1.4712 0.2926 1.2472 0.8334 0.8334 1.2472 0.2926 1.4712 -0.2926 1.4712 -0.8334 1.2472 -1.2472 0.8334 -1.4712 0.2926 -1.4712 -0.2926 -1.2472 -0.8334 -0.8334 -1.2472 -0.2926 -1.4712 0.2926 -1.4712 0.8334 -1.2472 2.0000 0 1.8478 0.7654 1.4142 1.4142 0.7654 1.8478 0.0000 2.0000 -0.7654 1.8478 -1.4142 1.4142 -1.8478 0.7654 -2.0000 0.0000 -1.8478 -0.7654 -1.4142 -1.4142 -0.7654 -1.8478 -0.0000 -2.0000 0.7654 -1.8478 1.4142 -1.4142 1.8478 -0.7654 1.2472 -0.8334 1.4712 -0.2926 % outerboundary 2.4520 0.4877 2.0787 1.3889 1.3889 2.0787 0.4877 2.4520 -0.4877 2.4520 -1.3889 2.0787 -2.0787 1.3889 -2.4520 0.4877 -2.4520 -0.4877 -2.0787 -1.3889 -1.3889 -2.0787 -0.4877 -2.4520 0.4877 -2.4520 1.3889 -2.0787 2.0787 -1.3889 2.4520 -0.4877 % inner boundary 1.0000 0 0.9239 0.3827 0.7071 0.7071 0.3827 0.9239 0.0000 1.0000 -0.3827 0.9239 -0.7071 0.7071 -0.9239 0.3827 -1.0000 0.0000 -0.9239 -0.3827 -0.7071 -0.7071 -0.3827 -0.9239 -0.0000 -1.0000 0.3827 -0.9239 0.7071 -0.7071 0.9239 -0.3827]; % T assigns the traingles T = [43 42 25 11 10 59 11 10 25 23 40 41 22 40 39 22 23 40 21 38 39 21 22 7 21 22 39 24 10 9 24 42 41 24 42 25 24 10 25 24 23 41 24 23 9 27 45 44 28 45 46 28 27 45 30 47 48 29 47 46 29 28 14 29 28 46 29 30 47 26 11 12 26 43 44 26 43 25 26 11 25 26 27 44 26 27 12 20 38 37 20 21 38 58 57 9 58 10 59 58 10 9 8 57 56 8 22 23 8 23 9 8 57 9 8 56 7 8 22 7 63 62 14 60 61 12 60 11 59 60 11 12 13 61 62 13 28 27 13 27 12 13 61 12 13 62 14 13 28 14 19 36 37 19 20 37 19 20 5 17 34 35 55 56 7 53 54 5 18 36 35 18 19 36 18 17 35 16 33 34 16 17 34 6 55 54 6 20 21 6 21 7 6 55 7 6 20 5 6 54 5 4 19 5 4 53 5 4 53 52 4 18 19 3 18 17 3 4 52 3 4 18 2 16 17 2 3 17 31 29 30 31 32 30 31 32 64 31 64 63 31 29 14 31 63 14 15 30 48 15 32 30 15 33 48 15 16 33 1 2 16 1 15 16 1 15 32 51 3 52 51 2 3 50 1 2 50 51 2 49 1 32 49 32 64 49 50 1]; % x, y are row vectors containing coordinates of vertices x = V(:,1)'; y = V(:,2)'; % n is the number of vertices n= size(V,1); % m is the number of interior vertices m = 32; % p is the number of triangles p= size(T,1); % Plot the mesh figure trimesh(T,x,y) % Set values at nodes % The first 32 entries are interior vertices, the final 32 are % boundary vertices. z = x+2.5; % Set node values to a linear funtion. z(49:64) = 0; % Set inner boundary nodes to zero. z(1:32) = 0; % Set interior nodes to zero. % Plot the mesh with node values specified. figure trimesh(T,x,y,z)