Simulation Modeling Sciences
Example 3
CUBIT User Tutorial
#!python
import sys
# add Cubit libraries to your path
sys.path.append('/Applications/Cubit-15.4/Cubit.app/Contents/MacOS')
import cubit
cubit.init(['cubit','-nojournal'])
cubit.cmd('import mesh geom "mesh.g"')
all_vols = cubit.get_entities("volume")
min_quality = 1.0
for vol in all_vols:
vhexes = cubit.get_volume_hexes(vol)
for hex in vhexes:
q = cubit.get_quality_value("hex", hex, "shape")
if q < min_quality:
min_quality = q
print 'min quality = ', min_quality