Class QualityMeasure
Provides mesh quality information.
Inheritance
Inherited Members
Namespace: UnityEngine.Experimental.U2D.TriangleNet.Tools
Syntax
public class QualityMeasure
Remarks
Given a triangle abc with points A (ax, ay), B (bx, by), C (cx, cy).
The side lengths are given as a = sqrt((cx - bx)^2 + (cy - by)^2) -- side BC opposite of A b = sqrt((cx - ax)^2 + (cy - ay)^2) -- side CA opposite of B c = sqrt((ax - bx)^2 + (ay - by)^2) -- side AB opposite of C
The angles are given as ang_a = acos((b^2 + c^2 - a^2) / (2 * b * c)) -- angle at A ang_b = acos((c^2 + a^2 - b^2) / (2 * c * a)) -- angle at B ang_c = acos((a^2 + b^2 - c^2) / (2 * a * b)) -- angle at C
The semiperimeter is given as s = (a + b + c) / 2
The area is given as D = abs(ax * (by - cy) + bx * (cy - ay) + cx * (ay - by)) / 2 = sqrt(s * (s - a) * (s - b) * (s - c))
The inradius is given as r = D / s
The circumradius is given as R = a * b * c / (4 * D)
The altitudes are given as alt_a = 2 * D / a -- altitude above side a alt_b = 2 * D / b -- altitude above side b alt_c = 2 * D / c -- altitude above side c
The aspect ratio may be given as the ratio of the longest to the shortest edge or, more commonly as the ratio of the circumradius to twice the inradius ar = R / (2 * r) = a * b * c / (8 * (s - a) * (s - b) * (s - c)) = a * b * c / ((b + c - a) * (c + a - b) * (a + b - c))
Constructors
QualityMeasure()
Declaration
public QualityMeasure()
Properties
AlphaArea
Average angle weighted by area.
Declaration
public double AlphaArea { get; }
Property Value
Type | Description |
---|---|
System.Double |
AlphaAverage
Average angle.
Declaration
public double AlphaAverage { get; }
Property Value
Type | Description |
---|---|
System.Double |
AlphaMaximum
Maximum smallest angle.
Declaration
public double AlphaMaximum { get; }
Property Value
Type | Description |
---|---|
System.Double |
AlphaMinimum
Smallest angle.
Declaration
public double AlphaMinimum { get; }
Property Value
Type | Description |
---|---|
System.Double |
AreaMaximum
Maximum triangle area.
Declaration
public double AreaMaximum { get; }
Property Value
Type | Description |
---|---|
System.Double |
AreaMinimum
Minimum triangle area.
Declaration
public double AreaMinimum { get; }
Property Value
Type | Description |
---|---|
System.Double |
AreaRatio
Ratio of maximum and minimum triangle area.
Declaration
public double AreaRatio { get; }
Property Value
Type | Description |
---|---|
System.Double |
Q_Area
Average aspect ratio weighted by area.
Declaration
public double Q_Area { get; }
Property Value
Type | Description |
---|---|
System.Double |
Q_Average
Average aspect ratio.
Declaration
public double Q_Average { get; }
Property Value
Type | Description |
---|---|
System.Double |
Q_Maximum
Largest aspect ratio.
Declaration
public double Q_Maximum { get; }
Property Value
Type | Description |
---|---|
System.Double |
Q_Minimum
Smallest aspect ratio.
Declaration
public double Q_Minimum { get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
Bandwidth()
Determines the bandwidth of the coefficient matrix.
Declaration
public int Bandwidth()
Returns
Type | Description |
---|---|
System.Int32 | Bandwidth of the coefficient matrix. |
Remarks
The quantity computed here is the "geometric" bandwidth determined by the finite element mesh alone.
If a single finite element variable is associated with each node of the mesh, and if the nodes and variables are numbered in the same way, then the geometric bandwidth is the same as the bandwidth of a typical finite element matrix.
The bandwidth M is defined in terms of the lower and upper bandwidths:
M = ML + 1 + MU
where
ML = maximum distance from any diagonal entry to a nonzero entry in the same row, but earlier column,
MU = maximum distance from any diagonal entry to a nonzero entry in the same row, but later column.
Because the finite element node adjacency relationship is symmetric, we are guaranteed that ML = MU.
Update(Mesh)
Declaration
public void Update(Mesh mesh)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh |