Commit 768b336a by Christophe Geuzaine

- more partition options on command line

- allow to partition meshes directly from the command line
- don't make partitions (&boundaries) simply connected if partition topo is not created
parent b0e19319
Pipeline #1055 passed with stage
in 35 minutes 3 seconds
......@@ -82,7 +82,8 @@ std::vector<std::pair<std::string, std::string> > GetUsage()
s.push_back(mp("-part_weight tri|quad|tet|hex|pri|pyr|trih int",
"Weight of a triangle/quad/etc. during partitioning"));
s.push_back(mp("-part_split", "Save mesh partitions in separate files"));
s.push_back(mp("-part_topo", "Save the partition topology .pro file"));
s.push_back(mp("-part_[no]topo", "Create the partition topology"));
s.push_back(mp("-part_topo_pro", "Save the partition topology .pro file"));
s.push_back(mp("-save_all", "Save all elements (discard physical group definitions)"));
s.push_back(mp("-save_parametric", "Save vertices with their parametric coordinates"));
s.push_back(mp("-save_topology", "Save model topology"));
......@@ -448,11 +449,19 @@ void GetOptions(int argc, char *argv[], bool readConfigFiles)
opt_mesh_partition_split_mesh_files(0, GMSH_SET, 1.);
i++;
}
else if(!strcmp(argv[i] + 1, "part_topo") ||
else if(!strcmp(argv[i] + 1, "part_topo_pro") ||
!strcmp(argv[i] + 1, "savePartTopology")){
opt_mesh_partition_save_topology_file(0, GMSH_SET, 1.);
i++;
}
else if(!strcmp(argv[i] + 1, "part_topo")){
opt_mesh_partition_create_topology(0, GMSH_SET, 1.);
i++;
}
else if(!strcmp(argv[i] + 1, "part_notopo")){
opt_mesh_partition_create_topology(0, GMSH_SET, 0.);
i++;
}
else if(!strcmp(argv[i] + 1, "new")) {
CTX::instance()->files.push_back("-new");
i++;
......
......@@ -279,7 +279,6 @@ int GmshBatch()
MergeFile(CTX::instance()->files[i]);
}
#if defined(HAVE_POST) && defined(HAVE_MESH)
if(!CTX::instance()->bgmFileName.empty()) {
MergePostProcessingFile(CTX::instance()->bgmFileName);
......@@ -317,13 +316,12 @@ int GmshBatch()
RefineMesh(GModel::current(), CTX::instance()->mesh.secondOrderLinear);
else if(CTX::instance()->batch == 6)
GModel::current()->classifyAllFaces();
#if defined(HAVE_METIS)
if(CTX::instance()->batchAfterMesh == 1){
if (CTX::instance()->mesh.numPartitions > 1)
GModel::current()->partitionMesh(CTX::instance()->mesh.numPartitions);
}
#endif
#endif
}
if(CTX::instance()->batch > 0 || CTX::instance()->batchAfterMesh == 1){
if(CTX::instance()->mesh.numPartitions > 1)
GModel::current()->partitionMesh(CTX::instance()->mesh.numPartitions);
std::string name = CTX::instance()->outputFileName;
if(name.empty()){
if(CTX::instance()->mesh.fileFormat == FORMAT_AUTO)
......
......@@ -1033,6 +1033,10 @@ static void CreateNewEntities(GModel *const model,
(*it)->points.clear();
}
// If we don't create the partition topology let's just assume that the user
// does not care about multi-connected partitions or partition boundaries.
if(!CTX::instance()->mesh.partitionCreateTopology) return;
// Divide the non connected entities
regions = model->getRegions();
faces = model->getFaces();
......@@ -2416,6 +2420,7 @@ int PartitionMesh(GModel *const model)
}
}
}
std::vector< std::set<MElement*> > boundaryElements = graph.getBoundaryElements();
graph.clear();
model->recomputeMeshPartitions();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment