Skip to content
Snippets Groups Projects
Commit 5ef5987d authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

change signature of MEdgeVertex constructor : the optional lc arg should be...

change signature of MEdgeVertex constructor : the optional lc arg should be last; this also fixes a bug in GeomMeshMatcher
parent 2f28ec80
No related branches found
No related tags found
No related merge requests found
...@@ -113,8 +113,8 @@ class MEdgeVertex : public MVertex{ ...@@ -113,8 +113,8 @@ class MEdgeVertex : public MVertex{
public: public:
MVertexBoundaryLayerData* bl_data; MVertexBoundaryLayerData* bl_data;
MEdgeVertex(double x, double y, double z, GEntity *ge, double u, double lc = -1.0, MEdgeVertex(double x, double y, double z, GEntity *ge, double u, int num = 0,
int num = 0) double lc = -1.0)
: MVertex(x, y, z, ge,num), _u(u), _lc(lc), bl_data(0) : MVertex(x, y, z, ge,num), _u(u), _lc(lc), bl_data(0)
{ {
} }
...@@ -130,12 +130,16 @@ class MFaceVertex : public MVertex{ ...@@ -130,12 +130,16 @@ class MFaceVertex : public MVertex{
public : public :
MVertexBoundaryLayerData* bl_data; MVertexBoundaryLayerData* bl_data;
MFaceVertex(double x, double y, double z, GEntity *ge, double u, double v, int num = 0) MFaceVertex(double x, double y, double z, GEntity *ge, double u, double v,
int num = 0)
: MVertex(x, y, z, ge, num), _u(u), _v(v), bl_data(0) : MVertex(x, y, z, ge, num), _u(u), _v(v), bl_data(0)
{ {
} }
virtual ~MFaceVertex(){ if(bl_data) delete bl_data; } virtual ~MFaceVertex(){ if(bl_data) delete bl_data; }
virtual bool getParameter(int i, double &par) const { par = (i ? _v : _u); return true; } virtual bool getParameter(int i, double &par) const
{
par = (i ? _v : _u); return true;
}
virtual bool setParameter(int i, double par) virtual bool setParameter(int i, double par)
{ {
if(!i) if(!i)
......
...@@ -90,7 +90,6 @@ static double F_LcB(GEdge *ge, double t) ...@@ -90,7 +90,6 @@ static double F_LcB(GEdge *ge, double t)
/* if (blf){ /* if (blf){
double lc2 = (*blf)( p.x(), p.y(), p.z() , ge); double lc2 = (*blf)( p.x(), p.y(), p.z() , ge);
// printf("p %g %g lc %g\n",p.x(),p.y(),lc2);
lc = std::min(lc, lc2); lc = std::min(lc, lc2);
} }
*/ */
...@@ -124,7 +123,6 @@ static double F_Lc(GEdge *ge, double t) ...@@ -124,7 +123,6 @@ static double F_Lc(GEdge *ge, double t)
/* /*
if (blf){ if (blf){
double lc2 = (*blf)( p.x(), p.y(), p.z() , ge); double lc2 = (*blf)( p.x(), p.y(), p.z() , ge);
// printf("p %g %g lc %g\n",p.x(),p.y(),lc2);
lc_here = std::min(lc_here, lc2); lc_here = std::min(lc_here, lc2);
} }
*/ */
...@@ -461,7 +459,7 @@ static void createPoints(GVertex *gv, GEdge *ge, BoundaryLayerField *blf, ...@@ -461,7 +459,7 @@ static void createPoints(GVertex *gv, GEdge *ge, BoundaryLayerField *blf,
while (1){ while (1){
if (L > blf->thickness || L > LEdge * .4) break; if (L > blf->thickness || L > LEdge * .4) break;
SPoint3 p (gv->x() + dir.x() * L, gv->y() + dir.y() * L, 0.0); SPoint3 p (gv->x() + dir.x() * L, gv->y() + dir.y() * L, 0.0);
v.push_back(new MEdgeVertex(p.x(), p.y(), p.z(), ge, ge->parFromPoint(p), blf->hfar)); v.push_back(new MEdgeVertex(p.x(), p.y(), p.z(), ge, ge->parFromPoint(p), 0, blf->hfar));
int ith = v.size() ; int ith = v.size() ;
L += hwall * pow (blf->ratio, ith); L += hwall * pow (blf->ratio, ith);
} }
...@@ -695,8 +693,7 @@ void meshGEdge::operator() (GEdge *ge) ...@@ -695,8 +693,7 @@ void meshGEdge::operator() (GEdge *ge)
const double d = norm(der); const double d = norm(der);
double lc = d/(P1.lc + dlc / dp * (d - P1.p)); double lc = d/(P1.lc + dlc / dp * (d - P1.p));
GPoint V = ge->point(t); GPoint V = ge->point(t);
// printf("%d %g\n",NUMP-1,t); mesh_vertices[NUMP - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t, 0, lc);
mesh_vertices[NUMP - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t, lc);
NUMP++; NUMP++;
} }
else { else {
......
...@@ -481,7 +481,7 @@ static void remeshUnrecoveredEdges(std::map<MVertex*, BDS_Point*> &recoverMapInv ...@@ -481,7 +481,7 @@ static void remeshUnrecoveredEdges(std::map<MVertex*, BDS_Point*> &recoverMapInv
double t = 0.5 * (t2 + t1); double t = 0.5 * (t2 + t1);
double lc = 0.5 * (lc1 + lc2); double lc = 0.5 * (lc1 + lc2);
GPoint V = itr->ge->point(t); GPoint V = itr->ge->point(t);
MEdgeVertex * newv = new MEdgeVertex(V.x(), V.y(), V.z(), itr->ge, t, lc); MEdgeVertex * newv = new MEdgeVertex(V.x(), V.y(), V.z(), itr->ge, t, 0, lc);
newLines.push_back(new MLine(v1, newv)); newLines.push_back(new MLine(v1, newv));
newLines.push_back(new MLine(newv, v2)); newLines.push_back(new MLine(newv, v2));
delete itr->ge->lines[i]; delete itr->ge->lines[i];
...@@ -2265,7 +2265,7 @@ static bool meshGeneratorPeriodic(GFace *gf, bool debug = true) ...@@ -2265,7 +2265,7 @@ static bool meshGeneratorPeriodic(GFace *gf, bool debug = true)
if (mv1->onWhat()->dim() == 1) { if (mv1->onWhat()->dim() == 1) {
double t; double t;
mv1->getParameter(0,t); mv1->getParameter(0,t);
mv2 = new MEdgeVertex(mv1->x(),mv1->y(),mv1->z(),mv1->onWhat(), t, mv2 = new MEdgeVertex(mv1->x(),mv1->y(),mv1->z(),mv1->onWhat(), t, 0,
((MEdgeVertex*)mv1)->getLc()); ((MEdgeVertex*)mv1)->getLc());
} }
else if (mv1->onWhat()->dim() == 0) { else if (mv1->onWhat()->dim() == 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment