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

fix compile

parent 46901577
No related branches found
No related tags found
No related merge requests found
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include <math.h> #include <math.h>
#include <sys/time.h>
#include "SBoundingBox3d.h" #include "SBoundingBox3d.h"
#include "OS.h"
#include "delaunay3d_private.h" #include "delaunay3d_private.h"
#include "delaunay3d.h" #include "delaunay3d.h"
#include "MVertex.h" #include "MVertex.h"
...@@ -305,24 +305,7 @@ double walltime( double *t0 ) ...@@ -305,24 +305,7 @@ double walltime( double *t0 )
#ifdef _OPENMP #ifdef _OPENMP
return omp_get_wtime(); return omp_get_wtime();
#else #else
double mic, time; return GetTimeInSeconds();
double mega = 0.000001;
struct timeval tp;
struct timezone tzp;
static long base_sec = 0;
static long base_usec = 0;
(void) gettimeofday(&tp,&tzp);
if (base_sec == 0)
{
base_sec = tp.tv_sec;
base_usec = tp.tv_usec;
}
time = (double) (tp.tv_sec - base_sec);
mic = (double) (tp.tv_usec - base_usec);
time = (time + mic * mega) - *t0;
return(time);
#endif #endif
} }
...@@ -642,7 +625,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -642,7 +625,7 @@ void delaunayTrgl (const unsigned int numThreads,
#pragma omp barrier #pragma omp barrier
cavitySize[myThread] = 0; cavitySize[myThread] = 0;
std::vector<Tet*> t(NPTS_AT_ONCE); std::vector<Tet*> t(NPTS_AT_ONCE);
// clock_t c1 = clock(); // double c1 = Cpu();
for (unsigned int K=0; K< NPTS_AT_ONCE; K++) { for (unsigned int K=0; K< NPTS_AT_ONCE; K++) {
vToAdd[K] = iPGlob < locSizeK[K] ? &allocatedVerts[K][iPGlob] : NULL; vToAdd[K] = iPGlob < locSizeK[K] ? &allocatedVerts[K][iPGlob] : NULL;
if(vToAdd[K]){ if(vToAdd[K]){
...@@ -681,7 +664,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -681,7 +664,7 @@ void delaunayTrgl (const unsigned int numThreads,
} }
} }
} }
// clock_t c1 = clock(); // double c1 = Cpu();
for (unsigned int K=0; K< NPTS_AT_ONCE; K++) { for (unsigned int K=0; K< NPTS_AT_ONCE; K++) {
if(vToAdd[K]){ if(vToAdd[K]){
cavityContainer &cavityK = cavity[K]; cavityContainer &cavityK = cavity[K];
...@@ -719,7 +702,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -719,7 +702,7 @@ void delaunayTrgl (const unsigned int numThreads,
else ok[K] = canWeProcessCavity (cavity[K], myThread, K); else ok[K] = canWeProcessCavity (cavity[K], myThread, K);
} }
// clock_t ck = clock(); // double ck = Cpu();
// std::set<Tet*> touched; // std::set<Tet*> touched;
for (unsigned int K=0; K< NPTS_AT_ONCE; K++) { for (unsigned int K=0; K< NPTS_AT_ONCE; K++) {
if (ok[K]){ if (ok[K]){
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <algorithm> #include <algorithm>
#include <math.h> #include <math.h>
#include "GmshMessage.h" #include "GmshMessage.h"
#include "OS.h"
#include "SPoint3.h" #include "SPoint3.h"
#include "delaunay3d_private.h" #include "delaunay3d_private.h"
#include "delaunay3d.h" #include "delaunay3d.h"
...@@ -388,40 +389,38 @@ void edgeBasedRefinement (const int numThreads, ...@@ -388,40 +389,38 @@ void edgeBasedRefinement (const int numThreads,
Msg::Info("----------------------------------- SATUR FILTR SORTH DELNY TIME TETS"); Msg::Info("----------------------------------- SATUR FILTR SORTH DELNY TIME TETS");
clock_t __t__ = clock(); double __t__ = Cpu();
while(1){ while(1){
char name[256]; char name[256];
// sprintf(name,"beforeRefinement%d.pos",iter); // sprintf(name,"beforeRefinement%d.pos",iter);
// print (name,_tets); // print (name,_tets);
// printf("ITER %3d\n",iter); // printf("ITER %3d\n",iter);
std::vector<Vertex*> add; std::vector<Vertex*> add;
clock_t t1 = clock(); double t1 = Cpu();
saturateEdges (ec, _tets, numThreads, add, _fx, NULL); saturateEdges (ec, _tets, numThreads, add, _fx, NULL);
// printf("%d points to add\n",add.size()); // printf("%d points to add\n",add.size());
//sprintf(name,"Points%d.pos",iter); //sprintf(name,"Points%d.pos",iter);
// _print (name,add); // _print (name,add);
clock_t t2 = clock(); double t2 = Cpu();
filterVertices (numThreads, _filter, _vertices, add, _fx, NULL); filterVertices (numThreads, _filter, _vertices, add, _fx, NULL);
clock_t t3 = clock(); double t3 = Cpu();
if (add.empty())break; if (add.empty())break;
std::vector<int> indices; std::vector<int> indices;
SortHilbert(add, indices); SortHilbert(add, indices);
clock_t t4 = clock(); double t4 = Cpu();
// sprintf(name,"PointsFiltered%d.pos",iter); // sprintf(name,"PointsFiltered%d.pos",iter);
// _print (name,add); // _print (name,add);
delaunayTrgl (1,1,add.size(), _tets, &add); delaunayTrgl (1,1,add.size(), _tets, &add);
clock_t t5 = clock(); double t5 = Cpu();
Msg::Info("IT %3d %6d points added, timings %5.2f %5.2f %5.2f %5.2f %5.2f %5d",iter,add.size(), Msg::Info("IT %3d %6d points added, timings %5.2f %5.2f %5.2f %5.2f %5.2f %5d",iter,add.size(),
(float)(t2-t1)/CLOCKS_PER_SEC, (t2-t1),
(float)(t3-t2)/CLOCKS_PER_SEC, (t3-t2),
(float)(t4-t3)/CLOCKS_PER_SEC, (t4-t3),
(float)(t5-t4)/CLOCKS_PER_SEC, (t5-t4),
(float)(t5-__t__)/CLOCKS_PER_SEC, (t5-__t__),
_tets.size()); _tets.size());
iter++; iter++;
} }
print ("afterRefinement.pos",_tets); print ("afterRefinement.pos",_tets);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment