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

*** empty log message ***

parent 224f4d23
No related branches found
No related tags found
No related merge requests found
...@@ -295,7 +295,7 @@ void *searchElement(octantBucket *_buckets_head, double *_pt, globalInfo *_globa ...@@ -295,7 +295,7 @@ void *searchElement(octantBucket *_buckets_head, double *_pt, globalInfo *_globa
ptrBucket = findElementBucket(_buckets_head, _pt); ptrBucket = findElementBucket(_buckets_head, _pt);
if (ptrBucket == NULL) { if (ptrBucket == NULL) {
// printf("Error! the point is not in the domain.\n"); printf("Error! the point is not in the domain.\n");
return NULL; return NULL;
} }
......
...@@ -320,8 +320,11 @@ bool reparamMeshVertexOnFace(const MVertex *v, const GFace *gf, SPoint2 &param) ...@@ -320,8 +320,11 @@ bool reparamMeshVertexOnFace(const MVertex *v, const GFace *gf, SPoint2 &param)
if(v->onWhat()->dim() == 0){ if(v->onWhat()->dim() == 0){
GVertex *gv = (GVertex*)v->onWhat(); GVertex *gv = (GVertex*)v->onWhat();
// hack for bug in periodic curves
if (gv->getNativeType() == GEntity::GmshModel && gf->geomType() == GEntity::Plane)
param = gf->parFromPoint(SPoint3(v->x(), v->y(), v->z()));
else
param = gv->reparamOnFace(gf, 1); param = gv->reparamOnFace(gf, 1);
// shout, we could be on a seam // shout, we could be on a seam
std::list<GEdge*> ed = gv->edges(); std::list<GEdge*> ed = gv->edges();
for(std::list<GEdge*>::iterator it = ed.begin(); it != ed.end(); it++) for(std::list<GEdge*>::iterator it = ed.begin(); it != ed.end(); it++)
......
...@@ -968,10 +968,10 @@ class PostViewField : public Field ...@@ -968,10 +968,10 @@ class PostViewField : public Field
if(!octree->searchScalar(x, y, z, &l, 0)) { if(!octree->searchScalar(x, y, z, &l, 0)) {
// try really hard to find an element around the point // try really hard to find an element around the point
/* /*
double fact[4] = {1.e-6, 1.e-5, 1.e-4, 1.e-3}; double fact[4] = {1.e-6, 1.e-5, 1.e-4, 1.e-2};
for(int i = 0; i < 4; i++){ for(int i = 0; i < 4; i++){
double eps = CTX.lc * fact[i]; double eps = CTX.lc * fact[i];
printf("approx search witg eps=%g\n", eps); // printf("approx search witg eps=%g\n", eps);
if(octree->searchScalar(x + eps, y, z, &l, 0)) break; if(octree->searchScalar(x + eps, y, z, &l, 0)) break;
if(octree->searchScalar(x - eps, y, z, &l, 0)) break; if(octree->searchScalar(x - eps, y, z, &l, 0)) break;
if(octree->searchScalar(x, y + eps, z, &l, 0)) break; if(octree->searchScalar(x, y + eps, z, &l, 0)) break;
...@@ -988,6 +988,7 @@ class PostViewField : public Field ...@@ -988,6 +988,7 @@ class PostViewField : public Field
if(octree->searchScalar(x - eps, y + eps, z + eps, &l, 0)) break; if(octree->searchScalar(x - eps, y + eps, z + eps, &l, 0)) break;
} }
*/ */
// printf("oops\n");
} }
if(l <= 0 && crop_negative_values) return MAX_LC; if(l <= 0 && crop_negative_values) return MAX_LC;
return l; return l;
......
...@@ -432,6 +432,7 @@ static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER, bool debug = true) ...@@ -432,6 +432,7 @@ static bool gmsh2DMeshGenerator(GFace *gf, int RECUR_ITER, bool debug = true)
reparamMeshVertexOnFace(here, gf, param); reparamMeshVertexOnFace(here, gf, param);
U_[count] = param[0]; U_[count] = param[0];
V_[count] = param[1]; V_[count] = param[1];
// printf("coucou : %g %g -> %g %g\n",here->x(),here->y(),param.x(),param.y());
(*itv)->setIndex(count); (*itv)->setIndex(count);
numbered_vertices[(*itv)->getIndex()] = *itv; numbered_vertices[(*itv)->getIndex()] = *itv;
bbox += SPoint3(param.x(), param.y(), 0); bbox += SPoint3(param.x(), param.y(), 0);
...@@ -1368,6 +1369,7 @@ void meshGFace::operator() (GFace *gf) ...@@ -1368,6 +1369,7 @@ void meshGFace::operator() (GFace *gf)
Msg::Debug("Generating the mesh"); Msg::Debug("Generating the mesh");
if(noseam(gf) || gf->getNativeType() == GEntity::GmshModel || gf->edgeLoops.empty()){ if(noseam(gf) || gf->getNativeType() == GEntity::GmshModel || gf->edgeLoops.empty()){
//gmsh2DMeshGeneratorPeriodic(gf, debugSurface >= 0 || debugSurface == -100);
gmsh2DMeshGenerator(gf, 0, debugSurface >= 0 || debugSurface == -100); gmsh2DMeshGenerator(gf, 0, debugSurface >= 0 || debugSurface == -100);
} }
else{ else{
......
...@@ -19,7 +19,7 @@ SRC = PView.cpp PViewIO.cpp\ ...@@ -19,7 +19,7 @@ SRC = PView.cpp PViewIO.cpp\
PViewDataList.cpp PViewDataListIO.cpp\ PViewDataList.cpp PViewDataListIO.cpp\
PViewDataGModel.cpp PViewDataGModelIO.cpp\ PViewDataGModel.cpp PViewDataGModelIO.cpp\
PViewOptions.cpp\ PViewOptions.cpp\
adaptiveData.cpp\ adaptiveData.cpp shapeFunctions.cpp\
OctreePost.cpp\ OctreePost.cpp\
ColorTable.cpp ColorTable.cpp
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
static void minmax(int n, double *X, double *Y, double *Z, static void minmax(int n, double *X, double *Y, double *Z,
double *min, double *max) double *min, double *max)
{ {
const double eps = 1.e-1;
min[0] = X[0]; min[0] = X[0];
min[1] = Y[0]; min[1] = Y[0];
min[2] = Z[0]; min[2] = Z[0];
...@@ -35,6 +36,15 @@ static void minmax(int n, double *X, double *Y, double *Z, ...@@ -35,6 +36,15 @@ static void minmax(int n, double *X, double *Y, double *Z,
max[1] = (Y[i] > max[1]) ? Y[i] : max[1]; max[1] = (Y[i] > max[1]) ? Y[i] : max[1];
max[2] = (Z[i] > max[2]) ? Z[i] : max[2]; max[2] = (Z[i] > max[2]) ? Z[i] : max[2];
} }
const double L = eps * sqrt ((min[0]-max[0])*(min[0]-max[0])+
(min[1]-max[1])*(min[1]-max[1])+
(min[2]-max[2])*(min[2]-max[2]));
min[0] -= L;
min[1] -= L;
min[2] -= L;
max[0] += L;
max[1] += L;
max[2] += L;
} }
static void centroid(int n, double *X, double *Y, double *Z, double *c) static void centroid(int n, double *X, double *Y, double *Z, double *c)
...@@ -385,6 +395,20 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep, ...@@ -385,6 +395,20 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep,
bool OctreePost::searchScalar(double x, double y, double z, double *values, bool OctreePost::searchScalar(double x, double y, double z, double *values,
int step, double *size) int step, double *size)
{
bool a = searchScalar_(x,y,z,values,step,size);
if (!a){
element::setTolerance(10.);
a = searchScalar_(x,y,z,values,step,size);
element::setTolerance(1.e-3);
}
if (!a)printf("cannot find %g %g %g\n",x,y,z);
return a;
}
bool OctreePost::searchScalar_(double x, double y, double z, double *values,
int step, double *size)
{ {
double P[3] = {x, y, z}; double P[3] = {x, y, z};
......
...@@ -30,6 +30,8 @@ class OctreePost ...@@ -30,6 +30,8 @@ class OctreePost
double *elementSize); double *elementSize);
bool _getValue(void *in, int nbComp, double P[3], int step, bool _getValue(void *in, int nbComp, double P[3], int step,
double *values, double *elementSize); double *values, double *elementSize);
bool searchScalar_(double x, double y, double z, double *values,
int step = -1, double *size = 0);
public : public :
OctreePost(PView *); OctreePost(PView *);
~OctreePost(); ~OctreePost();
......
...@@ -9,15 +9,21 @@ ...@@ -9,15 +9,21 @@
#include "Numeric.h" #include "Numeric.h"
#include "GmshMessage.h" #include "GmshMessage.h"
#define ONE (1. + 1.e-6)
#define ZERO (-1.e-6)
#define SQU(a) ((a)*(a)) #define SQU(a) ((a)*(a))
class element{ class element{
protected: protected:
double *_x, *_y, *_z; double *_x, *_y, *_z;
static double ONE, ZERO;
public: public:
element(double *x, double *y, double *z) : _x(x), _y(y), _z(z) {} element(double *x, double *y, double *z) : _x(x), _y(y), _z(z) {}
static void setTolerance (const double tol){
ONE = 1.+tol;
ZERO = -tol;
}
static double getTolerance () {
return -ZERO;
}
virtual ~element(){} virtual ~element(){}
virtual int getDimension() = 0; virtual int getDimension() = 0;
virtual int getNumNodes() = 0; virtual int getNumNodes() = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment