Skip to content
Snippets Groups Projects
Select Git revision
  • 19ac52b8f1ecfd42a1689425fdd7d00cd33dc750
  • master default protected
  • alphashapes
  • quadMeshingTools
  • cygwin_conv_path
  • macos_arm64
  • add-transfiniteautomatic-to-geo
  • patch_releases_4_10
  • HierarchicalHDiv
  • isuruf-master-patch-63355
  • hyperbolic
  • hexdom
  • hxt_update
  • jf
  • 1618-pythonocc-and-gmsh-api-integration
  • octreeSizeField
  • hexbl
  • alignIrregularVertices
  • getEdges
  • patch_releases_4_8
  • isuruf-master-patch-51992
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
  • gmsh_4_8_4
  • gmsh_4_8_3
  • gmsh_4_8_2
  • gmsh_4_8_1
  • gmsh_4_8_0
  • gmsh_4_7_1
  • gmsh_4_7_0
41 results

delaunay3d.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    delaunay3d.cpp 38.88 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>.
    
    #ifdef _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"
    
    const int MEASURE_BARR = 0;
    
    #ifdef _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(Vertex** vertices,
    	    int arraysize,int GrayCode0,int GrayCode1,
    	    double BoundingBoxXmin, double BoundingBoxXmax,
    	    double BoundingBoxYmin, double BoundingBoxYmax,
    	    double BoundingBoxZmin, double BoundingBoxZmax);
      void Sort(Vertex** 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(Vertex** vertices, int arraysize,
    			     int threshold, double ratio, int *depth, std::vector<int> &indices)
      {
        int middle;
    
        middle = 0;
        if (arraysize >= threshold) {
          (*depth)++;
          middle = (int)(arraysize * ratio);
          MultiscaleSortHilbert(vertices, middle, threshold, ratio, depth, indices);
        }