#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <fstream>
#include <iostream>
int main(int argc, char** argv)
{
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::parameters::vertex_index_map(get(boost::vertex_external_index, pm))
.face_partition_id_map(partition_id_map)
.METIS_options(&options));
return EXIT_SUCCESS;
}
void partition_graph(const TriangleMesh &tm, int nparts, const NamedParameters &np=parameters::default_values())
computes a partition of the input triangular mesh into nparts parts, based on the mesh's nodal graph.
Definition: partition_graph.h:228
std::string data_file_path(const std::string &filename)
Convenience header file including the headers for all the partitioning-related free functions of this...
Dynamic face property tag.
Definition: properties.h:97