-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.py
52 lines (38 loc) · 1.03 KB
/
common.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
"""
gyroid.common
=============
This moudle define all global constants.
It includes::
EPS, SMALL, LARGE
BRAVAIS, CARTESIAN
LAMELLAR
SQUARE, RECTANGULAR, HEXAGONAL, OBLIQUE
CUBIC, TETRAGONAL, ORTHORHOMBIC, TRIGONAL, MONOCLINIC, TRICLINIC
DEFAULT
CRYSTAL_SYSTEM1, CRYSTAL_SYSTEM2, CRYSTAL_SYSTEM3
"""
import numpy as np
from numpy.linalg import inv
# To let the G2 comparison pass, EPS should not be too small
EPS = 1e-6
SMALL = 1e-10
LARGE = 1e+10
BRAVAIS = "Bravais"
CARTESIAN = "Cartesian"
LAMELLAR = "Lamellar"
SQUARE = "Square"
RECTANGULAR = "Rectangular"
HEXAGONAL = "Hexagonal"
OBLIQUE = "Oblique"
CUBIC = "Cubic"
TETRAGONAL = "Tetragonal"
ORTHORHOMBIC = "Orthorhombic"
TRIGONAL = "Trigonal"
MONOCLINIC = "Monoclinic"
TRICLINIC = "Triclinic"
DEFAULT = "Default"
CRYSTAL_SYSTEM1 = [LAMELLAR,DEFAULT]
CRYSTAL_SYSTEM2 = [SQUARE,RECTANGULAR,HEXAGONAL,OBLIQUE,DEFAULT]
CRYSTAL_SYSTEM3 = [CUBIC,TETRAGONAL,ORTHORHOMBIC,HEXAGONAL,
TRIGONAL,MONOCLINIC,TRICLINIC,DEFAULT]