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

1D transfinite mesh algo was completely broken.

sigh.
parent 23f2c1fc
No related branches found
No related tags found
No related merge requests found
// $Id: meshGEdge.cpp,v 1.33 2007-04-16 11:46:27 remacle Exp $ // $Id: meshGEdge.cpp,v 1.34 2007-04-21 22:26:51 geuzaine Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -236,21 +236,22 @@ void meshGEdge::operator() (GEdge *ge) ...@@ -236,21 +236,22 @@ void meshGEdge::operator() (GEdge *ge)
} }
const double b = a / (double)(N - 1); const double b = a / (double)(N - 1);
MVertex *v0 = ge->getBeginVertex()->mesh_vertices[0]; MVertex *v0 = ge->getBeginVertex()->mesh_vertices[0];
MVertex *v1 = ge->getEndVertex()->mesh_vertices[0]; MVertex *v1 = ge->getEndVertex()->mesh_vertices[0];
// if the curve is periodic and if the begin vertex is identical to the end vertex // if the curve is periodic and if the begin vertex is identical to the end vertex
// and if this vertex has only one model curve adjacent to it, then the vertex is // and if this vertex has only one model curve adjacent to it, then the vertex is
// not connecting any other curve. So, the mesh vertex and its associated geom vertex // not connecting any other curve. So, the mesh vertex and its associated geom vertex
// are not necessary at the same location // are not necessary at the same location
GPoint beg_p,end_p; GPoint beg_p,end_p;
if (ge->getBeginVertex() == ge->getEndVertex() && ge->getBeginVertex()->edges().size() == 1) if(ge->getBeginVertex() == ge->getEndVertex() &&
{ ge->getBeginVertex()->edges().size() == 1){
end_p=beg_p=ge->point(t_begin); end_p = beg_p = ge->point(t_begin);
}else{ }
beg_p=GPoint(v0->x(),v0->y(),v0->z()); else{
end_p=GPoint(v1->x(),v1->y(),v1->z()); beg_p = GPoint(v0->x(), v0->y(), v0->z());
} end_p = GPoint(v1->x(), v1->y(), v1->z());
}
int count = 1, NUMP = 1, NUMP2 = 1; int count = 1, NUMP = 1, NUMP2 = 1;
IntPoint P1, P2; IntPoint P1, P2;
...@@ -259,7 +260,7 @@ void meshGEdge::operator() (GEdge *ge) ...@@ -259,7 +260,7 @@ void meshGEdge::operator() (GEdge *ge)
// classified on this mesh edge) // classified on this mesh edge)
if(N > 1){ if(N > 1){
ge->mesh_vertices.resize(N - 2); ge->mesh_vertices.resize(N - 2);
GPoint last_p=beg_p; GPoint last_p = beg_p;
while(NUMP < N - 1) { while(NUMP < N - 1) {
List_Read(Points, count - 1, &P1); List_Read(Points, count - 1, &P1);
List_Read(Points, count, &P2); List_Read(Points, count, &P2);
...@@ -269,12 +270,19 @@ void meshGEdge::operator() (GEdge *ge) ...@@ -269,12 +270,19 @@ void meshGEdge::operator() (GEdge *ge)
double dp = P2.p - P1.p; double dp = P2.p - P1.p;
double t = P1.t + dt / dp * (d - P1.p); double t = P1.t + dt / dp * (d - P1.p);
GPoint V = ge->point(t); GPoint V = ge->point(t);
double lc=BGM_MeshSize(ge,t,0,V.x(),V.y(),V.z()); if(ge->meshAttributes.Method == TRANSFINI){
if(GPointDist(V,last_p)>0.7*lc && !(NUMP==N-2 && GPointDist(V,end_p)<0.7*lc)){ ge->mesh_vertices[NUMP2 - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t);
last_p=V; NUMP2++;
ge->mesh_vertices[NUMP2 - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t); }
NUMP2++; else{
} double lc = BGM_MeshSize(ge, t, 0, V.x(), V.y(), V.z());
if(GPointDist(V, last_p) > 0.7 * lc &&
!(NUMP == N - 2 && GPointDist(V, end_p) < 0.7 * lc)){
last_p = V;
ge->mesh_vertices[NUMP2 - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t);
NUMP2++;
}
}
NUMP++; NUMP++;
} }
else { else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment