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

fix win compile

parent 4bae541e
No related branches found
No related tags found
No related merge requests found
...@@ -655,7 +655,6 @@ void drawContext::initPosition() ...@@ -655,7 +655,6 @@ void drawContext::initPosition()
{ {
glScaled(s[0], s[1], s[2]); glScaled(s[0], s[1], s[2]);
glTranslated(t[0], t[1], t[2]); glTranslated(t[0], t[1], t[2]);
if(CTX::instance()->rotationCenterCg) if(CTX::instance()->rotationCenterCg)
glTranslated(CTX::instance()->cg[0], glTranslated(CTX::instance()->cg[0],
CTX::instance()->cg[1], CTX::instance()->cg[1],
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include "GmshMessage.h" #include "GmshMessage.h"
#include "OS.h"
#include "robustPredicates.h" #include "robustPredicates.h"
#include "BackgroundMesh.h" #include "BackgroundMesh.h"
#include "meshGFaceDelaunayInsertion.h" #include "meshGFaceDelaunayInsertion.h"
...@@ -649,11 +650,11 @@ bool insertVertexB (std::list<edgeXface> &shell, ...@@ -649,11 +650,11 @@ bool insertVertexB (std::list<edgeXface> &shell,
if (fabs(oldVolume - newVolume) < 1.e-12 * oldVolume && !onePointIsTooClose){ if (fabs(oldVolume - newVolume) < 1.e-12 * oldVolume && !onePointIsTooClose){
connectTris_vector(new_cavity.begin(), new_cavity.end()); connectTris_vector(new_cavity.begin(), new_cavity.end());
// printf("%d %d\n",shell.size(),cavity.size()); // printf("%d %d\n",shell.size(),cavity.size());
clock_t t1 = clock(); double t1 = Cpu();
// 30 % of the time is spent here !!! // 30 % of the time is spent here !!!
allTets.insert(newTris, newTris + shell.size()); allTets.insert(newTris, newTris + shell.size());
// clock_t t2 = clock(); // double t2 = Cpu();
__DT2 += (double)(clock()-t1)/CLOCKS_PER_SEC; __DT2 += Cpu()-t1;
if (activeTets){ if (activeTets){
for (std::list<MTri3*>::iterator i = new_cavity.begin(); i != new_cavity.end(); ++i){ for (std::list<MTri3*>::iterator i = new_cavity.begin(); i != new_cavity.end(); ++i){
int active_edge; int active_edge;
...@@ -686,8 +687,8 @@ bool insertVertexB (std::list<edgeXface> &shell, ...@@ -686,8 +687,8 @@ bool insertVertexB (std::list<edgeXface> &shell,
for (unsigned int i = 0; i < shell.size(); i++) delete newTris[i]; for (unsigned int i = 0; i < shell.size(); i++) delete newTris[i];
delete [] newTris; delete [] newTris;
// throw; // throw;
// clock_t t2 = clock(); // double t2 = Cpu();
// DT_INSERT_VERTEX += (double)(t2-t1)/CLOCKS_PER_SEC; // DT_INSERT_VERTEX += t2-t1;
return false; return false;
} }
} }
...@@ -810,9 +811,9 @@ static bool insertAPoint(GFace *gf, std::set<MTri3*,compareTri3Ptr>::iterator it ...@@ -810,9 +811,9 @@ static bool insertAPoint(GFace *gf, std::set<MTri3*,compareTri3Ptr>::iterator it
// if the point is able to break the bad triangle "worst" // if the point is able to break the bad triangle "worst"
if (1){ if (1){
if (inCircumCircleAniso(gf, worst->tri(), center, metric, Us, Vs)){ if (inCircumCircleAniso(gf, worst->tri(), center, metric, Us, Vs)){
// clock_t t1 = clock(); // double t1 = Cpu();
recurFindCavityAniso(gf, shell, cavity, metric, center, worst, Us, Vs); recurFindCavityAniso(gf, shell, cavity, metric, center, worst, Us, Vs);
// __DT1 += (double) (clock() - t1)/CLOCKS_PER_SEC ; // __DT1 += Cpu() - t1 ;
for (std::list<MTri3*>::iterator itc = cavity.begin(); itc != cavity.end(); ++itc){ for (std::list<MTri3*>::iterator itc = cavity.begin(); itc != cavity.end(); ++itc){
if (invMapUV((*itc)->tri(), center, Us, Vs, uv, 1.e-8)) { if (invMapUV((*itc)->tri(), center, Us, Vs, uv, 1.e-8)) {
ptin = *itc; ptin = *itc;
...@@ -854,7 +855,7 @@ static bool insertAPoint(GFace *gf, std::set<MTri3*,compareTri3Ptr>::iterator it ...@@ -854,7 +855,7 @@ static bool insertAPoint(GFace *gf, std::set<MTri3*,compareTri3Ptr>::iterator it
Vs.push_back(center[1]); Vs.push_back(center[1]);
// clock_t t1 = clock(); // double t1 = Cpu();
if(!p.succeeded() || !insertVertexB if(!p.succeeded() || !insertVertexB
(shell, cavity,false, gf, v, center, ptin, AllTris,ActiveTris, vSizes, vSizesBGM,vMetricsBGM, (shell, cavity,false, gf, v, center, ptin, AllTris,ActiveTris, vSizes, vSizesBGM,vMetricsBGM,
...@@ -872,8 +873,8 @@ static bool insertAPoint(GFace *gf, std::set<MTri3*,compareTri3Ptr>::iterator it ...@@ -872,8 +873,8 @@ static bool insertAPoint(GFace *gf, std::set<MTri3*,compareTri3Ptr>::iterator it
} }
else { else {
// printf("done ! %d\n",AllTris.size()); // printf("done ! %d\n",AllTris.size());
// clock_t t2 = clock(); // double t2 = Cpu();
// DT_INSERT_VERTEX += (double)(t2-t1)/CLOCKS_PER_SEC; // DT_INSERT_VERTEX += (t2-t1);
gf->mesh_vertices.push_back(v); gf->mesh_vertices.push_back(v);
return true; return true;
} }
...@@ -926,19 +927,19 @@ void bowyerWatson(GFace *gf, int MAXPNT) ...@@ -926,19 +927,19 @@ void bowyerWatson(GFace *gf, int MAXPNT)
// } // }
MTri3 *worst = *AllTris.begin(); MTri3 *worst = *AllTris.begin();
if (worst->isDeleted()){ if (worst->isDeleted()){
// clock_t t1 = clock(); // double t1 = Cpu();
delete worst->tri(); delete worst->tri();
delete worst; delete worst;
AllTris.erase(AllTris.begin()); AllTris.erase(AllTris.begin());
NBDELETED ++; NBDELETED ++;
// DT1 += (double) (clock() - t1)/CLOCKS_PER_SEC ; // DT1 += (Cpu() - t1);
} }
else{ else{
// clock_t t2 = clock(); // double t2 = Cpu();
if(ITER++ % 5000 == 0){ if(ITER++ % 5000 == 0){
Msg::Debug("%7d points created -- Worst tri radius is %8.3f", Msg::Debug("%7d points created -- Worst tri radius is %8.3f",
vSizes.size(), worst->getRadius()); vSizes.size(), worst->getRadius());
printf("%d %d %d\n",vSizes.size(), AllTris.size(),NBDELETED); //printf("%d %d %d\n",vSizes.size(), AllTris.size(),NBDELETED);
} }
double center[2],metric[3],r2; double center[2],metric[3],r2;
if (worst->getRadius() < /*1.333333/(sqrt(3.0))*/0.5 * sqrt(2.0) || if (worst->getRadius() < /*1.333333/(sqrt(3.0))*/0.5 * sqrt(2.0) ||
...@@ -953,15 +954,15 @@ void bowyerWatson(GFace *gf, int MAXPNT) ...@@ -953,15 +954,15 @@ void bowyerWatson(GFace *gf, int MAXPNT)
Vs[base->getVertex(2)->getIndex()]) / 3.}; Vs[base->getVertex(2)->getIndex()]) / 3.};
buildMetric(gf, pa, metric); buildMetric(gf, pa, metric);
circumCenterMetric(worst->tri(), metric, Us, Vs, center, r2); circumCenterMetric(worst->tri(), metric, Us, Vs, center, r2);
// DT2 += (double) (clock() - t2)/CLOCKS_PER_SEC ; // DT2 += (Cpu() - t2) ;
// clock_t t3 = clock() ; // double t3 = Cpu() ;
insertAPoint(gf, AllTris.begin(), center, metric, Us, Vs, vSizes, insertAPoint(gf, AllTris.begin(), center, metric, Us, Vs, vSizes,
vSizesBGM, vMetricsBGM, AllTris); vSizesBGM, vMetricsBGM, AllTris);
// DT3 += (double) (clock() - t3)/CLOCKS_PER_SEC ; // DT3 += (Cpu() - t3) ;
} }
} }
// printf("%12.5E %12.5E %12.5E %12.5E %12.5E\n",DT1,DT2,DT3,__DT1,__DT2); // printf("%12.5E %12.5E %12.5E %12.5E %12.5E\n",DT1,DT2,DT3,__DT1,__DT2);
printf("%12.5E \n",__DT2); //printf("%12.5E \n",__DT2);
#if defined(HAVE_ANN) #if defined(HAVE_ANN)
{ {
FieldManager *fields = gf->model()->getFields(); FieldManager *fields = gf->model()->getFields();
...@@ -1705,7 +1706,7 @@ void bowyerWatsonParallelograms(GFace *gf) ...@@ -1705,7 +1706,7 @@ void bowyerWatsonParallelograms(GFace *gf)
N_GLOBAL_SEARCH = 0; N_GLOBAL_SEARCH = 0;
N_SEARCH = 0; N_SEARCH = 0;
DT_INSERT_VERTEX = 0; DT_INSERT_VERTEX = 0;
//clock_t t1 = clock(); // double t1 = Cpu();
MTri3 *oneNewTriangle = 0; MTri3 *oneNewTriangle = 0;
for (unsigned int i=0;i<packed.size();){ for (unsigned int i=0;i<packed.size();){
MTri3 *worst = *AllTris.begin(); MTri3 *worst = *AllTris.begin();
...@@ -1746,9 +1747,9 @@ void bowyerWatsonParallelograms(GFace *gf) ...@@ -1746,9 +1747,9 @@ void bowyerWatsonParallelograms(GFace *gf)
} }
printf("%d vertices \n",packed.size()); printf("%d vertices \n", (int)packed.size());
//clock_t t2 = clock(); // double t2 = Cpu();
//double DT = (double)(t2-t1)/CLOCKS_PER_SEC; //double DT = (t2-t1);
//if (packed.size())printf("points inserted DT %12.5E points per minut : %12.5E %d global searchs %d seachs per insertion\n",DT,60.*packed.size()/DT,N_GLOBAL_SEARCH,N_SEARCH / packed.size()); //if (packed.size())printf("points inserted DT %12.5E points per minut : %12.5E %d global searchs %d seachs per insertion\n",DT,60.*packed.size()/DT,N_GLOBAL_SEARCH,N_SEARCH / packed.size());
transferDataStructure(gf, AllTris, Us, Vs); transferDataStructure(gf, AllTris, Us, Vs);
backgroundMesh::unset(); backgroundMesh::unset();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment