main content

evaluate shape quality of mesh elements -凯发k8网页登录

evaluate shape quality of mesh elements

description

example

q = meshquality(mesh) returns a row vector of numbers from 0 through 1 representing shape quality of all elements of the mesh. here, 1 corresponds to the optimal shape of the element.

example

q = meshquality(mesh,elemids) returns the shape quality of the specified elements.

example

q = meshquality(___,"aspect-ratio") determines the shape quality by using the ratio of minimal to maximal dimensions of an element. the quality values are numbers from 0 through 1, where 1 corresponds to the optimal shape of the element. specify "aspect-ratio" after any of the previous syntaxes.

examples

evaluate the shape quality of the elements of a 3-d mesh.

create a pde model.

model = createpde;

include and plot the following geometry.

importgeometry(model,"platesquareholesolid.stl");
pdegplot(model)

figure contains an axes object. the axes object contains 3 objects of type quiver, patch, line.

create and plot a coarse mesh.

mesh = generatemesh(model,"hmax",35)
mesh = 
  femesh with properties:
             nodes: [3x487 double]
          elements: [10x213 double]
    maxelementsize: 35
    minelementsize: 17.5000
     meshgradation: 1.5000
    geometricorder: 'quadratic'
pdemesh(model)

evaluate the shape quality of all mesh elements. display the first five values.

q = meshquality(mesh);
q(1:5)
ans = 1×5
    0.3079    0.2917    0.6189    0.6688    0.5571

find the elements with the quality values less than 0.2.

elemids = find(q < 0.2);

highlight these elements in blue on the mesh plot.

pdemesh(mesh,"facealpha",0.5)
hold on
pdemesh(mesh.nodes,mesh.elements(:,elemids), ...
                  "facecolor","blue", ...
                  "edgecolor","blue")

plot the element quality in a histogram.

figure
hist(q)
xlabel("element shape quality","fontweight","b")
ylabel("number of elements","fontweight","b")

figure contains an axes object. the axes object with xlabel element shape quality, ylabel number of elements contains an object of type patch. this object represents q.

find the worst quality value.

qworst = min(q)
qworst = 0.1691

find the corresponding element ids.

elemids = find(q==qworst)
elemids = 1×2
    10   136

evaluate the shape quality of the elements of a 2-d mesh.

create a pde model.

model = createpde;

include and plot the following geometry.

importgeometry(model,"platesquareholeplanar.stl");
pdegplot(model)

figure contains an axes object. the axes object contains an object of type line.

create and plot a coarse mesh.

mesh = generatemesh(model,"hmax",20)
mesh = 
  femesh with properties:
             nodes: [2x286 double]
          elements: [6x126 double]
    maxelementsize: 20
    minelementsize: 10
     meshgradation: 1.5000
    geometricorder: 'quadratic'
pdemesh(model)

figure contains an axes object. the axes object contains 2 objects of type line.

find the ids of the elements within a box enclosing the center of the plate.

elemids = findelements(mesh,"box",[25,75],[80,120]);

evaluate the shape quality of these elements. display the result as a column vector.

q = meshquality(mesh,elemids);
q.'
ans = 12×1
    0.2980
    0.8253
    0.2994
    0.6581
    0.7838
    0.6104
    0.3992
    0.6921
    0.2948
    0.5726
      ⋮

find the elements with the quality values less than 0.4.

elemids04 = elemids(q < 0.4)
elemids04 = 1×4
     9    19    69    83

highlight these elements in green on the mesh plot. zoom in to see the details.

pdemesh(mesh,"elementlabels","on")
hold on
pdemesh(mesh.nodes,mesh.elements(:,elemids04),"edgecolor","green")
zoom(10)

figure contains an axes object. the axes object contains 3 objects of type line.

determine the shape quality of mesh elements by using the ratios of minimal to maximal dimensions.

create a pde model and include the l-shaped geometry.

model = createpde(1);
geometryfromedges(model,@lshapeg);

generate the default mesh for the geometry.

mesh = generatemesh(model);

view the mesh.

pdeplot(model)

figure contains an axes object. the axes object contains 2 objects of type line.

evaluate the shape quality of mesh elements by using the minimal to maximal dimensions ratio. display the first five values.

q = meshquality(mesh,"aspect-ratio");
q(1:5)
ans = 1×5
    0.8339    0.7655    0.7755    0.8301    0.8969

evaluate the shape quality of mesh elements by using the default setting. display the first five values.

q = meshquality(mesh);
q(1:5)
ans = 1×5
    0.9837    0.9605    0.9654    0.9829    0.9913

input arguments

mesh object, specified as the mesh property of a pdemodel object or as the output of generatemesh.

example: model.mesh

element ids, specified as a positive integer or a matrix of positive integers.

example: [10 68 81 97 113 130 136 164]

output arguments

shape quality of mesh elements, returned as a row vector of numbers from 0 through 1. the value 0 corresponds to a deflated element with zero area or volume. the value 1 corresponds to an element of optimal shape.

example: [0.9150 0.7787 0.9417 0.2744 0.9843 0.9181]

data types: double

references

[1] knupp, patrick m. "matrix norms & the condition number: a general framework to improve mesh quality via node-movement." in proceedings, 8th international meshing roundtable. lake tahoe, ca, october 1999: 13-22.

version history

introduced in r2018a

see also

| | | |

topics

    网站地图