diff --git a/Mesh/directions3D.cpp b/Mesh/directions3D.cpp index 78c7cdd7cf869e573039a519fe4408b5f417194a..aa29df87179a94f344c55ec5d243d39145ec5ef9 100644 --- a/Mesh/directions3D.cpp +++ b/Mesh/directions3D.cpp @@ -420,6 +420,7 @@ void Frame_field::init(GRegion* gr){ //Recombinator crossData; crossData.build_vertex_to_vertices(gr); + std::cout << "Nb Vertices in crossData" << crossData.vertex_to_vertices.size() << std::endl; for(std::map<MVertex*, std::set<MVertex*> >::const_iterator iter = crossData.vertex_to_vertices.begin(); iter != crossData.vertex_to_vertices.end(); ++iter){ @@ -520,8 +521,6 @@ double Frame_field::smooth(GRegion* gr){ crossField[itA->first] = m; enew = findBarycenter(iter, m); } while ((enew < eold) && (++NbIter < 10)); - // if(NbIter > 2) - // std::cout << "This should not happen =" << NbIter << std::endl; energy += eold; } } @@ -582,7 +581,7 @@ void Frame_field::save(GRegion* gr, const std::string& filename){ void Frame_field::fillTreeVolume(GRegion* gr){ #if defined(HAVE_ANN) int n = crossData.vertex_to_vertices.size(); - std::cout << "Fillin ANN tree with " << n << " vertices" << std::endl; + std::cout << "Filling ANN tree with " << n << " vertices" << std::endl; annTreeData = annAllocPts(n,3); int index=0; for(std::map<MVertex*, std::set<MVertex*> >::iterator iter = crossData.vertex_to_vertices.begin(); @@ -608,10 +607,10 @@ Matrix Frame_field::findNearestCross(double x,double y,double z){ double e = 0.0; annTree->annkSearch(query,1,indices,distances,e); annDeallocPt(query); - delete[] indices; - delete[] distances; std::map<int, Matrix>::const_iterator it = crossField.find(vertIndices[indices[0]]); //annTreeData[indices[0]] gives the coordinates + delete[] indices; + delete[] distances; return it->second; #else return Matrix(); diff --git a/Mesh/simple3D.cpp b/Mesh/simple3D.cpp index 25390cba6d6dbed42d5e198279e88e4706af0dbf..cb740a7c26a1fc0f45b0a4a0693357c2b17ef3c7 100644 --- a/Mesh/simple3D.cpp +++ b/Mesh/simple3D.cpp @@ -347,7 +347,12 @@ void Filler::treat_region(GRegion* gr){ RTree<Node*,double,3,double> rtree; Frame_field::init_region(gr); + Frame_field::init(gr); std::cout << "Smoothing: energy = " << Frame_field::smooth(gr) << std::endl; + std::cout << "Smoothing: energy = " << Frame_field::smooth(gr) << std::endl; + std::cout << "Smoothing: energy = " << Frame_field::smooth(gr) << std::endl; + Frame_field::fillTreeVolume(gr); + Size_field::init_region(gr); Size_field::solve(gr); octree = new MElementOctree(gr->model()); @@ -460,7 +465,8 @@ Metric Filler::get_metric(double x,double y,double z){ Metric m; Matrix m2; - m2 = Frame_field::search(x,y,z); + //m2 = Frame_field::search(x,y,z); + m2 = Frame_field::findNearestCross(x,y,z); m.set_m11(m2.get_m11()); m.set_m21(m2.get_m21());