Commit 5b131cba authored by Christophe Geuzaine's avatar Christophe Geuzaine

only check inverted elements for non-gmsh models

parent f6300611
Pipeline #2256 failed with stage
in 141 minutes 46 seconds
......@@ -2752,9 +2752,7 @@ static double TRIANGLE_VALIDITY(GFace *gf, MTriangle *t)
SVector3 d2(t->getVertex(2)->x() - t->getVertex(0)->x(),
t->getVertex(2)->y() - t->getVertex(0)->y(),
t->getVertex(2)->z() - t->getVertex(0)->z());
SVector3 c = crossprod(d1, d2);
return dot(N, c);
}
......@@ -2864,15 +2862,18 @@ void meshGFace::operator()(GFace *gf, bool print)
Msg::Warning("Surface %d consists of no elements", gf->tag());
}
if(algoDelaunay2D(gf) && !isMeshValid(gf)) {
Msg::Warning(
"Delaunay based mesher failed on surface %d --> moving to meshadapt",
gf->tag());
// test validity for non-Gmsh models (currently we cannot reliably evaluate
// the normal on the boundary of surfaces with the Gmsh kernel)
if(gf->getNativeType() != GEntity::GmshModel &&
algoDelaunay2D(gf) && !isMeshValid(gf)) {
Msg::Warning("Delaunay-based mesher failed on surface %d -> moving to MeshAdapt",
gf->tag());
deMeshGFace killer;
killer(gf);
gf->setMeshingAlgo(1);
(*this)(gf, print);
}
}
static bool getGFaceNormalFromVert(GFace *gf, MElement *el, SVector3 &nf)
......
......@@ -1502,15 +1502,15 @@ void bowyerWatsonFrontal(GFace *gf, std::map<MVertex *, MVertex *> *equivalence,
}
// nbSwaps = edgeSwapPass(gf, AllTris, SWCR_QUAL, DATA);
char name[245];
sprintf(name, "delFrontal_GFace_%d.pos", gf->tag());
_printTris(name, AllTris.begin(), AllTris.end(), &DATA);
sprintf(name, "delFrontal_GFace_%d_Real.pos", gf->tag());
_printTris(name, AllTris.begin(), AllTris.end(), NULL);
// sprintf(name,"delFrontal_GFace_%d_Layer_Real%d.pos",gf->tag(),ITERATION);
// _printTris (name, AllTris.begin(), AllTris.end(),NULL);
// sprintf(name,"delFrontal_GFace_%d_Layer_%d_Active.pos",gf->tag(),ITERATION);
// _printTris (name, ActiveTris.begin(), ActiveTris.end(), &DATA);
// char name[245];
// sprintf(name, "delFrontal_GFace_%d.pos", gf->tag());
// _printTris(name, AllTris.begin(), AllTris.end(), &DATA);
// sprintf(name, "delFrontal_GFace_%d_Real.pos", gf->tag());
// _printTris(name, AllTris.begin(), AllTris.end(), NULL);
// sprintf(name,"delFrontal_GFace_%d_Layer_Real%d.pos",gf->tag(),ITERATION);
// _printTris (name, AllTris.begin(), AllTris.end(),NULL);
// sprintf(name,"delFrontal_GFace_%d_Layer_%d_Active.pos",gf->tag(),ITERATION);
// _printTris (name, ActiveTris.begin(), ActiveTris.end(), &DATA);
transferDataStructure(gf, AllTris, DATA);
// removeThreeTrianglesNodes(gf);
......
......@@ -1031,7 +1031,6 @@ bool edgeSwapDelProj(MVertex *v1, MVertex *v2, MVertex *v3, MVertex *v4)
SVector3 n1 = t1.getFace(0).normal();
SVector3 n2 = t2.getFace(0).normal();
if(dot(n1, n2) <= 0) {
// printf("OLA !!!\n");
return true;
}
return false;
......
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