Skip to content
Snippets Groups Projects
Commit ed598895 authored by Francois Henrotte's avatar Francois Henrotte
Browse files

add a gmsh option smoothCrossField

parent 6184877b
No related branches found
No related tags found
No related merge requests found
...@@ -348,18 +348,19 @@ void Filler::treat_region(GRegion* gr){ ...@@ -348,18 +348,19 @@ void Filler::treat_region(GRegion* gr){
Frame_field::init_region(gr); Frame_field::init_region(gr);
int NumSmooth = CTX::instance()->mesh.nbSmoothing; int NumSmooth = CTX::instance()->mesh.smoothCrossField;
int NumIter = 1; if(NumSmooth){
double eold; Frame_field::init(gr);
Frame_field::init(gr); Frame_field::save(gr,"cross_init.pos");
double enew = Frame_field::smooth(gr); double enew = Frame_field::smooth(gr);
if( NumSmooth >1){ int NumIter = 0;
double eold = 0;
do{ do{
std::cout << "Smoothing: energy(" << NumIter << ") = " << enew << std::endl; std::cout << "Smoothing: energy(" << NumIter << ") = " << enew << std::endl;
eold = enew; eold = enew;
enew = Frame_field::smooth(gr); enew = Frame_field::smooth(gr);
} while((eold > enew) && (NumIter++ < NumSmooth)); } while((eold > enew) && (NumIter++ < NumSmooth));
Frame_field::save(gr,"smoothed.pos"); Frame_field::save(gr,"cross_smooth.pos");
Frame_field::fillTreeVolume(gr); Frame_field::fillTreeVolume(gr);
} }
...@@ -474,7 +475,7 @@ void Filler::treat_region(GRegion* gr){ ...@@ -474,7 +475,7 @@ void Filler::treat_region(GRegion* gr){
Metric Filler::get_metric(double x,double y,double z){ Metric Filler::get_metric(double x,double y,double z){
Metric m; Metric m;
Matrix m2; Matrix m2;
if(CTX::instance()->mesh.nbSmoothing <= 1) if(CTX::instance()->mesh.smoothCrossField)
m2 = Frame_field::search(x,y,z); m2 = Frame_field::search(x,y,z);
else else
m2 = Frame_field::findNearestCross(x,y,z); m2 = Frame_field::findNearestCross(x,y,z);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment