def tensorToVoigtIndex(vals): if vals[0] == vals[1]: return vals[0] else: sol = Mmath.set_diff(range(3),set(vals)) return sol[0] + 3
def tensorToVoigtIndex(vals): if vals[0] == vals[1]: return vals[0] else: sol = Mmath.set_diff(range(3), set(vals)) return sol[0] + 3
def voigtToTensorIndex(val): if val < 3: return [val,val] else: return Mmath.set_diff(range(3),set([val-3]))
def voigtToTensorIndex(val): if val < 3: return [val, val] else: return Mmath.set_diff(range(3), set([val - 3]))