Skip to content
Snippets Groups Projects
Select Git revision
  • 1da70a8bb99b3a1a5a66fe64b67b43976c455246
  • master default protected
  • overlaps_tags_and_distributed_export
  • overlaps_tags_and_distributed_export_rebased
  • relaying
  • alphashapes
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • 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
41 results

ghostEdge.h

Blame
  • ghostEdge.h 1.91 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.
    //
    // Contributed by Anthony Royer
    
    #ifndef _GHOST_EDGE_H_
    #define _GHOST_EDGE_H_
    
    #include "GModel.h"
    #include "discreteEdge.h"
    #include "MLine.h"
    
    class ghostEdge : public discreteEdge {
    private:
      unsigned int _partition;
      std::map<MElement *, unsigned int> _ghostCells;
      bool _saveMesh;
      bool _haveMesh;
    
    public:
      ghostEdge(GModel *model, const int num, const unsigned int partition)
        : discreteEdge(model, num, NULL, NULL), _partition(partition),
          _ghostCells(), _saveMesh(false), _haveMesh(false)
      {
      }
      virtual ~ghostEdge()
      {
        if(!_haveMesh) {
          lines.clear();
          mesh_vertices.clear();
        }
      }
      virtual GeomType geomType() const { return GhostCurve; }
      virtual void setPartition(const unsigned int partition)
      {
        _partition = partition;
      }
      virtual unsigned int getPartition() const { return _partition; }
      bool saveMesh() const { return _saveMesh; }
      void saveMesh(bool saveMesh) { _saveMesh = saveMesh; }
      bool haveMesh() const { return _haveMesh; }
      void haveMesh(bool haveMesh) { _haveMesh = haveMesh; }
      virtual std::map<MElement *, unsigned int> &getGhostCells()
      {
        return _ghostCells;
      }
    
      void addLine(MLine *l, unsigned int onWhichPartition)
      {
        GEdge::addLine(l);
        _ghostCells.insert(
          std::pair<MElement *, unsigned int>(l, onWhichPartition));
        model()->addGhostCells(l, onWhichPartition);
      }
      void addElement(int type, MElement *e, unsigned int onWhichPartition)
      {
        GEdge::addElement(type, e);
        _ghostCells.insert(
          std::pair<MElement *, unsigned int>(e, onWhichPartition));
        model()->addGhostCells(e, onWhichPartition);
      }
    
      // To make the hidden function visible in ghostEdge
      using discreteEdge::addElement;
      using discreteEdge::addLine;
    };
    
    #endif