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

OptHOM.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    DivideAndConquer.cpp 29.31 KiB
    // Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
    
    // Triangulation using a divide and conquer algorithm
    //
    // The main idea is to be able to merge two Delaunay triangulations
    // into a single one (see the 'Merge' function). Points are then
    // separated into two groups, then each group into two, ... until
    // having 1, 2 or 3 points (the triangulation is then trivial).
    //
    // This is used to contruct the initial mesh.
    //
    // Warning: point positions must be PERTURBED by a small random
    // value to avoid 3 aligned points or 4 cocyclical points!
    
    #include "GmshMessage.h"
    #include "DivideAndConquer.h"
    #include "Numeric.h"
    #include "robustPredicates.h"
    #include "BackgroundMeshTools.h"
    #include "OS.h"
    #include "GPoint.h"
    #include "GFace.h"
    #include "MLine.h"
    
    #define Pred(x) ((x)->prev)
    #define Succ(x) ((x)->next)
    
    PointNumero DocRecord::Predecessor(PointNumero a, PointNumero b)
    {
      DListPeek p = points[a].adjacent;
      if(p == NULL) return -1;
    
      do {
        if(p->point_num == b) return Pred(p)->point_num;
        p = Pred(p);
      } while(p != points[a].adjacent);
    
      return -1;
    }
    
    PointNumero DocRecord::Successor(PointNumero a, PointNumero b)
    {
      DListPeek p = points[a].adjacent;
      if(p == NULL) return -1;
    
      do {
        if(p->point_num == b) return Succ(p)->point_num;
        p = Succ(p);
      } while(p != points[a].adjacent);
    
      return -1;
    }
    
    int DocRecord::FixFirst(PointNumero x, PointNumero f)
    {
      DListPeek p = points[x].adjacent;
      if(p == NULL) return 0;
    
      int out = 0;
      DListPeek copy = p;
      do {
        if(p->point_num == f) {
          points[x].adjacent = p;
          out = 1;
        }
        else
          p = p->next;