HXT 3D mesher

parent b32e7f16
Pipeline #2807 failed with stage
in 56 minutes and 36 seconds
......@@ -94,7 +94,7 @@ std::vector<std::pair<std::string, std::string> > GetUsage()
s.push_back(mp("-save_parametric", "Save nodes with their parametric coordinates"));
s.push_back(mp("-save_topology", "Save model topology"));
s.push_back(mp("-algo string", "Select mesh algorithm (meshadapt, del2d, front2d, "
"delquad, del3d, front3d, mmg3d, pack)"));
"delquad, del3d, front3d, mmg3d, pack, hxt)"));
s.push_back(mp("-smooth int", "Set number of mesh smoothing steps"));
s.push_back(mp("-order int", "Set mesh order (1, ..., 5)"));
s.push_back(mp("-optimize[_netgen]", "Optimize quality of tetrahedral elements"));
......@@ -1188,8 +1188,9 @@ void GetOptions(int argc, char *argv[], bool readConfigFiles, bool exitOnError)
}
else if(!strcmp(argv[i] + 1, "nt")) {
i++;
if(argv[i])
if(argv[i]){
opt_general_num_threads(0, GMSH_SET, atoi(argv[i++]));
}
else{
Msg::Error("Missing number");
if(exitOnError) Msg::Exit(1);
......
......@@ -6089,6 +6089,9 @@ double opt_mesh_algo3d(OPT_ARGS_NUM)
#if defined(HAVE_FLTK)
if(FlGui::available() && (action & GMSH_GUI)) {
switch (CTX::instance()->mesh.algo3d) {
case ALGO_3D_HXT:
FlGui::instance()->options->mesh.choice[3]->value(6);
break;
case ALGO_3D_RTREE:
FlGui::instance()->options->mesh.choice[3]->value(5);
break;
......
......@@ -573,8 +573,11 @@ static void mesh_options_ok_cb(Fl_Widget *w, void *data)
ALGO_3D_FRONTAL_HEX :
(o->mesh.choice[3]->value() == 4) ?
ALGO_3D_MMG3D :
(o->mesh.choice[3]->value() == 6) ?
ALGO_3D_HXT :
(o->mesh.choice[3]->value() == 5) ? ALGO_3D_RTREE :
ALGO_3D_DELAUNAY);
ALGO_3D_DELAUNAY
);
opt_mesh_algo_recombine(0, GMSH_SET, o->mesh.choice[1]->value());
opt_mesh_algo_subdivide(0, GMSH_SET, o->mesh.choice[5]->value());
opt_mesh_color_carousel(0, GMSH_SET, o->mesh.choice[4]->value());
......@@ -2242,6 +2245,7 @@ optionWindow::optionWindow(int deltaFontSize)
{"Frontal Hex (experimental)", 0, 0, 0},
{"MMG3D (experimental)", 0, 0, 0},
{"R-tree (experimental)", 0, 0, 0},
{"HXT", 0, 0, 0},
{0}
};
static Fl_Menu_Item menu_recombination_algo[] = {
......
......@@ -542,7 +542,7 @@ FindConnectedRegions(const std::vector<GRegion *> &del,
connected.push_back(temp2);
delaunay = temp1;
}
Msg::Info("Delaunay Meshing %d volumes with %d connected components",
Msg::Info("3D Meshing %d volumes with %d connected components",
nbVolumes, connected.size());
}
......@@ -1094,7 +1094,7 @@ void GenerateMesh(GModel *m, int ask)
std::for_each(m->firstFace(), m->lastFace(), orientMeshGFace());
// Optimize quality of 3D tet mesh
if(m->getMeshStatus() == 3) {
if(m->getMeshStatus() == 3 && CTX::instance()->mesh.algo3d != ALGO_3D_HXT) {
for(int i = 0; i < std::max(CTX::instance()->mesh.optimize,
CTX::instance()->mesh.optimizeNetgen);
i++) {
......
......@@ -25,6 +25,11 @@ extern "C" {
// This is a list of regions that are simply connected
HXTStatus hxtGmshMsgCallback(HXTMessage* msg){
return HXT_STATUS_OK;
}
static HXTStatus getAllFacesOfAllRegions (std::vector<GRegion *> &regions, HXTMesh *m, std::vector<GFace *> &allFaces){
std::set<GFace *, GEntityLessThan> allFacesSet;
if (m){
......@@ -301,7 +306,9 @@ static HXTStatus Gmsh2Hxt(std::vector<GRegion *> &regions, HXTMesh *m,
static HXTStatus _meshGRegionHxt(std::vector<GRegion *> &regions)
{
int nthreads = CTX::instance()->mesh.maxNumThreads3D;
HXT_CHECK(hxtSetMessageCallback (hxtGmshMsgCallback));
// int nthreads = CTX::instance()->mesh.maxNumThreads3D;
int optimize = 1;
int refine = 1;
int stat = 0;
......@@ -317,11 +324,10 @@ static HXTStatus _meshGRegionHxt(std::vector<GRegion *> &regions)
std::map<MVertex *, int> v2c;
std::vector<MVertex *> c2v;
Gmsh2Hxt(regions, mesh, v2c, c2v);
// Msg::Info("Entering hxtTetMesh3d using %d threads",nthreads);
HXT_CHECK(hxtTetMesh3d(mesh,
nthreads,
nthreads,
nthreads,
0,0,0,
reproducible,
verbosity,
stat,
......
......@@ -1607,7 +1607,7 @@ HXTStatus hxtOptimizeTetrahedra(HXTMesh *mesh,
min = fmin(sqrt(shared->quality2.values[i]*24.0), min);
}
printf("mean quality: %f | min quality: %f\n", mean, min);
// printf("mean quality: %f | min quality: %f\n", mean, min);
HXT_CHECK( threadLocals_destroy(&locals, maxThreads) );
HXT_CHECK( threadShared_destroy(&shared) );
......
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