diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index 7fa87ccd42fdfb721579a2017545ac870280d705..0f4ea7073a0c3768f002f55125831d1c1680c392 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -1704,14 +1704,24 @@ class AttractorField : public Field it != edges_id.end(); ++it) { GEdge *e = GModel::current()->getEdgeByTag(*it); if(e) { - for(int i = 1; i < n_nodes_by_edge - 1; i++) { - double u = (double)i / (n_nodes_by_edge - 1); + if (e->mesh_vertices.size()){ + for(unsigned int i = 0; i < e->mesh_vertices.size(); i++) { + double u ; e->mesh_vertices[i]->getParameter(0,u); + GPoint gp = e->point(u); + getCoord(gp.x(), gp.y(), gp.z(), zeronodes[k][0], + zeronodes[k][1], zeronodes[k][2], e); + _infos[k++] = AttractorInfo(*it,1,u,0); + } + } + int NNN = n_nodes_by_edge - e->mesh_vertices.size(); + for(int i = 1; i < NNN - 1; i++) { + double u = (double)i / (NNN - 1); Range<double> b = e->parBounds(0); double t = b.low() + u * (b.high() - b.low()); GPoint gp = e->point(t); getCoord(gp.x(), gp.y(), gp.z(), zeronodes[k][0], zeronodes[k][1], zeronodes[k][2], e); - _infos[k++] = AttractorInfo(*it,1,u,0); + _infos[k++] = AttractorInfo(*it,1,t,0); } } } @@ -1944,7 +1954,7 @@ void BoundaryLayerField::operator() (double x, double y, double z, } for(std::list<int>::iterator it = edges_id.begin(); it != edges_id.end(); ++it) { - _att_fields.push_back(new AttractorField(1,*it,100000)); + _att_fields.push_back(new AttractorField(1,*it,10000)); } for(std::list<int>::iterator it = faces_id.begin(); it != faces_id.end(); ++it) { diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index 0ad754365a1933c399dd157ade6bfb625059751b..d78d6013aabd66ccfd0059de2352de8a5a16f28d 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -175,7 +175,10 @@ static void copyMesh(GFace *source, GFace *target) else { SVector3 DX2 = DX - SVector3 (vt->x() - vs->x(), vt->y() - vs->y(), vt->z() - vs->z()); - if (DX2.norm() > DX.norm() * 1.e-8) translation = false; + if (DX2.norm() > DX.norm() * 1.e-8) { + // translation = false; + printf("%12.5E vs %12.5E\n",DX2.norm() , DX.norm()); + } } count ++; } @@ -671,7 +674,7 @@ void modifyInitialMeshForTakingIntoAccountBoundaryLayers(GFace *gf) MEdge dv2 (v21,v22); //avoid convergent errors - if (dv2.length() < 0.5 * dv.length())break; + if (dv2.length() < 0.3 * dv.length())break; blQuads.push_back(new MQuadrangle(v11,v21,v22,v12)); fprintf(ff2,"SQ (%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g,%g){1,1,1,1};\n", v11->x(),v11->y(),v11->z(), diff --git a/Mesh/meshGFaceBoundaryLayers.cpp b/Mesh/meshGFaceBoundaryLayers.cpp index cd61a6d25d6f72b94a45ea064bb3c2d9c92b38b9..8800821807e49d5de7e447568023bbf3a13c0bb0 100644 --- a/Mesh/meshGFaceBoundaryLayers.cpp +++ b/Mesh/meshGFaceBoundaryLayers.cpp @@ -323,8 +323,8 @@ BoundaryLayerColumns* buildAdditionalPoints2D (GFace *gf) _close = blf->_closest_point; _current_distance = blf -> current_distance; } - SPoint2 poffset (p.x() + 1.e-8 * n.x(), - p.y() + 1.e-8 * n.y()); + SPoint2 poffset (p.x() + 1.e-12 * n.x(), + p.y() + 1.e-12 * n.y()); buildMeshMetric(gf, poffset, m, metric); const double l2 = n.x()*n.x()*metric[0] + 2*n.x()*n.y()*metric[1] + n.y()*n.y()*metric[2] ; l = 1./sqrt(l2); diff --git a/Mesh/meshGFaceBoundaryLayers.h b/Mesh/meshGFaceBoundaryLayers.h index 2679271d18e6c21bdb4dd8bf0b6fa17b2a6244b7..e6b4917ccd50bffd8121dd2fb0b9c3cceb3c41e8 100644 --- a/Mesh/meshGFaceBoundaryLayers.h +++ b/Mesh/meshGFaceBoundaryLayers.h @@ -112,6 +112,18 @@ public: else return edgeColumn(getColumn (v1,0),getColumn(v2,N2-1)); } + if (it2 != _fans.end() && it1 != _fans.end() ){ + int c1, c2; + if (aaa(it1->second._e1,e)) + c1 = 0; + else + c1 = N1-1; + if (aaa(it2->second._e1,e)) + c2 = 0; + else + c2 = N2-1; + return edgeColumn(getColumn (v1,c1),getColumn(v2,c2)); + } if (N1 == 1 || N2 == 2){ const BoundaryLayerData & c10 = getColumn(v1,0); @@ -128,7 +140,7 @@ public: else return edgeColumn(c11,c20); } - Msg::Error ("Impossible Boundary Layer Configuration : one side and no fans"); + Msg::Error ("Impossible Boundary Layer Configuration : one side and no fans %d %d",N1,N2); // FIXME WRONG return N1 ? edgeColumn (getColumn (v1,0),getColumn(v1,0)) : edgeColumn (getColumn (v2,0),getColumn(v2,0)); diff --git a/Mesh/meshGFaceOptimize.cpp b/Mesh/meshGFaceOptimize.cpp index c27522a364f0083254c8ec73492b18c69e05c249..3a8454871c9e58fee56518de89cc8d80527fde66 100644 --- a/Mesh/meshGFaceOptimize.cpp +++ b/Mesh/meshGFaceOptimize.cpp @@ -158,7 +158,7 @@ void buildMeshGenerationDataStructures(GFace *gf, std::list<GVertex*>::iterator itvx = emb_vertx.begin(); while(itvx != emb_vertx.end()){ MVertex *v = *((*itvx)->mesh_vertices.begin()); - vSizesMap[v] = std::min(vSizesMap[v], (*itvx)->prescribedMeshSizeAtVertex()); + vSizesMap[v] = std::max(vSizesMap[v], (*itvx)->prescribedMeshSizeAtVertex()); ++itvx; } }