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

partitionVertex.h

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    partitionVertex.h 1.19 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_VERTEX_H_
    #define _PARTITION_VERTEX_H_
    
    #include "GModel.h"
    #include "discreteVertex.h"
    
    class partitionVertex : public discreteVertex {
     public:
      std::vector<int> _partitions;
     public:
      partitionVertex(GModel *model, int num, std::vector<int> &partitions) 
        : discreteVertex(model,num),_partitions(partitions)
      {
        std::sort(_partitions.begin(),_partitions.end());
      }
      virtual ~partitionVertex() {}
      virtual GeomType geomType() const { return PartitionVertex; }
    };
    
    
    struct Less_partitionVertex : 
      public std::binary_function<partitionVertex*, partitionVertex*, bool> {
      bool operator()(const partitionVertex* e1, const partitionVertex* e2) const{
        if (e1->_partitions.size() < e2->_partitions.size())return true; 
        if (e1->_partitions.size() > e2->_partitions.size())return false;
        for (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