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

meshGRegionRelocateVertex.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    meshGFaceOptimize.cpp 46.20 KiB
    // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file in the Gmsh root directory for license information.
    // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
    
    #include <stack>
    #include "GmshConfig.h"
    #include "meshGFaceOptimize.h"
    #include "qualityMeasures.h"
    #include "GFace.h"
    #include "GEdge.h"
    #include "GVertex.h"
    #include "GModel.h"
    #include "MVertex.h"
    #include "MTriangle.h"
    #include "MQuadrangle.h"
    #include "MLine.h"
    #include "BackgroundMeshTools.h"
    #include "Numeric.h"
    #include "GmshMessage.h"
    #include "Context.h"
    #include "OS.h"
    #include "SVector3.h"
    #include "SPoint3.h"
    #include "meshRelocateVertex.h"
    #include "Field.h"
    
    #if defined(HAVE_BLOSSOM)
    extern "C" struct CCdatagroup;
    extern "C" int perfect_match(int ncount, CCdatagroup *dat, int ecount,
                                 int **elist, int **elen, char *blo_filename,
                                 char *mat_filename, int just_fractional,
                                 int no_fractional, int use_all_trees,
                                 int partialprice, double *totalzeit);
    #endif
    
    RecombineTriangle::RecombineTriangle(const MEdge &me, MElement *_t1,
                                         MElement *_t2, Field *cross_field)
      : t1(_t1), t2(_t2)
    {
      n1 = me.getVertex(0);
      n2 = me.getVertex(1);
      n3 = 0;
      n4 = 0;
    
      if(t1->getVertex(0) != n1 && t1->getVertex(0) != n2)
        n3 = t1->getVertex(0);
      else if(t1->getVertex(1) != n1 && t1->getVertex(1) != n2)
        n3 = t1->getVertex(1);
      else if(t1->getVertex(2) != n1 && t1->getVertex(2) != n2)
        n3 = t1->getVertex(2);
    
      if(t2->getVertex(0) != n1 && t2->getVertex(0) != n2)
        n4 = t2->getVertex(0);
      else if(t2->getVertex(1) != n1 && t2->getVertex(1) != n2)
        n4 = t2->getVertex(1);
      else if(t2->getVertex(2) != n1 && t2->getVertex(2) != n2)
        n4 = t2->getVertex(2);
    
      if(!n3) {
        Msg::Warning("Invalid quadrangle in recombination");
        n3 = n1;
      }
      if(!n4) {
        Msg::Warning("Invalid quadrangle in recombination");
        n4 = n2;
      }
    
      MQuadrangle q(n1, n3, n2, n4);
      angle = q.etaShapeMeasure();