make "orientation" module part of damask python interface
This commit is contained in:
parent
ec6440f1f4
commit
c496288144
|
@ -5,6 +5,7 @@ from .environment import Environment # only one class
|
|||
from .asciitable import ASCIItable # only one class
|
||||
from .config import Material # will be extended to debug and numerics
|
||||
from .colormaps import Colormap, Color
|
||||
from .orientation import Vector3, Quaternion
|
||||
#from .block import Block # only one class
|
||||
from .result import Result # one class with subclasses
|
||||
from .geometry import Geometry # one class with subclasses
|
||||
|
@ -51,4 +52,4 @@ except (ImportError,AttributeError) as e:
|
|||
):
|
||||
sys.stderr.write('\nWARNING: Core module (Fortran code) not available, \n'\
|
||||
'try to run setup_processing.sh or compile_CoreModule.py\n'\
|
||||
'Error Message when importing core.so: %s\n\n'%e)
|
||||
'Error message when importing core.so: %s\n\n'%e)
|
||||
|
|
|
@ -244,11 +244,17 @@ class Vector3:
|
|||
self.z - d * normal[2]])
|
||||
|
||||
def inSST(self,symmetry):
|
||||
return {'cubic': lambda R: R.inFZ('cubic') and R.x >= R.y and R.y >= R.z and R.z >= 0.0,
|
||||
'hexagonal': lambda R: R.inFZ('hexagonal') and R.x >= math.sqrt(3)*R.y and R.y >= 0.0 and R.z >= 0.0,
|
||||
'tetragonal': lambda R: R.inFZ('tetragonal') and R.x >= R.y and R.y >= 0.0 and R.z >= 0.0,
|
||||
'orthorombic': lambda R: R.inFZ('orthorombic') and R.x >= 0.0 and R.y >= 0.0 and R.z >= 0.0,
|
||||
}.get(symmetry.lower(),False)(self)
|
||||
'''
|
||||
Determination of disorientations follow the work of A. Heinz and P. Neumann:
|
||||
Representation of Orientation and Disorientation Data for
|
||||
Cubic, Hexagonal, Tetragonal and Orthorhombic Crystals
|
||||
Acta Cryst. (1991). A47, 780-789
|
||||
'''
|
||||
return {'cubic': lambda R: R.inFZ('cubic') and R.x >= R.y and R.y >= R.z and R.z >= 0.0,
|
||||
'hexagonal': lambda R: R.inFZ('hexagonal') and R.x >= math.sqrt(3)*R.y and R.y >= 0.0 and R.z >= 0.0,
|
||||
'tetragonal': lambda R: R.inFZ('tetragonal') and R.x >= R.y and R.y >= 0.0 and R.z >= 0.0,
|
||||
'orthorombic': lambda R: R.inFZ('orthorombic') and R.x >= 0.0 and R.y >= 0.0 and R.z >= 0.0,
|
||||
}.get(symmetry.lower(),False)(self)
|
||||
|
||||
def inFZ(self,symmetry):
|
||||
return {'cubic': lambda R: math.sqrt(2.0)-1.0 >= abs(R.x) \
|
Loading…
Reference in New Issue