diff --git a/Mesh/Field.cpp b/Mesh/Field.cpp index 39bc5d4967a11ec69e14ad982b7cc0799384e80c..f682470da5bc82e7e597ea41703ac69ff90c96cd 100644 --- a/Mesh/Field.cpp +++ b/Mesh/Field.cpp @@ -965,31 +965,8 @@ class PostViewField : public Field update_needed = false; } double l = 0.; - if(!octree->searchScalar(x, y, z, &l, 0)) { - // try really hard to find an element around the point - /* - double fact[4] = {1.e-6, 1.e-5, 1.e-4, 1.e-2}; - for(int i = 0; i < 4; i++){ - double eps = CTX.lc * fact[i]; - // 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, y + eps, z, &l, 0)) break; - if(octree->searchScalar(x, y - eps, z, &l, 0)) break; - if(octree->searchScalar(x, y, z + eps, &l, 0)) break; - if(octree->searchScalar(x, y, z - eps, &l, 0)) break; - if(octree->searchScalar(x + eps, y - eps, z - eps, &l, 0)) break; - if(octree->searchScalar(x + eps, y + eps, z - eps, &l, 0)) break; - if(octree->searchScalar(x - eps, y - eps, z - eps, &l, 0)) break; - if(octree->searchScalar(x - eps, y + eps, z - eps, &l, 0)) break; - if(octree->searchScalar(x + eps, y - eps, z + eps, &l, 0)) break; - if(octree->searchScalar(x + eps, y + eps, z + eps, &l, 0)) break; - 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(!octree->searchScalarWithTol(x, y, z, &l, 0, 0, 10.)) + Msg::Info("No element found containing point (%g,%g,%g)", x, y, z); if(l <= 0 && crop_negative_values) return MAX_LC; return l; } diff --git a/Post/OctreePost.cpp b/Post/OctreePost.cpp index a7731aa4afd831362d654e3ade6d22c6fc7f53d1..11a8e2d48a3aba5dd1158b40bdbb6262e56aaa7e 100644 --- a/Post/OctreePost.cpp +++ b/Post/OctreePost.cpp @@ -382,8 +382,8 @@ bool OctreePost::_getValue(void *in, int nbComp, double P[3], int timestep, return true; } -bool OctreePost::_searchScalar(double x, double y, double z, double *values, - int step, double *size) +bool OctreePost::searchScalar(double x, double y, double z, double *values, + int step, double *size) { double P[3] = {x, y, z}; @@ -413,20 +413,19 @@ bool OctreePost::_searchScalar(double x, double y, double z, double *values, return false; } -bool OctreePost::searchScalar(double x, double y, double z, double *values, - int step, double *size) +bool OctreePost::searchScalarWithTol(double x, double y, double z, double *values, + int step, double *size, double tol) { - bool a = _searchScalar(x, y, z, values, step, size); + bool a = searchScalar(x, y, z, values, step, size); if(!a){ - double oldeps1 = element::getTolerance(); - double oldeps2 = MElement::getTolerance(); - element::setTolerance(10.); - MElement::setTolerance(10.); - a = _searchScalar(x, y, z, values, step, size); - element::setTolerance(oldeps1); - MElement::setTolerance(oldeps2); + double oldtol1 = element::getTolerance(); + double oldtol2 = MElement::getTolerance(); + element::setTolerance(tol); + MElement::setTolerance(tol); + a = searchScalar(x, y, z, values, step, size); + element::setTolerance(oldtol1); + MElement::setTolerance(oldtol2); } - if (!a) Msg::Debug("No element found containing point (%g,%g,%g)", x, y, z); return a; } diff --git a/Post/OctreePost.h b/Post/OctreePost.h index bd6770d5173d13773db650905f5842e364c4c499..7c033c23c66f7a6b7477f1a2170ca2cfb9c8ab6d 100644 --- a/Post/OctreePost.h +++ b/Post/OctreePost.h @@ -30,8 +30,6 @@ class OctreePost double *elementSize); bool _getValue(void *in, int nbComp, double P[3], int step, double *values, double *elementSize); - bool _searchScalar(double x, double y, double z, double *values, - int step = -1, double *size = 0); public : OctreePost(PView *); ~OctreePost(); @@ -41,11 +39,13 @@ class OctreePost // interpolated unless time step is set to a different value than // -1. bool searchScalar(double x, double y, double z, double *values, - int step = -1, double *size = 0); + int step=-1, double *size=0); + bool searchScalarWithTol(double x, double y, double z, double *values, + int step=-1, double *size=0, double tol=1.e-2); bool searchVector(double x, double y, double z, double *values, - int step = -1, double *size = 0); + int step=-1, double *size=0); bool searchTensor(double x, double y, double z, double *values, - int step = -1, double *size = 0); + int step=-1, double *size=0); }; #endif diff --git a/doc/VERSIONS.txt b/doc/VERSIONS.txt index 0f456b4fe2fc5a4bfd6316c3f28eac73258c5309..4013f0972de5d95b3fd701fd8a2982ca35f23f3f 100644 --- a/doc/VERSIONS.txt +++ b/doc/VERSIONS.txt @@ -1,10 +1,11 @@ -$Id: VERSIONS.txt,v 1.31 2009-01-15 00:45:11 geuzaine Exp $ - -2.3.0 (?): major graphics and GUI code refactoring; new full-quad/hexa -subdivision algorithm (removed Mesh.RecombineAlgo); improved automatic -transfinite corner selection (now also for volumes); improved -visibility browser; modified arrow size, clipping planes and transform -options; many small improvements and bug fixes all over the place. +$Id: VERSIONS.txt,v 1.32 2009-01-23 07:32:54 geuzaine Exp $ + +2.3.0 (Jan 23, 2009): major graphics and GUI code refactoring; new +full-quad/hexa subdivision algorithm (removed Mesh.RecombineAlgo); +improved automatic transfinite corner selection (now also for +volumes); improved visibility browser; modified arrow size, clipping +planes and transform options; many small improvements and bug fixes +all over the place. 2.2.6 (Nov 21, 2008): better transfinite smoothing and automatic corner selection; fixed high order meshing crashes on Windows and diff --git a/doc/gmsh.html b/doc/gmsh.html index 4e13244bc5dc59a5abd55ba3361b5f130f94c983..f48bc5bea65d35279d40472874acc44a31fb8fad 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -25,7 +25,7 @@ generator with built-in pre- and post-processing facilities</h1> <p> <h3 align="center">Christophe Geuzaine and Jean-François Remacle</h3> <p> -<h3 align=center>Version 2.3.0, ?? 2008</h3> +<h3 align=center>Version 2.3.0, January 23 2009</h3> <p> <center> <a href="#Description">Description</a> |