delaunay3,
frontal3,
mmg3d,
- rtree
+ rtree,
+ hxt
};
#include <Context.h>
#endif
+#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
+#include <omp.h>
+#endif
+
using namespace std;
namespace
}
}
+
+//================================================================================
+/*!
+ * \brief Set maximum number of threads to be used by Gmsh
+ */
+//================================================================================
+
+#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
+void GMSHPlugin_Mesher::SetMaxThreadsGmsh()
+{
+ MESSAGE("GMSHPlugin_Mesher::SetMaxThreadsGmsh");
+ if (_compounds.size() > 0)
+ _maxThreads = 1;
+ else
+ _maxThreads = omp_get_max_threads();
+}
+#endif
+
//================================================================================
/*!
* \brief Set Gmsh Options
mapAlgo3d[1]=4; // Frontal
mapAlgo3d[2]=7; // MMG3D
mapAlgo3d[3]=9; // R-tree
+ mapAlgo3d[4]=10;// HXT
int ok;
ok = GmshSetOption("Mesh", "Algorithm" , mapAlgo2d[_algo2d]) ;
ok = GmshSetOption("Mesh", "SecondOrderIncomplete" ,(_useIncomplElem)?1.:0.);
ASSERT(ok);
}
+
+#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
+/*ok = GmshSetOption("Mesh", "MaxNumThreads1D" , 0. ) ; // Coarse-grain algo threads
+ ASSERT(ok);
+ ok = GmshSetOption("Mesh", "MaxNumThreads2D" , 0. ) ; // Coarse-grain algo threads
+ ASSERT(ok);
+ ok = GmshSetOption("Mesh", "MaxNumThreads3D" , 0. ) ; // Fine-grain algo threads HXT
+ ASSERT(ok);
+/**/
+ ok = GmshSetOption("General", "NumThreads" , _maxThreads ) ; // system default i.e. OMP_NUM_THREADS
+ ASSERT(ok);
+#endif
}
//================================================================================
int err = 0;
+#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=8
+ SetMaxThreadsGmsh();
+#endif
GmshInitialize();
SetGmshOptions();
_gModel = new GModel();
#include <stdio.h>
#include "GmshVersion.h"
-#if GMSH_MAJOR_VERSION >=4
+#if GMSH_MAJOR_VERSION >=4
#include "gmsh.h"
-#else
+#else
#include "Gmsh.h"
#endif
#include "GmshConfig.h"
#include "GModelIO_GEO.h"
#include "Geo.h"
#if GMSH_MAJOR_VERSION >=4
-#include "GEdge.h"
+#include "GEdge.h"
#include "GFace.h"
#else
#include "GEdgeCompound.h"
*/
//=============================================================================
-class GMSHPLUGIN_EXPORT GMSHPlugin_Mesher
+class GMSHPLUGIN_EXPORT GMSHPlugin_Mesher
{
public:
// ---------- PUBLIC METHODS ----------
bool Compute();
bool Evaluate(MapShapeNbElems& aResMap);
-
+
static float DistBoundingBox(const SBoundingBox3d& bounds, const SPoint3& point);
private:
bool _secondOrder, _useIncomplElem;
bool _is2d;
GModel* _gModel;
-
+#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=3
+ double _maxThreads;
+#endif
+
std::set<std::string> _compounds;
-
+
void SetGmshOptions();
void CreateGmshCompounds();
- void SetCompoundMeshVisibility();
void FillSMesh();
-
+#if GMSH_MAJOR_VERSION >=4 && GMSH_MINOR_VERSION >=3
+ void SetMaxThreadsGmsh();
+ void SetCompoundMeshVisibility();
+#endif
class mymsg : public GmshMessage
{
private:
aGroupLayout->addWidget( new QLabel( tr( "GMSH_3D_ALGO" ), GroupC1 ), row, 0 );
my3DAlgo = new QComboBox( GroupC1 );
QStringList types3DAlgo;
- types3DAlgo << tr("GMSH_DELAUNAY3") << tr( "GMSH_FRONTAL_DELAUNAY" ) << tr( "GMSH_MMG3D" ) <<
- tr( "GMSH_R_TREE" );
+ types3DAlgo << tr( "GMSH_DELAUNAY3" ) << tr( "GMSH_FRONTAL_DELAUNAY" ) << tr( "GMSH_MMG3D" ) <<
+ tr( "GMSH_R_TREE" ) << tr( "GMSH_HXT" );
my3DAlgo->addItems( types3DAlgo );
aGroupLayout->addWidget( my3DAlgo, row, 1 );
row++;
<source>GMSH_R_TREE</source>
<translation>R-tree</translation>
</message>
+ <message>
+ <source>GMSH_HXT</source>
+ <translation>Parallel Delaunay (HXT)</translation>
+ </message>
<message>
<source>GMSH_2D_RECOMB_ALGO</source>
<translation>2D recombination algorithm</translation>
<source>GMSH_R_TREE</source>
<translation>R-tree</translation>
</message>
+ <message>
+ <source>GMSH_HXT</source>
+ <translation>Delaunay Parallèle (HTX)</translation>
+ </message>
<message>
<source>GMSH_2D_RECOMB_ALGO</source>
<translation>Algorithme de recombinaison 2D</translation>