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

*** empty log message ***

parent e31af50c
No related branches found
No related tags found
No related merge requests found
// $Id: meshGFaceDelaunayInsertion.cpp,v 1.17 2008-03-26 09:37:49 remacle Exp $ // $Id: meshGFaceDelaunayInsertion.cpp,v 1.18 2008-03-26 10:33:37 remacle Exp $
// //
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// //
...@@ -461,7 +461,7 @@ bool insertVertex(GFace *gf, MVertex *v, double *param , MTri3 *t, ...@@ -461,7 +461,7 @@ bool insertVertex(GFace *gf, MVertex *v, double *param , MTri3 *t,
} }
void _printTris(char *name, std::set<MTri3*, compareTri3Ptr> &AllTris, void _printTris(char *name, std::set<MTri3*, compareTri3Ptr> &AllTris,
std::vector<double> &Us, std::vector<double> &Vs) std::vector<double> &Us, std::vector<double> &Vs, bool param=true)
{ {
FILE *ff = fopen (name,"w"); FILE *ff = fopen (name,"w");
fprintf(ff,"View\"test\"{\n"); fprintf(ff,"View\"test\"{\n");
...@@ -469,6 +469,7 @@ void _printTris(char *name, std::set<MTri3*, compareTri3Ptr> &AllTris, ...@@ -469,6 +469,7 @@ void _printTris(char *name, std::set<MTri3*, compareTri3Ptr> &AllTris,
while (it != AllTris.end() ){ while (it != AllTris.end() ){
MTri3 *worst = *it; MTri3 *worst = *it;
if (!worst->isDeleted()){ if (!worst->isDeleted()){
if (param)
fprintf(ff,"ST(%g,%g,%g,%g,%g,%g,%g,%g,%g) {0,0,0};\n", fprintf(ff,"ST(%g,%g,%g,%g,%g,%g,%g,%g,%g) {0,0,0};\n",
Us [(worst)->tri()->getVertex(0)->getNum()], Us [(worst)->tri()->getVertex(0)->getNum()],
Vs [(worst)->tri()->getVertex(0)->getNum()], Vs [(worst)->tri()->getVertex(0)->getNum()],
...@@ -479,6 +480,21 @@ void _printTris(char *name, std::set<MTri3*, compareTri3Ptr> &AllTris, ...@@ -479,6 +480,21 @@ void _printTris(char *name, std::set<MTri3*, compareTri3Ptr> &AllTris,
Us [(worst)->tri()->getVertex(2)->getNum()], Us [(worst)->tri()->getVertex(2)->getNum()],
Vs [(worst)->tri()->getVertex(2)->getNum()], Vs [(worst)->tri()->getVertex(2)->getNum()],
0.0); 0.0);
else
fprintf(ff,"ST(%g,%g,%g,%g,%g,%g,%g,%g,%g) {%g,%g,%g};\n",
(worst)->tri()->getVertex(0)->x(),
(worst)->tri()->getVertex(0)->y(),
(worst)->tri()->getVertex(0)->z(),
(worst)->tri()->getVertex(1)->x(),
(worst)->tri()->getVertex(1)->y(),
(worst)->tri()->getVertex(1)->z(),
(worst)->tri()->getVertex(2)->x(),
(worst)->tri()->getVertex(2)->y(),
(worst)->tri()->getVertex(2)->z(),
(worst)->getRadius(),
(worst)->getRadius(),
(worst)->getRadius()
);
} }
++it; ++it;
} }
...@@ -699,7 +715,6 @@ void gmshBowyerWatsonFrontal(GFace *gf){ ...@@ -699,7 +715,6 @@ void gmshBowyerWatsonFrontal(GFace *gf){
// we try to find a point that would produce a perfect triangle while // we try to find a point that would produce a perfect triangle while
// connecting the 2 points of the active edge // connecting the 2 points of the active edge
double dir[2] = {center[0]-midpoint[0],center[1]-midpoint[1]}; double dir[2] = {center[0]-midpoint[0],center[1]-midpoint[1]};
double q = sqrt(dir[0]*dir[0]+dir[1]*dir[1]); double q = sqrt(dir[0]*dir[0]+dir[1]*dir[1]);
dir[0]/=q; dir[0]/=q;
...@@ -708,9 +723,12 @@ void gmshBowyerWatsonFrontal(GFace *gf){ ...@@ -708,9 +723,12 @@ void gmshBowyerWatsonFrontal(GFace *gf){
2*dir[1]*dir[0]*metric[1]+ 2*dir[1]*dir[0]*metric[1]+
dir[1]*dir[1]*metric[2]); dir[1]*dir[1]*metric[2]);
const double p = 0.5*sqrt(DSQR(P[0]-Q[0])+DSQR(P[1]-Q[1]));//length_metric (P,Q,metric); // printf("ratio = %12.5E %g %g %g\n",RATIO,metric[0],metric[1],metric[2]);
const double p = 0.5*length_metric (P,Q,metric) / RATIO;
// const double p = 0.5*sqrt(DSQR(P[0]-Q[0])+DSQR(P[1]-Q[1]));//length_metric (P,Q,metric);
// const double q = length_metric (center,midpoint,metric); // const double q = length_metric (center,midpoint,metric);
const double rhoM = 0.5 * (vSizes[base->getVertex(ip1)->getNum()] + vSizes[base->getVertex(ip2)->getNum()] ) / sqrt(3) / RATIO; const double rhoM = 0.5 * (vSizes[base->getVertex(ip1)->getNum()] + vSizes[base->getVertex(ip2)->getNum()] ) / sqrt(3) * RATIO;
// printf("%g vs %g\n",2*p,rhoM); // printf("%g vs %g\n",2*p,rhoM);
...@@ -728,7 +746,9 @@ void gmshBowyerWatsonFrontal(GFace *gf){ ...@@ -728,7 +746,9 @@ void gmshBowyerWatsonFrontal(GFace *gf){
// char name[245]; // char name[245];
// sprintf(name,"pt%d.pos",ITER++); // sprintf(name,"pt%d.pos",ITER++);
// _printTris (name, AllTris, Us,Vs,false);
insertAPoint(gf,it,newPoint,metric,Us,Vs,vSizes,vSizesBGM,AllTris); insertAPoint(gf,it,newPoint,metric,Us,Vs,vSizes,vSizesBGM,AllTris);
// if (ITER++ == 5)break;
} }
_printTris ("frontal.pos", AllTris, Us,Vs); _printTris ("frontal.pos", AllTris, Us,Vs);
transferDataStructure(gf, AllTris); transferDataStructure(gf, AllTris);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment