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

DivideAndConquer.h

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    meshGRegionExtruded.cpp 20.64 KiB
    // Gmsh - Copyright (C) 1997-2019 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.
    
    #include <set>
    #include "GmshConfig.h"
    #include "GmshMessage.h"
    #include "GModel.h"
    #include "MTriangle.h"
    #include "MQuadrangle.h"
    #include "MTetrahedron.h"
    #include "MHexahedron.h"
    #include "MPrism.h"
    #include "MPyramid.h"
    #include "ExtrudeParams.h"
    #include "meshGFace.h"
    #include "meshGRegion.h"
    #include "Context.h"
    #include "MVertexRTree.h"
    
    #if defined(HAVE_QUADTRI)
    #include "QuadTriExtruded3D.h"
    #endif
    
    static void addTetrahedron(MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4,
                               GRegion *to)
    {
      to->tetrahedra.push_back(new MTetrahedron(v1, v2, v3, v4));
    }
    
    static void addPyramid(MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4,
                           MVertex *v5, GRegion *to)
    {
      to->pyramids.push_back(new MPyramid(v1, v2, v3, v4, v5));
    }
    
    static void addPrism(MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4,
                         MVertex *v5, MVertex *v6, GRegion *to)
    {
      to->prisms.push_back(new MPrism(v1, v2, v3, v4, v5, v6));
    }
    
    static void addHexahedron(MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4,
                              MVertex *v5, MVertex *v6, MVertex *v7, MVertex *v8,
                              GRegion *to)
    {
      to->hexahedra.push_back(new MHexahedron(v1, v2, v3, v4, v5, v6, v7, v8));
    }
    
    static void createPriPyrTet(std::vector<MVertex *> &v, GRegion *to,
                                MElement *source)
    {
      int dup[3];
      int j = 0;
      for(int i = 0; i < 3; i++)
        if(v[i] == v[i + 3]) dup[j++] = i;
    
      if(j == 2) {
        if(dup[0] == 0 && dup[1] == 1)
          addTetrahedron(v[0], v[1], v[2], v[5], to);
        else if(dup[0] == 1 && dup[1] == 2)
          addTetrahedron(v[0], v[1], v[2], v[3], to);
        else
          addTetrahedron(v[0], v[1], v[2], v[4], to);
      }
      else if(j == 1) {
        if(dup[0] == 0)
          addPyramid(v[1], v[4], v[5], v[2], v[0], to);
        else if(dup[0] == 1)