Skip to content
Snippets Groups Projects
Commit 6fbc222d authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

better curvilinear coordinate computation

parent 60a6601f
No related branches found
No related tags found
No related merge requests found
......@@ -35,19 +35,31 @@ static void statistics_histogram_cb(Fl_Widget *w, void *data)
std::vector<double> x, y;
if(name == "Gamma2D"){
for(int i = 0; i < 100; i++) y.push_back(FlGui::instance()->stats->quality[0][i]);
for(int i = 0; i < 100; i++){
x.push_back((double)i / 99);
y.push_back(FlGui::instance()->stats->quality[0][i]);
}
new PView("Gamma", "# Elements", x, y);
}
else if(name == "Eta2D"){
for(int i = 0; i < 100; i++) y.push_back(FlGui::instance()->stats->quality[1][i]);
for(int i = 0; i < 100; i++){
x.push_back((double)i / 99);
y.push_back(FlGui::instance()->stats->quality[1][i]);
}
new PView("Eta", "# Elements", x, y);
}
else if(name == "Rho2D"){
for(int i = 0; i < 100; i++) y.push_back(FlGui::instance()->stats->quality[2][i]);
for(int i = 0; i < 100; i++){
x.push_back((double)i / 99);
y.push_back(FlGui::instance()->stats->quality[2][i]);
}
new PView("Rho", "# Elements", x, y);
}
else if(name == "Disto2D"){
for(int i = 0; i < 100; i++) y.push_back(FlGui::instance()->stats->quality[3][i]);
for(int i = 0; i < 100; i++){
x.push_back((double)i / 99);
y.push_back(FlGui::instance()->stats->quality[3][i]);
}
new PView("Disto", "# Elements", x, y);
}
else{
......
......@@ -117,13 +117,15 @@ static bool getGraphData(PView *p, std::vector<double> &x, double &xmin,
y[0].push_back(vy);
}
else if(opt->type == PViewOptions::Plot2DSpace){
// store offset to origin + distance to first point
// compute curvilinear coordinate
if(x.empty()){
p0 = SPoint3(xyz[0], xyz[1], xyz[2]);
x.push_back(ComputeScalarRep(3, xyz));
}
else{
x.push_back(x[0] + p0.distance(SPoint3(xyz[0], xyz[1], xyz[2])));
SPoint3 p1(xyz[0], xyz[1], xyz[2]);
x.push_back(x.back() + p0.distance(p1));
p0 = p1;
}
y[0].push_back(vy);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment