Select Git revision
meshPartition.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
meshPartition.cpp 90.62 KiB
// Gmsh - Copyright (C) 1997-2018 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
//
// Contributed by Anthony Royer.
#include <vector>
#include <set>
#include <sstream>
#include <algorithm>
#include <ctime>
#include <limits>
#include <stack>
#include <cstdlib>
#include <map>
#include <utility>
#include "GmshConfig.h"
#include "GmshMessage.h"
#include "GModel.h"
// TODO C++11 remove this nasty stuff
#if __cplusplus >= 201103L
#include <unordered_map>
#define hashmap std::unordered_map
#define hashmapface std::unordered_map\
<MFace, std::vector<std::pair<MElement*, std::vector<unsigned int> > >,\
Hash_Face, Equal_Face>
#define hashmapedge std::unordered_map\
<MEdge, std::vector<std::pair<MElement*, std::vector<unsigned int> > >,\
Hash_Edge, Equal_Edge>
#define hashmapvertex std::unordered_map\
<MVertex*, std::vector<std::pair<MElement*, std::vector<unsigned int> > > >
#else
#define hashmap std::map
#define hashmapface std::map\
<MFace, std::vector<std::pair<MElement*, std::vector<unsigned int> > >,\
Less_Face>
#define hashmapedge std::map\
<MEdge, std::vector<std::pair<MElement*, std::vector<unsigned int> > >,\
Less_Edge>
#define hashmapvertex std::map\
<MVertex*, std::vector<std::pair<MElement*, std::vector<unsigned int> > > >
#endif
#if defined(HAVE_METIS)
#include "OS.h"
#include "Context.h"
#include "partitionRegion.h"
#include "partitionFace.h"
#include "partitionEdge.h"
#include "partitionVertex.h"
#include "ghostRegion.h"
#include "ghostFace.h"
#include "ghostEdge.h"
#include "MFaceHash.h"
#include "MEdgeHash.h"
#include "MTriangle.h"
#include "MQuadrangle.h"
#include "MTetrahedron.h"
#include "MHexahedron.h"
#include "MPrism.h"
#include "MPyramid.h"
#include "MTrihedron.h"
#include "MElementCut.h"
#include "MPoint.h"
extern "C" {
#include <metis.h>