Lily
November 20, 2020, 9:30am
#1
Dear FreeFem users,

I’d like to know if there is an option to get information about mesh quality such as :

the quality of a tetrahedron, or the quality of all elements and indicate the worst one
the volume of a tetrahedron
the length of the edges of a tetrahedron
Thanks in advance!

Lily

first I think that the mesh generator given this value,

but radius rho of inscribe sphere in tetrahedron K isgiven by
rho(K) = 6 V(K)/S(K) where V(K) is the volume of K and S(K) is the area of the
surface of K.

so in freefem in see this examples:

mesh-quality.edp|attachment](upload://16y6CexNMWGudRVvldnQnNptLnn.edp) (1.1 KB)

Lily
November 23, 2020, 6:44pm
#3
Of course, the mesh generator gives this value but I’d like to use it in FreeFem to impose some conditions.

Sorry, the attachment failed. I don’t have access to the example. Can you load it again? Thank you !

mesh-quality.edp (1.1 KB)

or the script :

{
// classical mesh quality computation of mesh quality 2 sqrt(3) h/rho 1 best …
mesh Th=square(1,1);
Th=adaptmesh(Th,0.1,IsMetric=1,nbvx=1000);
plot(Th,wait=1);
real cc = 4sqrt(3);// 3 / ( sqrt(3)/4 )
fespace Ph(Th,P0);
varf vquality1(uu,chi)= intalledges(Th)(hTriangle chi/area/cc);// bh = 2 area => ïnt dK 1 rho = 2 area
Ph q; q[] =vquality1(0,Ph);
plot(q,fill=1);
q[].sort;
for( int i=0; i<=5; ++i )
{
int j = (q[].n-1)i/5;
cout<< " quantile " <<i << " : "<< j << " quality " << q[][j] << endl;
}
}
{ // same in 3d …
load “msh3”
// in 3d …
// V = a^3/(6 sqrt(2))
// S = a^3 sqrt(3)
real cc= sqrt(3) (6 sqrt(2));// S/V
mesh3 Th=cube(10,10,10);
fespace Ph(Th,P0);
fespace Vh(Th,P1);
//func real f(real p) { cout <<nuTriangle << " " << hTriangle << " "<< volume << " "<< area << endl ; return 1;}
varf vquality1(uu,chi)= intallfaces(Th)(hTriangle*chi/volume/cc);//
Ph q; q[] =vquality1(0,Ph);
cout << q[].min << " " << q[].max << endl;
Vh q1=q;
plot(q1,wait=1);
q[].sort;
for( int i=0; i<=5; ++i )
{
int j = (q[].n-1)*i/5;
cout<< " quantile " <<j << " quality " << q[][j] << endl;
}

}