Commit efd6a55c authored by Christophe Geuzaine's avatar Christophe Geuzaine

Merge branch 'TakeBGMEmbeddedVerticesSurfacesIntoAccount' into 'master'

Take bgm embedded vertices surfaces into account

See merge request !214
parents fe3ed436 d338f4a1
Pipeline #2891 passed with stage
in 93 minutes and 15 seconds
......@@ -123,6 +123,7 @@ void buildMeshGenerationDataStructures(
setLcs(gf->triangles[i], vSizesMap, data);
// take care of embedded vertices
std::set<MVertex *> embeddedVertices;
{
std::set<GVertex *> emb_vertx = gf->embeddedVertices();
std::set<GVertex *>::iterator itvx = emb_vertx.begin();
......@@ -131,6 +132,7 @@ void buildMeshGenerationDataStructures(
MVertex *v = *((*itvx)->mesh_vertices.begin());
vSizesMap[v] =
std::min(vSizesMap[v], (*itvx)->prescribedMeshSizeAtVertex());
embeddedVertices.insert(v);
}
++itvx;
}
......@@ -174,14 +176,23 @@ void buildMeshGenerationDataStructures(
it != vSizesMap.end(); ++it) {
SPoint2 param;
reparamMeshVertexOnFace(it->first, gf, param);
data.addVertex(it->first, param[0], param[1], it->second, it->second);
// Add size of background mesh to embedded vertices. For the other nodes, use the size in vSizesMap
const double lcBGM = (embeddedVertices.count(it->first) > 0) ?
BGM_MeshSize(gf, param[0], param[1], it->first->x(), it->first->y(), it->first->z()) : it->second;
data.addVertex (it->first, param[0], param[1], it->second, lcBGM);
}
for(unsigned int i = 0; i < gf->triangles.size(); i++) {
double lc = 0.3333333333 *
(data.vSizes[data.getIndex(gf->triangles[i]->getVertex(0))] +
data.vSizes[data.getIndex(gf->triangles[i]->getVertex(1))] +
data.vSizes[data.getIndex(gf->triangles[i]->getVertex(2))]);
AllTris.insert(new MTri3(gf->triangles[i], lc, 0, &data, gf));
double lcBGM = 0.3333333333 *
(data.vSizesBGM[data.getIndex(gf->triangles[i]->getVertex(0))] +
data.vSizesBGM[data.getIndex(gf->triangles[i]->getVertex(1))] +
data.vSizesBGM[data.getIndex(gf->triangles[i]->getVertex(2))]);
double LL = Extend1dMeshIn2dSurfaces() ? std::min(lc, lcBGM) : lcBGM;
AllTris.insert(new MTri3(gf->triangles[i], LL, 0, &data, gf));
}
gf->triangles.clear();
connectTriangles(AllTris);
......
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