05 October 2014 01:05:13 PM

TET_MESH_PRB
  C++ version
  Test the TET_MESH library.

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:

         1           1  
         2           0  
         3           2  

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.01103    0.1004    0.4885       5.522    0.6893     0.977     0.01103    0.1004    0.4885
    0.0194    0.4966   0.03516       5.093     1.028   0.07031      0.0194    0.4966   0.03516
   0.01864    0.2017  0.009247       5.065    0.4127   0.01849     0.01864    0.2017  0.009247
    0.2902    0.1175   0.09595       5.967    0.3309    0.1919      0.2902    0.1175   0.09595
    0.0772    0.1299    0.5109       5.742    0.7707     1.022      0.0772    0.1299    0.5109
  0.002262   0.07535   0.04071       5.047    0.1914   0.08141    0.002262   0.07535   0.04071
    0.3457   0.00749   0.04567       6.083   0.06065   0.09134      0.3457   0.00749   0.04567
  0.004603    0.3287  0.002488       5.016    0.6598  0.004976    0.004603    0.3287  0.002488
  0.003248    0.5406   0.06933       5.079     1.151    0.1387    0.003248    0.5406   0.06933
   0.01751    0.4692     0.171       5.224      1.11    0.3421     0.01751    0.4692     0.171

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       3       2       4       0      15      18      16      10       9      11  
    2       3       1       4       0      12      18      13      10       8      11  
    3       3       6       2       4      20      15      17      18      23      16  
    4       3       6       7       4      20      21      26      18      23      24  
    5       3       5       1       4      19      12      14      18      22      13  

  Quadratic mesh size is       6
  Linearized mesh size will be 48

  First 5 linear tetrahedrons:

  Row:      1       2       3       4  
  Col

    1       3      15      18      16  
    2       2      15      10       9  
    3       4      18      10       9  
    4       0      16       9      11  
    5      15      18      16       9  

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       3       2       4       0      15      18      16      10       9      11  
    2       3       1       4       0      12      18      13      10       8      11  
    3       3       6       2       4      20      15      17      18      23      16  
    4       3       6       7       4      20      21      26      18      23      24  
    5       3       5       1       4      19      12      14      18      22      13  
    6       3       5       7       4      19      21      25      18      22      24  

  Node orders:

         0         2
         1         2
         2         2
         3         6
         4         6
         5         2
         6         2
         7         2
         8         1
         9         1
        10         2
        11         2
        12         2
        13         2
        14         1
        15         2
        16         2
        17         1
        18         6
        19         2
        20         2
        21         2
        22         2
        23         2
        24         2
        25         1
        26         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.218418      0.956318      0.829509
    2       0.561695      0.415307     0.0661187
    3       0.257578      0.109957      0.043829
    4       0.633966     0.0617272      0.449539

  C1 =         0.205261        0.386001        0.407797     0.000940293
  C2 =         0.205261        0.386001        0.407797     0.000940293

  C1 =         0.661672        0.258587       0.0697018       0.0100389
  C2 =         0.661672        0.258587       0.0697018       0.0100389

  C1 =         0.469308        0.459339       0.0672493      0.00410386
  C2 =         0.469308        0.459339       0.0672493      0.00410386

  C1 =         0.158907        0.557045       0.0693886        0.214659
  C2 =         0.158907        0.557045       0.0693886        0.214659

  C1 =         0.351099        0.113977        0.295282        0.239643
  C2 =         0.351099        0.113977        0.295282        0.239643

  Random tetrahedron:

  Row:       1             2             3       
  Col

    1       0.861216      0.453794      0.911977
    2       0.597917      0.188955      0.761492
    3       0.396988      0.185314      0.574366
    4       0.367027      0.617205      0.361529

  C1 =         0.158379        0.531428        0.087551        0.222643
  C2 =         0.158379        0.531428        0.087551        0.222643

  C1 =         0.340586        0.340444       0.0255384        0.293431
  C2 =         0.340586        0.340444       0.0255384        0.293431

  C1 =        0.0459748        0.405151        0.388127        0.160747
  C2 =        0.0459748        0.405151        0.388127        0.160747

  C1 =         0.317619        0.269648         0.26901        0.143724
  C2 =         0.317619        0.269648         0.26901        0.143724

  C1 =         0.464782        0.278294      0.00882284          0.2481
  C2 =         0.464782        0.278294      0.00882284          0.2481

  Random tetrahedron:

  Row:       1             2             3       
  Col

    1      0.0419093      0.368851      0.271724
    2       0.858573     0.0290366     0.0174423
    3       0.152384      0.114319      0.353907
    4       0.119308      0.206653      0.212924

  C1 =         0.275476        0.363821        0.263855       0.0968481
  C2 =         0.275476        0.363821        0.263855       0.0968481

  C1 =         0.274841        0.258824        0.160319        0.306016
  C2 =         0.274841        0.258824        0.160319        0.306016

  C1 =         0.393103        0.378144        0.216193       0.0125602
  C2 =         0.393103        0.378144        0.216193       0.0125602

  C1 =         0.205245        0.124714        0.385108        0.284932
  C2 =         0.205245        0.124714        0.385108        0.284932

  C1 =         0.174184       0.0663094        0.352054        0.407452
  C2 =         0.174184       0.0663094        0.352054        0.407452

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       0       1       3       9  
    2       1       3       4       9  
    3       1       4       9      10  
    4       1       2       4      10  
    5       3       4       9      12  
    6       2       4       5      10  
    7       4       9      10      12  
    8       3       4       6      12  
    9       4       5       7      13  
   10       4       6       7      12  

  First 10 Tet Neighbors:

  Row:      1       2       3       4  
  Col

    1       1      -1      -1      -1  
    2       4       2       0      -1  
    3       6      -1       3       1  
    4       5       2      -1      -1  
    5       6      -1       7       1  
    6      14      13       3      -1  
    7      20      23       4       2  
    8       9      -1       4      -1  
    9      10      19      14      -1  
   10      18      19       7      -1  

TEST007
  TET_MESH_SEARCH_NAIVE uses a naive algorithm
  to search a tetrahedral mesh for the tetrahedron
  containing a point.

  This mesh has tetrahedron order 4
  The number of tetrahedrons is   144

  Point was chosen from tetrahedron          31
  Naive search ended in tetrahedron          31, number of steps = 31
  Delaunay search ended in tetrahedron       31, number of steps = 5

  Point was chosen from tetrahedron          59
  Naive search ended in tetrahedron          59, number of steps = 59
  Delaunay search ended in tetrahedron       59, number of steps = 4

  Point was chosen from tetrahedron           6
  Naive search ended in tetrahedron           6, number of steps = 6
  Delaunay search ended in tetrahedron        6, number of steps = 10

  Point was chosen from tetrahedron          57
  Naive search ended in tetrahedron          57, number of steps = 57
  Delaunay search ended in tetrahedron       57, number of steps = 7

  Point was chosen from tetrahedron         129
  Naive search ended in tetrahedron         129, number of steps = 129
  Delaunay search ended in tetrahedron      129, number of steps = 12

TET_MESH_PRB
  Normal end of execution.

05 October 2014 01:05:13 PM