Skip to content
Snippets Groups Projects
Commit c4ca5aec authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

*** empty log message ***

parent 898a6437
No related branches found
No related tags found
No related merge requests found
// $Id: BDS.cpp,v 1.93 2008-01-22 17:24:29 remacle Exp $ // $Id: BDS.cpp,v 1.94 2008-01-24 09:35:41 remacle Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -1342,7 +1342,7 @@ void optimize_vertex_position (GFace *GF, BDS_Point *data, double su, double sv) ...@@ -1342,7 +1342,7 @@ void optimize_vertex_position (GFace *GF, BDS_Point *data, double su, double sv)
} }
bool BDS_Mesh::smooth_point_centroid(BDS_Point * p, GFace *gf) bool BDS_Mesh::smooth_point_centroid(BDS_Point * p, GFace *gf, bool test_quality)
{ {
if (!p->config_modified)return false; if (!p->config_modified)return false;
...@@ -1392,6 +1392,9 @@ bool BDS_Mesh::smooth_point_centroid(BDS_Point * p, GFace *gf) ...@@ -1392,6 +1392,9 @@ bool BDS_Mesh::smooth_point_centroid(BDS_Point * p, GFace *gf)
it = ts.begin(); it = ts.begin();
double s1=0,s2=0; double s1=0,s2=0;
double newWorst = 1.0;
double oldWorst = 1.0;
while(it != ite) { while(it != ite) {
BDS_Face *t = *it; BDS_Face *t = *it;
BDS_Point *n[4]; BDS_Point *n[4];
...@@ -1407,17 +1410,16 @@ bool BDS_Mesh::smooth_point_centroid(BDS_Point * p, GFace *gf) ...@@ -1407,17 +1410,16 @@ bool BDS_Mesh::smooth_point_centroid(BDS_Point * p, GFace *gf)
// printf("%22.15E %22.15E\n",snew,sold); // printf("%22.15E %22.15E\n",snew,sold);
if ( snew < .1 * sold) return false; if ( snew < .1 * sold) return false;
// if (!test_move_point_parametric_triangle ( p, U, V, t)){ if (test_quality){
// return false; p->X = gp.x();
// } p->Y = gp.y();
// p->X = gp.x(); p->Z = gp.z();
// p->Y = gp.y(); newWorst = std::min(newWorst,qmTriangle(*it,QMTRI_RHO));
// p->Z = gp.z(); p->X = oldX;
// newWorst = std::min(newWorst,qmTriangle(*it,QMTRI_RHO)); p->Y = oldY;
// p->X = oldX; p->Z = oldZ;
// p->Y = oldY; oldWorst = std::min(oldWorst,qmTriangle(*it,QMTRI_RHO));
// p->Z = oldZ; }
// oldWorst = std::min(oldWorst,qmTriangle(*it,QMTRI_RHO));
++it; ++it;
} }
...@@ -1425,11 +1427,9 @@ bool BDS_Mesh::smooth_point_centroid(BDS_Point * p, GFace *gf) ...@@ -1425,11 +1427,9 @@ bool BDS_Mesh::smooth_point_centroid(BDS_Point * p, GFace *gf)
if (fabs(s2-s1) > 1.e-14 * (s2+s1))return false; if (fabs(s2-s1) > 1.e-14 * (s2+s1))return false;
// if (newWorst < 1.e-2) if (test_quality && newWorst < oldWorst){
// { return false;
// printf("chmoochiong %g %g\n",oldWorst,newWorst); }
// // return false;
// }
p->u = U; p->u = U;
p->v = V; p->v = V;
......
...@@ -463,7 +463,7 @@ public: ...@@ -463,7 +463,7 @@ public:
void snap_point(BDS_Point* , BDS_Mesh *geom = 0); void snap_point(BDS_Point* , BDS_Mesh *geom = 0);
bool smooth_point(BDS_Point* , BDS_Mesh *geom = 0); bool smooth_point(BDS_Point* , BDS_Mesh *geom = 0);
bool smooth_point_parametric(BDS_Point * p, GFace *gf); bool smooth_point_parametric(BDS_Point * p, GFace *gf);
bool smooth_point_centroid(BDS_Point * p, GFace *gf); bool smooth_point_centroid(BDS_Point * p, GFace *gf, bool test_quality = false);
bool move_point(BDS_Point *p , double X, double Y, double Z); bool move_point(BDS_Point *p , double X, double Y, double Z);
bool split_edge(BDS_Edge *, BDS_Point *); bool split_edge(BDS_Edge *, BDS_Point *);
void saturate_edge(BDS_Edge *, std::vector<BDS_Point *>&); void saturate_edge(BDS_Edge *, std::vector<BDS_Point *>&);
......
# $Id: Makefile,v 1.198 2008-01-23 07:45:28 geuzaine Exp $ # $Id: Makefile,v 1.199 2008-01-24 09:35:41 remacle Exp $
# #
# Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
# #
...@@ -39,6 +39,7 @@ SRC = Generator.cpp \ ...@@ -39,6 +39,7 @@ SRC = Generator.cpp \
meshGFace.cpp \ meshGFace.cpp \
meshGFaceTransfinite.cpp \ meshGFaceTransfinite.cpp \
meshGFaceExtruded.cpp \ meshGFaceExtruded.cpp \
meshGFaceBDS.cpp \
meshGFaceDelaunayInsertion.cpp \ meshGFaceDelaunayInsertion.cpp \
meshGFaceOptimize.cpp \ meshGFaceOptimize.cpp \
meshGRegion.cpp \ meshGRegion.cpp \
......
This diff is collapsed.
This diff is collapsed.
#ifndef _MESH_GFACEBDS_H_
#define _MESH_GFACEBDS_H_
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include <map>
class GFace;
class BDS_Mesh;
class BDS_Point;
class MVertex;
void computeMeshSizeFieldAccuracy (GFace *gf, BDS_Mesh &m, double &avg, double &max_e, double &min_e, int &nE, int &GS);
void computeElementShapes (GFace *gf, BDS_Mesh &m, double &worst, double &avg, double &best, int &nT, int &nbGQ);
void gmshRefineMeshBDS (GFace *gf,
BDS_Mesh &m,
const int NIT,
const bool computeNodalSizeField);
void gmshOptimizeMeshBDS(GFace *gf,
BDS_Mesh &m,
const int NIT,
std::map<BDS_Point*,MVertex*> *recover_map = 0);
void gmshDelaunayizeBDS ( GFace *gf, BDS_Mesh &m, int &nb_swap );
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment