How to get the mesh quality using ACT
M
Member, Employee Posts: 236
✭✭✭✭
Simple check of mesh quality
Will walk through all available mesh metric quantities write ave, min, max, std to dict
with Transaction(): m = Model.Mesh m_q = {} mm = 1 ctr = 1 while mm == 1: try: m.MeshMetric = ctr m_nam=m.PropertyByName("MeshMetric").StringValue m_ave = m.Average m_min = m.Minimum m_max = m.Maximum m_std = m.StandardDeviation m_q[m_nam] = ([ctr,m_ave,m_min,m_max,m_std]) # mesh metric, counter, ctr+=1 except: pass mm = 0
Tagged:
4
Best Answers
-
Another method is to use GetResultsData() to retrieve the values on the elements directly. For example, to retrieve MAPDL Jacobian Ration on element n°1, one can use:
results = ExtAPI.DataModel.Project.Model.Analyses[0].GetResultsData() # access results mesh_results = results.GetResult("MESH_") # access results on mesh mesh_results.Components # print "components", ie, name of available results for the mesh mesh_results.SelectComponents(['JACOBIAN_RATIO_MAPDL']) # select MAPDL Jacobian ratio mesh_results.GetElementValues([1]) # print value on element 1
2 -
Just to add to the first post.
Instead of using ctr=1 or some other integer we can now (say 2023 r2) use the following to set the type of mesh metric one wants to look at:
m.MeshMetric=MeshMetricType.AspectRatio
1
Answers
-
Much clearer. Thanks Erik!
1