Skip to content
Snippets Groups Projects
Select Git revision
  • 75775fc569f7789caed04ec753ff30a42b6e13ad
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

gmshRegion.h

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    delaunay3d.cpp 39.00 KiB
    // Gmsh - Copyright (C) 1997-2016 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to the public mailing list <gmsh@onelab.info>.
    
    #if defined(_OPENMP)
    #include <omp.h>
    #endif
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <list>
    #include <set>
    #include <stack>
    #include <map>
    #include <vector>
    #include <algorithm>
    #include <math.h>
    #include "SBoundingBox3d.h"
    #include "OS.h"
    #include "delaunay3d_private.h"
    #include "delaunay3d.h"
    #include "MVertex.h"
    #include "MEdge.h"
    #include "MTetrahedron.h"
    #include "meshGRegionLocalMeshMod.h"
    
    #if defined(_HAVE_NUMA)
    #include <numa.h>
    #endif
    
    //int Tet::in_sphere_counter = 0;
    
    struct HilbertSortB
    {
      // The code for generating table transgc from:
      // http://graphics.stanford.edu/~seander/bithacks.html.
      int transgc[8][3][8];
      int tsb1mod3[8];
      int maxDepth;
      int Limit;
      SBoundingBox3d bbox ;
      void ComputeGrayCode(int n);
      int Split(Vert** vertices,
    	    int arraysize,int GrayCode0,int GrayCode1,
    	    double BoundingBoxXmin, double BoundingBoxXmax,
    	    double BoundingBoxYmin, double BoundingBoxYmax,
    	    double BoundingBoxZmin, double BoundingBoxZmax);
      void Sort(Vert** vertices, int arraysize, int e, int d,
                double BoundingBoxXmin, double BoundingBoxXmax,
                double BoundingBoxYmin, double BoundingBoxYmax,
                double BoundingBoxZmin, double BoundingBoxZmax, int depth);
      HilbertSortB (int m = 0, int l=2) : maxDepth(m), Limit(l)
      {
        ComputeGrayCode(3);
      }
      void MultiscaleSortHilbert(Vert** vertices, int arraysize,
    			     int threshold, double ratio, int *depth,
                                 std::vector<int> &indices)
      {
        int middle = 0;
        if (arraysize >= threshold) {
          (*depth)++;
          middle = (int)(arraysize * ratio);
          MultiscaleSortHilbert(vertices, middle, threshold, ratio, depth, indices);
        }
        indices.push_back(middle);
        // printf("chunk starts at %d and size %d\n",middle, arraysize - middle);
        Sort(&(vertices[middle]),arraysize - middle,0,0,
             bbox.min().x(),bbox.max().x(),