diff --git a/Mesh/directions3D.cpp b/Mesh/directions3D.cpp index a1c40b1fc8aaad21f3f18da55476b1a1b7ebc8e5..2b869e864deeaa8dde436ca2272facd4cda71617 100644 --- a/Mesh/directions3D.cpp +++ b/Mesh/directions3D.cpp @@ -420,7 +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; + std::cout << "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){ diff --git a/Mesh/simple3D.cpp b/Mesh/simple3D.cpp index 5f22feb7dee9a87571cb7e97ad9974cb47296dc1..c17f71e570c87eed1fb160d7777916d6c34a24c0 100644 --- a/Mesh/simple3D.cpp +++ b/Mesh/simple3D.cpp @@ -348,14 +348,20 @@ void Filler::treat_region(GRegion* gr){ Frame_field::init_region(gr); + int NumSmooth = CTX::instance()->mesh.nbSmoothing; + int NumIter = 0; + double eold; 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; - std::cout << "Smoothing: energy = " << Frame_field::smooth(gr) << std::endl; - std::cout << "Smoothing: energy = " << Frame_field::smooth(gr) << std::endl; - Frame_field::save(gr,"smoothed.pos"); - Frame_field::fillTreeVolume(gr); + double enew = Frame_field::smooth(gr); + if( NumSmooth >1){ + do{ + std::cout << "Smoothing: energy(" << NumIter << ") = " << enew << std::endl; + eold = enew; + enew = Frame_field::smooth(gr); + } while((eold > enew) && (NumIter++ < NumSmooth)); + Frame_field::save(gr,"smoothed.pos"); + Frame_field::fillTreeVolume(gr); + } Size_field::init_region(gr); Size_field::solve(gr); @@ -468,7 +474,7 @@ void Filler::treat_region(GRegion* gr){ Metric Filler::get_metric(double x,double y,double z){ Metric m; Matrix m2; - if(1) + if(CTX::instance()->mesh.nbSmoothing <= 1) m2 = Frame_field::search(x,y,z); else m2 = Frame_field::findNearestCross(x,y,z);