#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <fstream>
#include <iostream>
int main(int argc, char** argv)
{
std::ifstream in((argc>1) ? argv[1] : CGAL::data_file_path("meshes/eight.off"));
int number_of_parts = (argc>2) ? atoi(argv[2]) : 8;
if(!in)
{
std::cerr << "Error: could not read input file" << std::endl;
return EXIT_FAILURE;
}
PM pm;
in >> pm;
typedef boost::property_map<PM, Face_property_tag>::type Face_id_map;
Face_id_map partition_id_map = get(Face_property_tag(), pm);
idx_t options[METIS_NOPTIONS];
METIS_SetDefaultOptions(options);
options[METIS_OPTION_PTYPE] = METIS_PTYPE_KWAY;
options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_VOL;
options[METIS_OPTION_CTYPE] = METIS_CTYPE_SHEM;
options[METIS_OPTION_NCUTS] = 3;
options[METIS_OPTION_NITER] = 10;
options[METIS_OPTION_SEED] = 12345;
options[METIS_OPTION_MINCONN] = 1;
options[METIS_OPTION_CONTIG] = 1;
options[METIS_OPTION_UFACTOR] = 25;
options[METIS_OPTION_DBGLVL] = METIS_DBG_INFO;
CGAL::METIS::partition_graph(pm, number_of_parts,
CGAL::parameters::vertex_index_map(get(boost::vertex_external_index, pm))
.face_partition_id_map(partition_id_map)
.METIS_options(&options));
return EXIT_SUCCESS;
}
Convenience header file including the headers for all the partitioning-related free functions of this...
Dynamic face property tag.
Definition: properties.h:97