Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
e59a6b47
Commit
e59a6b47
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
9a59b7f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Fltk/statisticsWindow.cpp
+33
-30
33 additions, 30 deletions
Fltk/statisticsWindow.cpp
with
33 additions
and
30 deletions
Fltk/statisticsWindow.cpp
+
33
−
30
View file @
e59a6b47
...
@@ -187,7 +187,8 @@ statisticsWindow::statisticsWindow(int deltaFontSize)
...
@@ -187,7 +187,8 @@ statisticsWindow::statisticsWindow(int deltaFontSize)
void
statisticsWindow
::
compute
(
bool
elementQuality
)
void
statisticsWindow
::
compute
(
bool
elementQuality
)
{
{
//emi hack - MINIMUM ANGLES
#if 0
// MINIMUM ANGLES
double minAngle = 120.0;
double minAngle = 120.0;
double meanAngle = 0.0;
double meanAngle = 0.0;
int count = 0;
int count = 0;
...
@@ -206,16 +207,14 @@ void statisticsWindow::compute(bool elementQuality)
...
@@ -206,16 +207,14 @@ void statisticsWindow::compute(bool elementQuality)
}
}
meanAngle = meanAngle / count;
meanAngle = meanAngle / count;
printf("Angles = min=%g av=%g \n", minAngle, meanAngle);
printf("Angles = min=%g av=%g \n", minAngle, meanAngle);
// Emi hack - MESH DEGREE VERTICES
//
std::vector<GEntity*> entities;
//
MESH DEGREE VERTICES
std::set<MEdge, Less_Edge> edges;
std::set<MEdge, Less_Edge> edges;
GModel::current()->getEntities(entities);
GModel::current()->getEntities(entities);
std::map<MVertex*, int > vert2Deg;
std::map<MVertex*, int > vert2Deg;
for(unsigned int i = 0; i < entities.size(); i++){
for(unsigned int i = 0; i < entities.size(); i++){
// printf("entity dim =%d tag=%d \n", entities[i]->dim() , entities[i]->tag());
if(entities[i]->dim() < 2 ) continue;
if(entities[i]->dim() < 2 ) continue;
if(entities[i]->tag() < 100) continue;
if(entities[i]->tag() < 100) continue;
// printf("continuing \n");
for(unsigned int j = 0; j < entities[i]->getNumMeshElements(); j++){
for(unsigned int j = 0; j < entities[i]->getNumMeshElements(); j++){
MElement *e = entities[i]->getMeshElement(j);
MElement *e = entities[i]->getMeshElement(j);
for(unsigned int k = 0; k < e->getNumEdges(); k++){
for(unsigned int k = 0; k < e->getNumEdges(); k++){
...
@@ -248,7 +247,8 @@ void statisticsWindow::compute(bool elementQuality)
...
@@ -248,7 +247,8 @@ void statisticsWindow::compute(bool elementQuality)
if (nbE == 4) d4 += 1;
if (nbE == 4) d4 += 1;
}
}
if (nbElems > 0)
if (nbElems > 0)
printf
(
"Stats degree vertices: dMin=%d , dMax=%d, d4=%g
\n
"
,
dMin
,
dMax
,
(
double
)
d4
/
nbElems
);
printf("Stats degree vertices: dMin=%d , dMax=%d, d4=%g \n",
dMin, dMax, (double)d4/nbElems);
FieldManager *fields = GModel::current()->getFields();
FieldManager *fields = GModel::current()->getFields();
Field *f = fields->get(fields->background_field);
Field *f = fields->get(fields->background_field);
...
@@ -269,7 +269,8 @@ void statisticsWindow::compute(bool elementQuality)
...
@@ -269,7 +269,8 @@ void statisticsWindow::compute(bool elementQuality)
double l = sqrt((v0->x()-v1->x())*(v0->x()-v1->x())+
double l = sqrt((v0->x()-v1->x())*(v0->x()-v1->x())+
(v0->y()-v1->y())*(v0->y()-v1->y())+
(v0->y()-v1->y())*(v0->y()-v1->y())+
(v0->z()-v1->z())*(v0->z()-v1->z()));
(v0->z()-v1->z())*(v0->z()-v1->z()));
double
lf
=
(
*
f
)(
0.5
*
(
v0
->
x
()
+
v1
->
x
()),
0.5
*
(
v0
->
y
()
+
v1
->
y
()),
0.5
*
(
v0
->
z
()
+
v1
->
z
()),
v0
->
onWhat
());
double lf = (*f)(0.5*(v0->x()+v1->x()), 0.5*(v0->y()+v1->y()),
0.5*(v0->z()+v1->z()),v0->onWhat());
double el = l/lf;
double el = l/lf;
int index = (int) ceil(el*nbS*0.5);
int index = (int) ceil(el*nbS*0.5);
qualE[index]+= 1;
qualE[index]+= 1;
...
@@ -287,8 +288,7 @@ void statisticsWindow::compute(bool elementQuality)
...
@@ -287,8 +288,7 @@ void statisticsWindow::compute(bool elementQuality)
}
}
fclose(fp);
fclose(fp);
//Emi hack - MESH DEGREE VERTICES
#if 0
std::vector<GEntity*> entities;
std::vector<GEntity*> entities;
std::set<MEdge, Less_Edge> edges;
std::set<MEdge, Less_Edge> edges;
GModel::current()->getEntities(entities);
GModel::current()->getEntities(entities);
...
@@ -327,7 +327,8 @@ void statisticsWindow::compute(bool elementQuality)
...
@@ -327,7 +327,8 @@ void statisticsWindow::compute(bool elementQuality)
dMax = std::max(nbE, dMax);
dMax = std::max(nbE, dMax);
if (nbE == 4) d4 += 1;
if (nbE == 4) d4 += 1;
}
}
if (nbElems > 0) printf("Stats degree vertices: dMin=%d , dMax=%d, d4=%g \n", dMin, dMax, (double)d4/nbElems);
if (nbElems > 0) printf("Stats degree vertices: dMin=%d , dMax=%d, d4=%g \n",
dMin, dMax, (double)d4/nbElems);
FieldManager *fields = GModel::current()->getFields();
FieldManager *fields = GModel::current()->getFields();
Field *f = fields->get(fields->background_field);
Field *f = fields->get(fields->background_field);
int nbEdges = edges.size();
int nbEdges = edges.size();
...
@@ -337,29 +338,31 @@ void statisticsWindow::compute(bool elementQuality)
...
@@ -337,29 +338,31 @@ void statisticsWindow::compute(bool elementQuality)
int nbS = 50;
int nbS = 50;
qualE.resize(nbS);
qualE.resize(nbS);
if(fields->background_field > 0){
if(fields->background_field > 0){
std::set<MEdge, Less_Edge>::iterator it = edges.begin();
std::set<MEdge, Less_Edge>::iterator it = edges.begin();
double sum = 0;
double sum = 0;
for (; it !=edges.end();++it){
for (; it !=edges.end();++it){
MVertex *v0 = it->getVertex(0);
MVertex *v0 = it->getVertex(0);
MVertex *v1 = it->getVertex(1);
MVertex *v1 = it->getVertex(1);
double l = sqrt((v0->x()-v1->x())*(v0->x()-v1->x())+(v0->y()-v1->y())*(v0->y()-v1->y())+(v0->z()-v1->z())*(v0->z()-v1->z()));
double l = sqrt((v0->x()-v1->x())*(v0->x()-v1->x())+
double lf = (*f)(0.5*(v0->x()+v1->x()), 0.5*(v0->y()+v1->y()),0.5*(v0->z()+v1->z()),v0->onWhat());
(v0->y()-v1->y())*(v0->y()-v1->y())+
double el = l/lf;
(v0->z()-v1->z())*(v0->z()-v1->z()));
int index = (int) ceil(el*nbS*0.5);
double lf = (*f)(0.5*(v0->x()+v1->x()), 0.5*(v0->y()+v1->y()),
qualE[index]+= 1;
0.5*(v0->z()+v1->z()),v0->onWhat());
double e = (l>lf) ? lf/l : l/lf;
double el = l/lf;
sum += e - 1.0;
int index = (int) ceil(el*nbS*0.5);
}
qualE[index]+= 1;
double tau = exp ((1./edges.size()) * sum);
double e = (l>lf) ? lf/l : l/lf;
double ibegin = 2./(2*nbS);
sum += e - 1.0;
double inext = 2./nbS;
}
for (int i= 0; i< qualE.size(); i++){
double tau = exp ((1./edges.size()) * sum);
fprintf(fp, "0 0 0 0 %g 0 0 %g \n", ibegin+i*inext , (double)qualE[i]/nbEdges);
double ibegin = 2./(2*nbS);
}
double inext = 2./nbS;
for (int i= 0; i< qualE.size(); i++){
fprintf(fp, "0 0 0 0 %g 0 0 %g \n", ibegin+i*inext , (double)qualE[i]/nbEdges);
}
}
}
fclose(fp);
fclose(fp);
#endif
#endif
//emi end hack
int
num
=
0
;
int
num
=
0
;
static
double
s
[
50
];
static
double
s
[
50
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment