08-Jan-2022 07:58:39 quad_mesh_test() MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test quad_mesh(). QUAD_MESH_TEST01 ADJ_SIZE_Q4_MESH() counts the node adjacencies. Number of adjacency entries is 186 Adjacency pointers: 1 1 4 2 5 10 3 11 16 4 17 22 5 23 26 6 27 32 7 33 41 8 42 50 9 51 59 10 60 67 11 68 71 12 72 77 13 78 85 14 86 93 15 94 102 16 103 111 17 112 117 18 118 123 19 124 131 20 132 139 21 140 148 22 149 156 23 157 160 24 161 164 25 165 170 26 171 176 27 177 182 28 183 186 QUAD_MESH_TEST02 AREA_Q4_MESH computes the area of each element in a Q4 mesh. Element areas: 1: 0.191342 2: 0.191342 3: 0.191342 4: 0.191342 5: 0.191342 6: 0.191342 7: 0.191342 8: 0.191342 9: 0.574025 10: 0.574025 11: 0.574025 12: 0.574025 13: 0.574025 14: 0.574025 15: 0.574025 16: 0.574025 17: 0.956709 18: 0.956709 19: 0.956709 20: 0.956709 21: 0.956709 22: 0.956709 23: 0.956709 24: 0.956709 25: 1.33939 26: 1.33939 27: 1.33939 28: 1.33939 29: 1.33939 30: 1.33939 31: 1.33939 32: 1.33939 Mesh = 24.491740 QUAD_MESH_TEST03 AREA_QUAD computes the area of a quadrilateral. Area = 4.500000 QUAD_MESH_TEST04 BOUNDARY_EDGE_COUNT_Q4_MESH counts the boundary edges by looking at the mesh and counting unpaired edges. Number of boundary edges = 22 Correct number = 22 QUAD_MESH_TEST05 BOUNDARY_EDGE_COUNT_EULER_Q4_MESH counts the boundary edges using Euler's formula. Number of boundary edges = 22 Correct number = 22 QUAD_MESH_TEST08 NEIGHBOR_ELEMENTS_Q4_MESH determines the adjacency relationships between elements. Element neighbors as reported by EXAMPLE1_Q4_MESH: Row: 1 2 3 4 Col 1: -1 2 5 -1 2: -1 3 6 1 3: -1 4 7 2 4: -1 -1 8 3 5: 1 6 10 -1 6: 2 7 -2 5 7: 3 8 11 6 8: 4 9 12 7 9: -1 -1 13 8 10: 5 -2 14 -1 11: 7 12 16 -2 12: 8 13 17 11 13: 9 -1 -1 12 14: 10 15 -1 -1 15: -2 16 -1 14 16: 11 17 -1 15 17: 12 -1 -1 16 Element neighbors computed by NEIGHBOR_ELEMENTS_Q4_MESH: Row: 1 2 3 4 Col 1: -1 2 5 -1 2: -1 3 6 1 3: -1 4 7 2 4: -1 -1 8 3 5: 1 6 10 -1 6: 2 7 -1 5 7: 3 8 11 6 8: 4 9 12 7 9: -1 -1 13 8 10: 5 -1 14 -1 11: 7 12 16 -1 12: 8 13 17 11 13: 9 -1 -1 12 14: 10 15 -1 -1 15: -1 16 -1 14 16: 11 17 -1 15 17: 12 -1 -1 16 QUAD_MESH_TEST09 Write Q4 Mesh Example #2 to files. Element neighbors written to "q4_mesh_ex2_element_neighbors.txt". Elements written to "q4_mesh_ex2_elements.txt". Node coordinates written to "q4_mesh_ex2_xy.txt". QUAD_MESH_TEST10 NODE_ORDER_4_MESH computes the order of the nodes in a Q4 mesh. NODE ORDER 1: 1 2: 2 3: 2 4: 2 5: 1 6: 2 7: 4 8: 4 9: 4 10: 3 11: 1 12: 2 13: 3 14: 3 15: 4 16: 4 17: 2 18: 2 19: 3 20: 3 21: 4 22: 3 23: 1 24: 1 25: 2 26: 2 27: 2 28: 1 QUAD_MESH_TEST105 SAMPLE_Q4_MESH returns uniform sample points from a Q4 mesh. X Y Element 1 0.643648 3.674517 14 2 2.527729 2.288605 11 3 3.602995 3.614670 17 4 3.894584 3.126929 17 5 3.109940 1.145994 8 6 3.921482 2.860658 12 7 3.137949 2.661880 12 8 3.840265 2.026748 12 9 0.311660 1.256639 5 10 3.974793 2.033578 12 11 3.874938 1.695751 8 12 3.667522 0.431428 4 13 4.474619 2.642897 13 14 3.344960 2.171916 12 15 3.765028 3.171222 17 16 4.711307 2.497258 13 17 2.260260 3.897454 16 18 2.916906 0.233153 3 19 0.963983 3.337378 14 20 3.784885 0.371477 4 QUAD_MESH_TEST11 SAMPLE_QUAD computes N random points in a quadrilateral. Write them to a file. Point coordinates written to "sample_quad.txt". EXAMPLE1_Q4_MESH_TEST EXAMPLE1_Q4_MESH sets up example #1 Q4 mesh. Number of nodes = 28 Number of elements = 17 Number of holes = 1 Node coordinates: Row: 1 2 Col 1: 0 0 2: 1 0 3: 2 0 4: 3 0 5: 4 0 6: 0 1 7: 1 1 8: 2 1 9: 3 1 10: 4 1 11: 5 1 12: 0 2 13: 1 2 14: 2 2 15: 3 2 16: 4 2 17: 5 2 18: 0 3 19: 1 3 20: 2 3 21: 3 3 22: 4 3 23: 5 3 24: 0 4 25: 1 4 26: 2 4 27: 3 4 28: 4 4 Elements: Row: 1 2 3 4 Col 1: 1 2 7 6 2: 2 3 8 7 3: 3 4 9 8 4: 4 5 10 9 5: 6 7 13 12 6: 7 8 14 13 7: 8 9 15 14 8: 9 10 16 15 9: 10 11 17 16 10: 12 13 19 18 11: 14 15 21 20 12: 15 16 22 21 13: 16 17 23 22 14: 18 19 25 24 15: 19 20 26 25 16: 20 21 27 26 17: 21 22 28 27 Element neighbors Row: 1 2 3 4 Col 1: -1 2 5 -1 2: -1 3 6 1 3: -1 4 7 2 4: -1 -1 8 3 5: 1 6 10 -1 6: 2 7 -2 5 7: 3 8 11 6 8: 4 9 12 7 9: -1 -1 13 8 10: 5 -2 14 -1 11: 7 12 16 -2 12: 8 13 17 11 13: 9 -1 -1 12 14: 10 15 -1 -1 15: -2 16 -1 14 16: 11 17 -1 15 17: 12 -1 -1 16 EXAMPLE1_Q4_MESH_PLOT EXAMPLE1_Q4_MESH sets up example #1 Q4 mesh. PLOT_Q4_MESH plots it. Number of nodes = 28 Number of elements = 17 Number of holes = 1 EXAMPLE2_Q4_MESH_TEST EXAMPLE1_Q4_MESH sets up example #2 Q4 mesh. Number of nodes = 37 Number of elements = 32 Number of holes = 0 Node coordinates: Row: 1 2 Col 1: 0 0 2: -1 1.22465e-16 3: -0.92388 0.382683 4: -0.707107 0.707107 5: -0.382683 0.92388 6: 6.12323e-17 1 7: 0.382683 0.92388 8: 0.707107 0.707107 9: 0.92388 0.382683 10: 1 0 11: -2 2.44929e-16 12: -1.84776 0.765367 13: -1.41421 1.41421 14: -0.765367 1.84776 15: 1.22465e-16 2 16: 0.765367 1.84776 17: 1.41421 1.41421 18: 1.84776 0.765367 19: 2 0 20: -3 3.67394e-16 21: -2.77164 1.14805 22: -2.12132 2.12132 23: -1.14805 2.77164 24: 1.83697e-16 3 25: 1.14805 2.77164 26: 2.12132 2.12132 27: 2.77164 1.14805 28: 3 0 29: -4 4.89859e-16 30: -3.69552 1.53073 31: -2.82843 2.82843 32: -1.53073 3.69552 33: 2.44929e-16 4 34: 1.53073 3.69552 35: 2.82843 2.82843 36: 3.69552 1.53073 37: 4 0 Elements: Row: 1 2 3 4 Col 1: 1 1 3 2 2: 1 1 4 3 3: 1 1 5 4 4: 1 1 6 5 5: 1 1 7 6 6: 1 1 8 7 7: 1 1 9 8 8: 1 1 10 9 9: 2 3 12 11 10: 3 4 13 12 11: 4 5 14 13 12: 5 6 15 14 13: 6 7 16 15 14: 7 8 17 16 15: 8 9 18 17 16: 9 10 19 18 17: 11 12 21 20 18: 12 13 22 21 19: 13 14 23 22 20: 14 15 24 23 21: 15 16 25 24 22: 16 17 26 25 23: 17 18 27 26 24: 18 19 28 27 25: 20 21 30 29 26: 21 22 31 30 27: 22 23 32 31 28: 23 24 33 32 29: 24 25 34 33 30: 25 26 35 34 31: 26 27 36 35 32: 27 28 37 36 Element neighbors Row: 1 2 3 4 Col 1: -1 2 9 -1 2: -1 3 10 1 3: -1 4 11 2 4: -1 5 12 3 5: -1 6 13 4 6: -1 7 14 5 7: -1 8 15 6 8: -1 -1 16 7 9: 1 10 17 -1 10: 2 11 18 9 11: 3 12 19 10 12: 4 13 20 11 13: 5 14 21 12 14: 6 15 22 13 15: 7 16 23 14 16: 8 -1 24 15 17: 9 18 25 -1 18: 10 19 26 17 19: 11 20 27 18 20: 12 21 28 19 21: 13 22 29 20 22: 14 23 30 21 23: 15 24 31 22 24: 16 -1 32 23 25: 17 26 -1 -1 26: 18 27 -1 25 27: 19 28 -1 26 28: 20 29 -1 27 29: 21 30 -1 28 30: 22 31 -1 29 31: 23 32 -1 30 32: 24 -1 -1 31 EXAMPLE2_Q4_MESH_PLOT EXAMPLE2_Q4_MESH sets up example #2 Q4 mesh. PLOT_Q4_MESH plots it. Number of nodes = 37 Number of elements = 32 Number of holes = 0 EXAMPLE3_Q4_MESH_TEST EXAMPLE3_Q4_MESH sets up example #3 Q4 mesh. Number of nodes = 45 Number of elements = 32 Number of holes = 0 Node coordinates: Row: 1 2 Col 1: 0 0 2: 1 0 3: 2 0 4: 3 0 5: 4 0 6: 5 0 7: 6 0 8: 7 0 9: 8 0 10: 0 1 11: 1 1 12: 2 1 13: 3 1 14: 4 1 15: 5 1 16: 6 1 17: 7 1 18: 8 1 19: 0 2 20: 1 2 21: 2 2 22: 3 2 23: 4 2 24: 5 2 25: 6 2 26: 7 2 27: 8 2 28: 0 3 29: 1 3 30: 2 3 31: 3 3 32: 4 3 33: 5 3 34: 6 3 35: 7 3 36: 8 3 37: 0 4 38: 1 4 39: 2 4 40: 3 4 41: 4 4 42: 5 4 43: 6 4 44: 7 4 45: 8 4 Elements: Row: 1 2 3 4 Col 1: 1 2 11 10 2: 2 3 12 11 3: 3 4 13 12 4: 4 5 14 13 5: 5 6 15 14 6: 6 7 16 15 7: 7 8 17 16 8: 8 9 18 17 9: 10 11 20 19 10: 11 12 21 20 11: 12 13 22 21 12: 13 14 23 22 13: 14 15 24 23 14: 15 16 25 24 15: 16 17 26 25 16: 17 18 27 26 17: 19 20 29 28 18: 20 21 30 29 19: 21 22 31 30 20: 22 23 32 31 21: 23 24 33 32 22: 24 25 34 33 23: 25 26 35 34 24: 26 27 36 35 25: 28 29 38 37 26: 29 30 39 38 27: 30 31 40 39 28: 31 32 41 40 29: 32 33 42 41 30: 33 34 43 42 31: 34 35 44 43 32: 35 36 45 44 Element neighbors Row: 1 2 3 4 Col 1: -1 2 9 -1 2: -1 3 10 1 3: -1 4 11 2 4: -1 5 12 3 5: -1 6 13 4 6: -1 7 14 5 7: -1 8 15 6 8: -1 -1 16 7 9: 1 10 17 -1 10: 2 11 18 9 11: 3 12 19 10 12: 4 13 20 11 13: 5 14 21 12 14: 6 15 22 13 15: 7 16 23 14 16: 8 -1 24 15 17: 9 18 25 -1 18: 10 19 26 17 19: 11 20 27 18 20: 12 21 28 19 21: 13 22 29 20 22: 14 23 30 21 23: 15 24 31 22 24: 16 -1 32 23 25: 17 26 -1 -1 26: 18 27 -1 25 27: 19 28 -1 26 28: 20 29 -1 27 29: 21 30 -1 28 30: 22 31 -1 29 31: 23 32 -1 30 32: 24 -1 -1 31 EXAMPLE3_Q4_MESH_PLOT EXAMPLE3_Q4_MESH sets up example #3 Q4 mesh. PLOT_Q4_MESH plots it. Number of nodes = 45 Number of elements = 32 Number of holes = 0 EXAMPLE4_Q4_MESH_TEST EXAMPLE4_Q4_MESH sets up example #4 Q4 mesh. Number of nodes = 45 Number of elements = 32 Number of holes = 0 Node coordinates: Row: 1 2 Col 1: 0 0 2: 1 0 3: 2 0 4: 3 0 5: 4 0 6: 5 0 7: 5.34 0 8: 6.34 0 9: 7.34 0 10: 0 1 11: 1 1 12: 2 1 13: 3 1 14: 4 1 15: 5 1 16: 5.34 1 17: 6.34 1 18: 7.34 1 19: 0 1.34 20: 1 1.34 21: 2 1.34 22: 3 1.34 23: 4 1.34 24: 5 1.34 25: 5.34 1.34 26: 6.34 1.34 27: 7.34 1.34 28: 0 2.34 29: 1 2.34 30: 2 2.34 31: 3 2.34 32: 4 2.34 33: 5 2.34 34: 5.34 2.34 35: 6.34 2.34 36: 7.34 2.34 37: 0 3.34 38: 1 3.34 39: 2 3.34 40: 3 3.34 41: 4 3.34 42: 5 3.34 43: 5.34 3.34 44: 6.34 3.34 45: 7.34 3.34 Elements: Row: 1 2 3 4 Col 1: 1 2 11 10 2: 2 3 12 11 3: 3 4 13 12 4: 4 5 14 13 5: 5 6 15 14 6: 6 7 16 15 7: 7 8 17 16 8: 8 9 18 17 9: 10 11 20 19 10: 11 12 21 20 11: 12 13 22 21 12: 13 14 23 22 13: 14 15 24 23 14: 15 16 25 24 15: 16 17 26 25 16: 17 18 27 26 17: 19 20 29 28 18: 20 21 30 29 19: 21 22 31 30 20: 22 23 32 31 21: 23 24 33 32 22: 24 25 34 33 23: 25 26 35 34 24: 26 27 36 35 25: 28 29 38 37 26: 29 30 39 38 27: 30 31 40 39 28: 31 32 41 40 29: 32 33 42 41 30: 33 34 43 42 31: 34 35 44 43 32: 35 36 45 44 Element neighbors Row: 1 2 3 4 Col 1: -1 2 9 -1 2: -1 3 10 1 3: -1 4 11 2 4: -1 5 12 3 5: -1 6 13 4 6: -1 7 14 5 7: -1 8 15 6 8: -1 -1 16 7 9: 1 10 17 -1 10: 2 11 18 9 11: 3 12 19 10 12: 4 13 20 11 13: 5 14 21 12 14: 6 15 22 13 15: 7 16 23 14 16: 8 -1 24 15 17: 9 18 25 -1 18: 10 19 26 17 19: 11 20 27 18 20: 12 21 28 19 21: 13 22 29 20 22: 14 23 30 21 23: 15 24 31 22 24: 16 -1 32 23 25: 17 26 -1 -1 26: 18 27 -1 25 27: 19 28 -1 26 28: 20 29 -1 27 29: 21 30 -1 28 30: 22 31 -1 29 31: 23 32 -1 30 32: 24 -1 -1 31 EXAMPLE4_Q4_MESH_PLOT EXAMPLE4_Q4_MESH sets up example #4 Q4 mesh. PLOT_Q4_MESH plots it. Number of nodes = 45 Number of elements = 32 Number of holes = 0 quad_mesh_test(): Normal end of execution. 08-Jan-2022 07:58:39