08-Jan-2022 10:30:21 tet_mesh_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test tet_mesh(). TET_MESH_TEST001 R8MAT_SOLVE solves linear systems. The linear system: Col: 1 2 3 4 5 Row 1 : 1 2 3 14 7 2 : 4 5 6 32 16 3 : 7 8 0 23 7 The computed solutions Col: 1 2 Row 1 : 1 1 2 : 2 0 3 : 3 2 TET_MESH_TEST002 For an order 4 tetrahedron, TETRAHEDRON_ORDER4_PHYSICAL_TO_REFERENCE maps a physical point to a reference point. TETRAHEDRON_ORDER4_REFERENCE_TO_PHYSICAL maps a reference point to a physical point. ( R, S, T ) ==> ( X, Y, Z ) ==> ( R2, S2, T2 ) 0.005725 0.776018 0.112878 5.130053 1.664914 0.225756 0.005725 0.776018 0.112878 0.019381 0.696294 0.075257 5.133400 1.467846 0.150515 0.019381 0.696294 0.075257 0.162880 0.020521 0.462412 5.951051 0.503455 0.924824 0.162880 0.020521 0.462412 0.578331 0.011537 0.380767 7.115759 0.403840 0.761533 0.578331 0.011537 0.380767 0.239217 0.137127 0.549470 6.267122 0.823723 1.098939 0.239217 0.137127 0.549470 0.167439 0.028542 0.310182 5.812499 0.367267 0.620365 0.167439 0.028542 0.310182 0.012416 0.312023 0.594337 5.631585 1.218382 1.188673 0.012416 0.312023 0.594337 0.024150 0.020030 0.283422 5.355872 0.323482 0.566845 0.024150 0.020030 0.283422 0.084585 0.196503 0.568495 5.822250 0.961501 1.136990 0.084585 0.196503 0.568495 0.023857 0.491189 0.101452 5.173023 1.083829 0.202904 0.023857 0.491189 0.101452 TET_MESH_TEST003 For an order 10 tet mesh, TETRAHEDRON_ORDER10_TO_ORDER4 makes a linear (order 4) tet mesh by using the existing nodes, and replacing each quadratic tetrahedron by 8 linear tetrahedrons. First 5 quadratic tetrahedrons: Row: 1 2 3 4 5 6 7 8 9 10 Col 1: 4 3 5 1 16 19 17 11 10 12 2: 4 2 5 1 13 19 14 11 9 12 3: 4 7 3 5 21 16 18 19 24 17 4: 4 7 8 5 21 22 27 19 24 25 5: 4 6 2 5 20 13 15 19 23 14 Quadratic mesh size is 6 Linearized mesh size will be 48 First 5 linear tetrahedrons: Row: 1 2 3 4 Col 1: 4 16 19 17 2: 3 16 11 10 3: 5 19 11 10 4: 1 17 10 12 5: 16 19 17 10 TET_MESH_TEST004 TET_MESH_NODE_ORDER determines the order of each node in a tet mesh. The order of a node is the number of tetrahedrons that use the node as part of their definition. This mesh has tetrahedron order 10 The number of tetrahedrons is 6 The tet mesh Row: 1 2 3 4 5 6 7 8 9 10 Col 1: 4 3 5 1 16 19 17 11 10 12 2: 4 2 5 1 13 19 14 11 9 12 3: 4 7 3 5 21 16 18 19 24 17 4: 4 7 8 5 21 22 27 19 24 25 5: 4 6 2 5 20 13 15 19 23 14 6: 4 6 8 5 20 22 26 19 23 25 Node orders: 1: 2 2: 2 3: 2 4: 6 5: 6 6: 2 7: 2 8: 2 9: 1 10: 1 11: 2 12: 2 13: 2 14: 2 15: 1 16: 2 17: 2 18: 1 19: 6 20: 2 21: 2 22: 2 23: 2 24: 2 25: 2 26: 1 27: 1 Check that the following are equal: Number of tetrahedrons * order = 60 Sum of node orders = 60 TEST005 TETRAHEDRON_BARYCENTRIC computes the barycentric coordinates of a point. Random tetrahedron: Row: 1 2 3 Col 1: 0.706046 0.0318328 0.276923 2: 0.0461714 0.0971318 0.823458 3: 0.694829 0.317099 0.950222 4: 0.0344461 0.438744 0.381558 C1 = 0.342153 0.355420 0.083524 0.218903 C2 = 0.342153 0.355420 0.083524 0.218903 C1 = 0.174333 0.252866 0.277535 0.295267 C2 = 0.174333 0.252866 0.277535 0.295267 C1 = 0.155644 0.383268 0.369394 0.091693 C2 = 0.155644 0.383268 0.369394 0.091693 C1 = 0.062059 0.259904 0.500521 0.177516 C2 = 0.062059 0.259904 0.500521 0.177516 C1 = 0.322383 0.123282 0.413820 0.140514 C2 = 0.322383 0.123282 0.413820 0.140514 Random tetrahedron: Row: 1 2 3 Col 1: 0.505957 0.699077 0.890903 2: 0.959291 0.547216 0.138624 3: 0.149294 0.257508 0.840717 4: 0.254282 0.814285 0.243525 C1 = 0.538103 0.202663 0.113841 0.145393 C2 = 0.538103 0.202663 0.113841 0.145393 C1 = 0.271168 0.208330 0.154792 0.365710 C2 = 0.271168 0.208330 0.154792 0.365710 C1 = 0.250325 0.235124 0.392295 0.122257 C2 = 0.250325 0.235124 0.392295 0.122257 C1 = 0.307906 0.306494 0.154703 0.230897 C2 = 0.307906 0.306494 0.154703 0.230897 C1 = 0.052685 0.037471 0.368669 0.541175 C2 = 0.052685 0.037471 0.368669 0.541175 Random tetrahedron: Row: 1 2 3 Col 1: 0.934011 0.129906 0.568824 2: 0.469391 0.0119021 0.337123 3: 0.162182 0.794285 0.311215 4: 0.528533 0.165649 0.601982 C1 = 0.111693 0.277809 0.292733 0.317765 C2 = 0.111693 0.277809 0.292733 0.317765 C1 = 0.268711 0.049993 0.136566 0.544731 C2 = 0.268711 0.049993 0.136566 0.544731 C1 = 0.060644 0.328661 0.214251 0.396444 C2 = 0.060644 0.328661 0.214251 0.396444 C1 = 0.049185 0.278518 0.067102 0.605194 C2 = 0.049185 0.278518 0.067102 0.605194 C1 = 0.001880 0.314296 0.331490 0.352334 C2 = 0.001880 0.314296 0.331490 0.352334 TET_MESH_TEST006 TET_MESH_TET_NEIGHBORS computes the 4 neighboring tetrahedrons of each tetrahedron in a tet mesh. containing a point. This mesh has tetrahedron order 4 The number of tetrahedrons is 144 First 10 Tets: Row: 1 2 3 4 Col 1: 1 2 4 10 2: 2 4 5 10 3: 2 5 10 11 4: 2 3 5 11 5: 4 5 10 13 6: 3 5 6 11 7: 5 10 11 13 8: 4 5 7 13 9: 5 6 8 14 10: 5 7 8 13 First 10 Tet Neighbors: Row: 1 2 3 4 Col 1: 2 -1 -1 -1 2: 5 3 1 -1 3: 7 -1 4 2 4: 6 3 -1 -1 5: 7 -1 8 2 6: 15 14 4 -1 7: 21 24 5 3 8: 10 -1 5 -1 9: 11 20 15 -1 10: 19 20 8 -1 tet_mesh_test007 TET_MESH_SEARCH_NAIVE uses a naive algorithm to search a tetrahedral mesh for the tetrahedron containing a point. TET_MESH_SEARCH_DELAUNAY uses a faster algorithm which is appropriate if the tet mesh is Delaunay. This mesh has tetrahedron order 4 The number of tetrahedrons is 144 Point was chosen from tetrahedron 13 Naive search ended in tetrahedron 13 after 13 steps Delaunay search ended in tetrahedron 13 after 6 steps. Point was chosen from tetrahedron 63 Naive search ended in tetrahedron 63 after 63 steps Delaunay search ended in tetrahedron 63 after 7 steps. Point was chosen from tetrahedron 21 Naive search ended in tetrahedron 21 after 21 steps Delaunay search ended in tetrahedron 21 after 9 steps. Point was chosen from tetrahedron 80 Naive search ended in tetrahedron 80 after 80 steps Delaunay search ended in tetrahedron 80 after 15 steps. Point was chosen from tetrahedron 51 Naive search ended in tetrahedron 51 after 51 steps Delaunay search ended in tetrahedron 51 after 8 steps. tet_mesh_test(): Normal end of execution. 08-Jan-2022 10:30:21