Commit d08b06c9 authored by Anthony Royer's avatar Anthony Royer

Merge branch 'master' into Fix_bug

parents 8e0d4d0f 79f88e82
Pipeline #2628 passed with stage
in 17 minutes and 36 seconds
4.0.2: added support for creating MED files with specific MED (minor) version;
small bug fixes.
4.0.2 (September 26, 2018): added support for creating MED files with specific
MED (minor) version; small bug fixes.
4.0.1 (September 7, 2018): renumber mesh nodes/elements by default; new
SendToServer command for nodal views; added color and visibility handling in
......
......@@ -325,7 +325,7 @@ std::vector<MVertex *> GFace::getEmbeddedMeshVertices() const
tmp.insert((*it)->getEndVertex()->mesh_vertices.begin(),
(*it)->getEndVertex()->mesh_vertices.end());
}
for(std::list<GVertex *>::const_iterator it = embedded_vertices.begin();
for(std::set<GVertex *>::const_iterator it = embedded_vertices.begin();
it != embedded_vertices.end(); it++) {
tmp.insert((*it)->mesh_vertices.begin(), (*it)->mesh_vertices.end());
}
......@@ -405,7 +405,7 @@ std::string GFace::getAdditionalInfoString(bool multline)
if(embedded_vertices.size()) {
sstream << "Embedded points: ";
for(std::list<GVertex *>::iterator it = embedded_vertices.begin();
for(std::set<GVertex *>::iterator it = embedded_vertices.begin();
it != embedded_vertices.end(); ++it) {
if(it != embedded_vertices.begin()) sstream << ", ";
sstream << (*it)->tag();
......@@ -467,7 +467,7 @@ void GFace::writeGEO(FILE *fp)
it != embedded_edges.end(); it++)
fprintf(fp, "Line {%d} In Surface {%d};\n", (*it)->tag(), tag());
for(std::list<GVertex *>::iterator it = embedded_vertices.begin();
for(std::set<GVertex *>::iterator it = embedded_vertices.begin();
it != embedded_vertices.end(); it++)
fprintf(fp, "Point {%d} In Surface {%d};\n", (*it)->tag(), tag());
......@@ -1659,7 +1659,7 @@ void GFace::setMeshMaster(GFace *master, const std::vector<double> &tfo)
m_vtxToEdge[std::make_pair(v0, v1)] = (*eIter);
}
std::list<GVertex *> m_embedded_vertices = master->embeddedVertices();
std::set<GVertex *> m_embedded_vertices = master->embeddedVertices();
m_vertices.insert(m_embedded_vertices.begin(), m_embedded_vertices.end());
// check topological correspondence
......
......@@ -37,7 +37,7 @@ protected:
GRegion *r1, *r2;
mean_plane meanPlane;
std::vector<GEdge *> embedded_edges;
std::list<GVertex *> embedded_vertices;
std::set<GVertex *> embedded_vertices;
BoundaryLayerColumns _columns;
......@@ -94,7 +94,7 @@ public:
}
// add embedded vertices/edges
void addEmbeddedVertex(GVertex *v) { embedded_vertices.push_back(v); }
void addEmbeddedVertex(GVertex *v) { embedded_vertices.insert(v); }
void addEmbeddedEdge(GEdge *e) { embedded_edges.push_back(e); }
// delete the edge from the face (the edge is supposed to be a free
......@@ -129,7 +129,7 @@ public:
virtual std::vector<GEdge *> embeddedEdges() const { return embedded_edges; }
// edges that are embedded in the face
virtual std::list<GVertex *> embeddedVertices() const
virtual std::set<GVertex *> embeddedVertices() const
{
return embedded_vertices;
}
......
......@@ -143,7 +143,7 @@ void OCCFace::setup()
}
else if(vertex.Orientation() == TopAbs_INTERNAL) {
Msg::Debug("Adding embedded vertex %d in face %d", v->tag(), tag());
embedded_vertices.push_back(v);
embedded_vertices.insert(v);
}
}
......
......@@ -924,6 +924,29 @@ bool BDS_SwapEdgeTestQuality::operator()(BDS_Point *_p1, BDS_Point *_p2,
BDS_Point *_op3, BDS_Point *_oq1,
BDS_Point *_oq2, BDS_Point *_oq3) const
{
// Check if new edge is not on a seam or degenerated
BDS_Point *p1 = 0, *p2 = 0;
if (_op1 != _oq1 && _op1 != _oq2 && _op1 != _oq3){
p1 = _op2;
p2 = _op3;
}
else if (_op2 != _oq1 && _op2 != _oq2 && _op2 != _oq3){
p1 = _op1;
p2 = _op3;
}
else if (_op3 != _oq1 && _op3 != _oq2 && _op3 != _oq3){
p1 = _op1;
p2 = _op2;
}
else {
Msg::Warning("Unable to detect the new edge in BDS_SwapEdgeTestQuality\n");
}
if (p1 && p2){
if (p1->degenerated && p2->degenerated) return false;
if (p1->_periodicCounterpart && p2->_periodicCounterpart) return false;
}
if(!testQuality) return true;
double qa1 = qmTriangle::gamma(_p1, _p2, _p3);
......@@ -1076,10 +1099,6 @@ bool BDS_Mesh::swap_edge(BDS_Edge *e, const BDS_SwapEdgeTest &theTest,
if(!theTest(p1, p2, op[0], op[1])) return false;
// Check if new edge op[0] - op[1] is not on a seam or degenerated
if (op[0]->degenerated && op[1]->degenerated) return false;
if (op[0]->_periodicCounterpart && op[1]->_periodicCounterpart) return false;
if(p1->iD == CHECK1 && p2->iD == CHECK2) printf("TEST2 OK\n");
BDS_Edge *p1_op1 = find_edge(p1, op[0], e->faces(0));
......
......@@ -1122,8 +1122,8 @@ bool meshGenerator(GFace *gf, int RECUR_ITER, bool repairSelfIntersecting1dMesh,
}
// add embedded vertices
std::list<GVertex *> emb_vertx = gf->embeddedVertices();
std::list<GVertex *>::iterator itvx = emb_vertx.begin();
std::set<GVertex *> emb_vertx = gf->embeddedVertices();
std::set<GVertex *>::iterator itvx = emb_vertx.begin();
while(itvx != emb_vertx.end()) {
all_vertices.insert((*itvx)->mesh_vertices.begin(),
(*itvx)->mesh_vertices.end());
......@@ -2070,8 +2070,8 @@ static bool meshGeneratorPeriodic(GFace *gf, bool repairSelfIntersecting1dMesh,
// Embedded Vertices
// add embedded vertices
std::list<GVertex *> emb_vertx = gf->embeddedVertices();
std::list<GVertex *>::iterator itvx = emb_vertx.begin();
std::set<GVertex *> emb_vertx = gf->embeddedVertices();
std::set<GVertex *>::iterator itvx = emb_vertx.begin();
std::map<MVertex *, std::set<BDS_Point *> > invertedRecoverMap;
for(std::map<BDS_Point *, MVertex *, PointLessThan>::iterator it =
......
......@@ -723,8 +723,8 @@ void refineMeshBDS(GFace *gf, BDS_Mesh &m, const int NIT,
// classify correctly the embedded vertices use a negative model
// face number to avoid mesh motion
if(recoverMapInv) {
std::list<GVertex *> emb_vertx = gf->embeddedVertices();
std::list<GVertex *>::iterator itvx = emb_vertx.begin();
std::set<GVertex *> emb_vertx = gf->embeddedVertices();
std::set<GVertex *>::iterator itvx = emb_vertx.begin();
while(itvx != emb_vertx.end()) {
MVertex *v = *((*itvx)->mesh_vertices.begin());
std::map<MVertex *, BDS_Point *>::iterator itp = recoverMapInv->find(v);
......
......@@ -124,8 +124,8 @@ void buildMeshGenerationDataStructures(
// take care of embedded vertices
{
std::list<GVertex *> emb_vertx = gf->embeddedVertices();
std::list<GVertex *>::iterator itvx = emb_vertx.begin();
std::set<GVertex *> emb_vertx = gf->embeddedVertices();
std::set<GVertex *>::iterator itvx = emb_vertx.begin();
while(itvx != emb_vertx.end()) {
if((*itvx)->mesh_vertices.size()) {
MVertex *v = *((*itvx)->mesh_vertices.begin());
......
This diff is collapsed.
......@@ -106,7 +106,7 @@ Public License (GPL)</a>:
<ul>
<li>
<div class="highlight">
Current stable release (version 4.0.2, 25 September 2018):
Current stable release (version 4.0.2, 26 September 2018):
<ul>
<li>Download Gmsh for
<a href="bin/Windows/gmsh-4.0.2-Windows64.zip">Windows 64-bit</a>,
......
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