Commit 79f88e82 authored by Christophe Geuzaine's avatar Christophe Geuzaine

Merge branch 'SetForEmbeddedVertices' into 'master'

Use a set to store embedded vertices as we want to ensure that a single point…

See merge request !204
parents 6209e505 5af179ac
Pipeline #2627 passed with stage
in 57 minutes and 25 seconds
......@@ -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);
}
}
......
......@@ -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());
......
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