diff --git a/python/damask/orientation.py b/python/damask/orientation.py index ad9877835..7cb05af40 100644 --- a/python/damask/orientation.py +++ b/python/damask/orientation.py @@ -992,9 +992,14 @@ class Lattice: models={'KS':self.KS, 'GT':self.GT, "GT'":self.GTdash, 'NW':self.NW, 'Pitsch': self.Pitsch, 'Bain':self.Bain} + try: + relationship = models[model] + except: + raise KeyError('Orientation relationship "{}" is unknown'.format(model)) - relationship = models[model] - + if self.lattice not in relationship['mapping']: + raise ValueError('Relationship "{}" not supported for lattice "{}"'.format(model,self.lattice)) + r = {'lattice':Lattice((set(relationship['mapping'])-{self.lattice}).pop()), # target lattice 'rotations':[] }