Commit ab8dff87 authored by ws's avatar ws

Take BGM into account in case of embedded vertices. For embedded edges and…

Take BGM into account in case of embedded vertices. For embedded edges and contour edges, the BGM is already taken into account in their mesh, which is used as starting point to calculate the mesh size on these nodes. However, this cannot be done for an embedded point.
parent 6d2cc41b
Pipeline #2871 failed with stage
in 16 minutes and 10 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.emplace(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