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

Makefile

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    partitionEdge.h 1.24 KiB
    // Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
    //
    // See the LICENSE.txt file for license information. Please report all
    // bugs and problems to <gmsh@geuz.org>.
    
    #ifndef _PARTITION_EDGE_H_
    #define _PARTITION_EDGE_H_
    
    #include "GModel.h"
    #include "GEdge.h"
    #include "discreteEdge.h"
    
    class partitionEdge : public discreteEdge {
     public:
      std::vector<int> _partitions;
     public:
      partitionEdge(GModel *model, int num, GVertex *_v0, GVertex *_v1, 
    		std::vector<int> &partitions) 
        : discreteEdge(model,num,_v0,_v1),_partitions(partitions)
      {
        std::sort(_partitions.begin(),_partitions.end());
      }
      virtual ~partitionEdge() {}
      virtual GeomType geomType() const { return PartitionCurve; }
    };
    
    
    struct Less_partitionEdge : 
      public std::binary_function<partitionEdge*, partitionEdge*, bool> {
      bool operator()(const partitionEdge* e1, const partitionEdge* e2) const
      {
        if (e1->_partitions.size() < e2->_partitions.size()) return true; 
        if (e1->_partitions.size() > e2->_partitions.size()) return false;
        for (unsigned int i = 0; i < e1->_partitions.size(); i++){
          if (e1->_partitions[i] < e2->_partitions[i]) return true; 
          if (e1->_partitions[i] > e2->_partitions[i]) return false;      
        }
        return false;
      }
    };
    
    #endif