Skip to content
Snippets Groups Projects
Select Git revision
  • a3711e5e8f73221b8d04be8506cc8c91946cd0b1
  • 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

meshGRegionDelaunayInsertion.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    meshGRegionDelaunayInsertion.cpp 58.58 KiB
    // Gmsh - Copyright (C) 1997-2014 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@geuz.org>.
    
    #include <set>
    #include <map>
    #include <algorithm>
    #include "GmshMessage.h"
    #include "robustPredicates.h"
    #include "OS.h"
    #include "BackgroundMesh.h"
    #include "meshGRegion.h"
    #include "meshGRegionLocalMeshMod.h"
    #include "meshGRegionDelaunayInsertion.h"
    #include "GModel.h"
    #include "GRegion.h"
    #include "MTriangle.h"
    #include "Numeric.h"
    #include "Context.h"
    #include "HilbertCurve.h"
    
    int MTet4::radiusNorm = 2;
    static double LIMIT_ = 1;
    
    static void createAllEmbeddedFaces (GRegion *gr, std::set<MFace, Less_Face> &allEmbeddedFaces)
    {
      std::list<GFace*> f = gr->embeddedFaces();
      for (std::list<GFace*>::iterator it = f.begin() ; it != f.end(); ++it){
        for (unsigned int i = 0; i < (*it)->triangles.size(); i++){
          allEmbeddedFaces.insert ((*it)->triangles[i]->getFace(0));
        }
      }
    }
    
    static bool isActive(MTet4 *t, double limit_, int &active)
    {
      if (t->isDeleted()) return false;
      for (active = 0; active < 4; active++){
        MTet4 *neigh = t->getNeigh(active);
        if (!neigh || (neigh->getRadius() < limit_ && neigh->getRadius() > 0)) {
          return true;
        }
      }
      return false;
    }
    
    int MTet4::inCircumSphere(const double *p) const
    {
      double pa[3] = {base->getVertex(0)->x(),
                      base->getVertex(0)->y(),
                      base->getVertex(0)->z()};
      double pb[3] = {base->getVertex(1)->x(),
                      base->getVertex(1)->y(),
                      base->getVertex(1)->z()};
      double pc[3] = {base->getVertex(2)->x(),
                      base->getVertex(2)->y(),
                      base->getVertex(2)->z()};
      double pd[3] = {base->getVertex(3)->x(),
                      base->getVertex(3)->y(),
                      base->getVertex(3)->z()};
      double result = robustPredicates::insphere(pa, pb, pc, pd, (double*)p) *
        robustPredicates::orient3d(pa, pb, pc, pd);
      return (result > 0) ? 1 : 0;
    }
    
    static int faces[4][3] = {{0,1,2}, {0,2,3}, {0,3,1}, {1,3,2}};
    
    struct faceXtet{
      MVertex *v[3],*unsorted[3];