Skip to content
Snippets Groups Projects
Commit 517cacfa authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

add note explaining last bits to change to make meshers thread-safe

parent a41700f5
No related branches found
No related tags found
No related merge requests found
......@@ -403,18 +403,31 @@ static void Mesh2D(GModel *m)
double t1 = Cpu();
// skip short mesh edges
geomTresholdVertexEquivalence inst (m);
geomTresholdVertexEquivalence inst(m);
// boundary layers are special: their generation (including vertices
// and curve meshes) is global as it depends on a smooth normal
// field generated from the surface mesh of the source surfaces
if(!Mesh2DWithBoundaryLayers(m)){
#if 1
std::for_each(m->firstFace(), m->lastFace(), meshGFace());
#else
// test openmp
std::vector<GFace*> faces;
faces.insert(faces.begin(), m->firstFace(), m->lastFace());
#pragma omp parallel for schedule(dynamic)
for(unsigned int i = 0; i < faces.size(); i++){
meshGFace mesher;
mesher(faces[i]);
}
#endif
int nIter = 0;
while(1){
meshGFace mesher;
int nbPending = 0;
for(GModel::fiter it = m->firstFace() ; it!=m->lastFace(); ++it){
for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it){
if ((*it)->meshStatistics.status == GFace::PENDING){
mesher(*it);
nbPending++;
......
......@@ -368,6 +368,11 @@ static bool recover_medge_old(BDS_Mesh *m, GEdge *ge, std::set<EdgeToRecover> *e
// Builds An initial triangular mesh that respects the boundaries of
// the domain, including embedded points and surfaces
// FIXME: to make the algorithm thread-safe, we need to change the way
// we renumber the boundary vertices (and the associated u/v reparam):
// using setIndex leads to unpredicatbel results if meshing
// concurrently two surfaces that share a common edge!
static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER,
bool repairSelfIntersecting1dMesh, bool debug = true)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment