def get_symmetry_code_tri(pts):
if len(pts) == 1:
return '_s3()'
elif len(pts) == 3:
# Symmetry group [[a, a, b], [a, b, a], [b, a, a]].
# Find the equal value `a`.
tol = 1.0e-12
beta = pts[0] - pts[0][0]
ct = numpy.count_nonzero(abs(beta) < tol)
assert ct in [1, 2], beta
val = pts[0][0] if ct == 2 else pts[0][1]
return '_s21({:.15e})'.format(val)
# Symmetry group [[a, b, c], [c, a, b], ...].
assert len(pts) == 6
# Take the two largest value from a, b, c.
pt0 = numpy.sort(pts[0])
return '_s111({:.15e}, {:.15e})'.format(pt0[2], pt0[1])
评论列表
文章目录