Skip to content
Snippets Groups Projects
Select Git revision
  • c31edadc92daab4f7c47b357b7faeb091b796210
  • master default protected
  • gdemesy-master-patch-25928
  • gdemesy-master-patch-34075
  • gdemesy-master-patch-27135
  • dev_photonics
6 results

bundle_onelab.sh

Blame
  • meshRefine.cpp 33.01 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.
    //
    // Contributor(s):
    //   Brian Helenbrook
    //
    
    #include "HighOrder.h"
    #include "MLine.h"
    #include "MTriangle.h"
    #include "MQuadrangle.h"
    #include "MTetrahedron.h"
    #include "MHexahedron.h"
    #include "MPrism.h"
    #include "MPyramid.h"
    #include "GmshMessage.h"
    #include "OS.h"
    #include "meshGFaceOptimize.h"
    
    void subdivide_pyramid(MElement *element, GRegion *gr,
                           faceContainer &faceVertices,
                           std::vector<MHexahedron *> &dwarfs88);
    
    struct MVertexLessThanParam {
      bool operator()(const MVertex *v1, const MVertex *v2) const
      {
        double u1 = 0., u2 = 1.;
        v1->getParameter(0, u1);
        v2->getParameter(0, u2);
        return u1 < u2;
      }
    };
    
    // Set BM data on vertex
    static void setBLData(MVertex *v)
    {
      switch(v->onWhat()->dim()) {
      case 1: {
        MEdgeVertex *ve = dynamic_cast<MEdgeVertex *>(v);
        if(ve) ve->bl_data = new MVertexBoundaryLayerData();
        break;
      }
      case 2: {
        MFaceVertex *vf = dynamic_cast<MFaceVertex *>(v);
        if(vf) vf->bl_data = new MVertexBoundaryLayerData();
        break;
      }
      }
    }
    
    // If all low-order nodes in are marked as BL, then mark high-order nodes as BL
    // (only works in 2D)
    static bool setBLData(MElement *el)
    {
      // Check whether all low-order nodes are marked as BL nodes (only works in 2D)
      for(int i = 0; i < el->getNumPrimaryVertices(); i++) {
        MVertex *v = el->getVertex(i);
        bool isBL = false;
        switch(v->onWhat()->dim()) {
        case 0: isBL = true; break;
        case 1: {
          MEdgeVertex *ve = dynamic_cast<MEdgeVertex *>(v);
          if(ve && ve->bl_data) isBL = true;
          break;
        }
        case 2: {
          MFaceVertex *vf = dynamic_cast<MFaceVertex *>(v);
          if(vf && vf->bl_data) isBL = true;