star-uvm

Spatial structuring of unstructured volumetric meshes
git clone git://git.meso-star.fr/star-uvm.git
Log | Files | Refs | README | LICENSE

test_suvm_box.h (1888B)


      1 /* Copyright (C) 2020-2023 |Méso|Star> (contact@meso-star.com)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #ifndef TEST_SUVM_BOX_H
     17 #define TEST_SUVM_BOX_H
     18 
     19 static const double box_vertices[9/*#vertices*/*3/*#coords per vertex*/] = {
     20   0.0, 0.0, 0.0,
     21   1.0, 0.0, 0.0,
     22   0.0, 1.0, 0.0,
     23   1.0, 1.0, 0.0,
     24   0.0, 0.0, 1.0,
     25   1.0, 0.0, 1.0,
     26   0.0, 1.0, 1.0,
     27   1.0, 1.0, 1.0,
     28   0.5, 0.5, 0.5
     29 };
     30 static const size_t box_nverts = sizeof(box_vertices) / (sizeof(double)*3);
     31 
     32 /* The following array lists the indices toward the 3D vertices of each
     33  * boundary triangle. The index 8 references the vertex at the center of the
     34  * box.
     35  *        ,2---,3           ,2----3
     36  *      ,' | ,'/|         ,'/| \  |        Y
     37  *    6----7' / |       6' / |  \ |        |
     38  *    |',  | / ,1       | / ,0---,1        o--X
     39  *    |  ',|/,'         |/,' | ,'         /
     40  *    4----5'           4----5'          Z */
     41 static const size_t box_indices[12/*#tetras*/*4/*#indices per tetra*/] = {
     42   0, 1, 2, 8, 1, 3, 2, 8, /* -Z */
     43   0, 2, 4, 8, 2, 6, 4, 8, /* -X */
     44   4, 6, 5, 8, 6, 7, 5, 8, /* +Z */
     45   3, 5, 7, 8, 5, 3, 1, 8, /* +X */
     46   2, 7, 6, 8, 7, 2, 3, 8, /* +Y */
     47   0, 5, 1, 8, 5, 0, 4, 8  /* -Y */
     48 };
     49 static const size_t box_ntetras = sizeof(box_indices) / (sizeof(size_t)*4);
     50 
     51 #endif /* TEST_SUVM_BOX_H */