1 /* ----------------------------------------------------------------------
2    SPARTA - Stochastic PArallel Rarefied-gas Time-accurate Analyzer
3    http://sparta.sandia.gov
4    Steve Plimpton, sjplimp@sandia.gov, Michael Gallis, magalli@sandia.gov
5    Sandia National Laboratories
6 
7    Copyright (2014) Sandia Corporation.  Under the terms of Contract
8    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
9    certain rights in this software.  This software is distributed under
10    the GNU General Public License.
11 
12    See the README file in the top-level SPARTA directory.
13 ------------------------------------------------------------------------- */
14 
15 #ifndef SPARTA_MARCHING_CUBES_H
16 #define SPARTA_MARCHING_CUBES_H
17 
18 #include "pointers.h"
19 #include "surf.h"
20 
21 namespace SPARTA_NS {
22 
23 class MarchingCubes : protected Pointers {
24  public:
25   MarchingCubes(class SPARTA *, int, double);
~MarchingCubes()26   ~MarchingCubes() {}
27   void invoke(double **, int *, int **);
28   void cleanup();
29 
30  private:
31   int me,ggroup;
32   double thresh;
33 
34   double *lo,*hi;
35   int v000,v001,v010,v011,v100,v101,v110,v111;
36   double v000iso,v001iso,v010iso,v011iso,v100iso,v101iso,v110iso,v111iso;
37   int bit0,bit1,bit2,bit3,bit4,bit5,bit6,bit7;
38   double pt[36][3];
39 
40   int config;     // configuration of the active cube
41   int subconfig;  // subconfiguration of the active cube
42 
43   // message datums for cleanup()
44 
45   struct SendDatum {
46     int sendcell,sendface;
47     int othercell,otherface;
48     int inwardnorm;            // for sending cell
49     Surf::Tri tri1,tri2;
50   };
51 
52   double interpolate(double, double, double, double);
53   int add_triangle(int *, int);
54   bool test_face(int);
55   bool test_interior(int, int);
56   bool modified_test_interior(int, int);
57   int interior_ambiguity(int, int);
58   int interior_ambiguity_verification(int);
59   bool interior_test_case13();
60   void print_cube();
61 };
62 
63 }
64 
65 #endif
66 
67 /* ERROR/WARNING messages:
68 
69 */
70