symcrys 0.10.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/cell.d.ts +19 -16
- package/dist/cell.d.ts.map +1 -1
- package/dist/cell.js +63 -35
- package/dist/cell.js.map +1 -1
- package/dist/checks.d.ts +29 -0
- package/dist/checks.d.ts.map +1 -0
- package/dist/checks.js +79 -0
- package/dist/checks.js.map +1 -0
- package/dist/closure.d.ts +43 -0
- package/dist/closure.d.ts.map +1 -0
- package/dist/closure.js +201 -0
- package/dist/closure.js.map +1 -0
- package/dist/coordinates.d.ts +143 -0
- package/dist/coordinates.d.ts.map +1 -0
- package/dist/coordinates.js +198 -0
- package/dist/coordinates.js.map +1 -0
- package/dist/crystalClasses.d.ts +170 -117
- package/dist/crystalClasses.d.ts.map +1 -1
- package/dist/crystalClasses.js +190 -121
- package/dist/crystalClasses.js.map +1 -1
- package/dist/freeze.d.ts +7 -0
- package/dist/freeze.d.ts.map +1 -0
- package/dist/freeze.js +15 -0
- package/dist/freeze.js.map +1 -0
- package/dist/index.d.ts +13 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/indices.d.ts +30 -20
- package/dist/indices.d.ts.map +1 -1
- package/dist/indices.js +101 -31
- package/dist/indices.js.map +1 -1
- package/dist/lattice.d.ts +15 -1
- package/dist/lattice.d.ts.map +1 -1
- package/dist/lattice.js +30 -1
- package/dist/lattice.js.map +1 -1
- package/dist/linalg.d.ts +2 -2
- package/dist/linalg.d.ts.map +1 -1
- package/dist/linalg.js +3 -3
- package/dist/linalg.js.map +1 -1
- package/dist/magnetic.d.ts +14 -10
- package/dist/magnetic.d.ts.map +1 -1
- package/dist/magnetic.js +10 -6
- package/dist/magnetic.js.map +1 -1
- package/dist/notation.d.ts +16 -0
- package/dist/notation.d.ts.map +1 -0
- package/dist/notation.js +66 -0
- package/dist/notation.js.map +1 -0
- package/dist/operations.d.ts +40 -26
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +48 -60
- package/dist/operations.js.map +1 -1
- package/dist/plane.d.ts +297 -80
- package/dist/plane.d.ts.map +1 -1
- package/dist/plane.js +289 -94
- package/dist/plane.js.map +1 -1
- package/dist/pointGroups/crystalForms.d.ts +6 -21
- package/dist/pointGroups/crystalForms.d.ts.map +1 -1
- package/dist/pointGroups/crystalForms.js +9 -16
- package/dist/pointGroups/crystalForms.js.map +1 -1
- package/dist/pointGroups/crystalFormsData.d.ts +4 -1
- package/dist/pointGroups/crystalFormsData.d.ts.map +1 -1
- package/dist/pointGroups/crystalFormsData.js +64 -1
- package/dist/pointGroups/crystalFormsData.js.map +1 -1
- package/dist/pointGroups/elements.d.ts +19 -17
- package/dist/pointGroups/elements.d.ts.map +1 -1
- package/dist/pointGroups/elements.js +65 -83
- package/dist/pointGroups/elements.js.map +1 -1
- package/dist/pointGroups/identify.d.ts +10 -18
- package/dist/pointGroups/identify.d.ts.map +1 -1
- package/dist/pointGroups/identify.js +27 -79
- package/dist/pointGroups/identify.js.map +1 -1
- package/dist/pointGroups/itaOrder.d.ts +15 -14
- package/dist/pointGroups/itaOrder.d.ts.map +1 -1
- package/dist/pointGroups/itaOrder.js +116 -94
- package/dist/pointGroups/itaOrder.js.map +1 -1
- package/dist/pointGroups/itcData.d.ts +96 -0
- package/dist/pointGroups/itcData.d.ts.map +1 -0
- package/dist/pointGroups/itcData.js +336 -0
- package/dist/pointGroups/itcData.js.map +1 -0
- package/dist/pointGroups/itcMagneticData.d.ts +55 -0
- package/dist/pointGroups/itcMagneticData.d.ts.map +1 -0
- package/dist/pointGroups/itcMagneticData.js +172 -0
- package/dist/pointGroups/itcMagneticData.js.map +1 -0
- package/dist/pointGroups/keys.d.ts +32 -0
- package/dist/pointGroups/keys.d.ts.map +1 -0
- package/dist/pointGroups/keys.js +120 -0
- package/dist/pointGroups/keys.js.map +1 -0
- package/dist/pointGroups/magneticSymbols.d.ts +6 -5
- package/dist/pointGroups/magneticSymbols.d.ts.map +1 -1
- package/dist/pointGroups/magneticSymbols.js +15 -12
- package/dist/pointGroups/magneticSymbols.js.map +1 -1
- package/dist/pointGroups/orbits.d.ts +23 -42
- package/dist/pointGroups/orbits.d.ts.map +1 -1
- package/dist/pointGroups/orbits.js +20 -62
- package/dist/pointGroups/orbits.js.map +1 -1
- package/dist/pointGroups/pointGroups.d.ts +145 -68
- package/dist/pointGroups/pointGroups.d.ts.map +1 -1
- package/dist/pointGroups/pointGroups.js +455 -243
- package/dist/pointGroups/pointGroups.js.map +1 -1
- package/dist/pointGroups/properties.d.ts +21 -22
- package/dist/pointGroups/properties.d.ts.map +1 -1
- package/dist/pointGroups/properties.js +40 -37
- package/dist/pointGroups/properties.js.map +1 -1
- package/dist/pointGroups/seitzData.d.ts +26 -0
- package/dist/pointGroups/seitzData.d.ts.map +1 -0
- package/dist/pointGroups/seitzData.js +130 -0
- package/dist/pointGroups/seitzData.js.map +1 -0
- package/dist/pointGroups/shubnikovData.d.ts +11 -0
- package/dist/pointGroups/shubnikovData.d.ts.map +1 -0
- package/dist/pointGroups/shubnikovData.js +101 -0
- package/dist/pointGroups/shubnikovData.js.map +1 -0
- package/dist/pointGroups/wyckoff.d.ts +70 -40
- package/dist/pointGroups/wyckoff.d.ts.map +1 -1
- package/dist/pointGroups/wyckoff.js +98 -91
- package/dist/pointGroups/wyckoff.js.map +1 -1
- package/dist/pointGroups/wyckoffData.d.ts +7 -4
- package/dist/pointGroups/wyckoffData.d.ts.map +1 -1
- package/dist/pointGroups/wyckoffData.js +789 -168
- package/dist/pointGroups/wyckoffData.js.map +1 -1
- package/dist/siteSymmetry.d.ts +8 -16
- package/dist/siteSymmetry.d.ts.map +1 -1
- package/dist/siteSymmetry.js +34 -24
- package/dist/siteSymmetry.js.map +1 -1
- package/dist/spaceGroups/affine.d.ts.map +1 -1
- package/dist/spaceGroups/affine.js +3 -2
- package/dist/spaceGroups/affine.js.map +1 -1
- package/dist/spaceGroups/cell.d.ts +43 -31
- package/dist/spaceGroups/cell.d.ts.map +1 -1
- package/dist/spaceGroups/cell.js +173 -85
- package/dist/spaceGroups/cell.js.map +1 -1
- package/dist/spaceGroups/describe.d.ts +13 -10
- package/dist/spaceGroups/describe.d.ts.map +1 -1
- package/dist/spaceGroups/describe.js +11 -10
- package/dist/spaceGroups/describe.js.map +1 -1
- package/dist/spaceGroups/planeGroupData.d.ts +3 -1
- package/dist/spaceGroups/planeGroupData.d.ts.map +1 -1
- package/dist/spaceGroups/planeGroupData.js +25 -8
- package/dist/spaceGroups/planeGroupData.js.map +1 -1
- package/dist/spaceGroups/planeGroups.d.ts.map +1 -1
- package/dist/spaceGroups/planeGroups.js +2 -1
- package/dist/spaceGroups/planeGroups.js.map +1 -1
- package/dist/spaceGroups/planeLattice.d.ts +78 -0
- package/dist/spaceGroups/planeLattice.d.ts.map +1 -0
- package/dist/spaceGroups/planeLattice.js +143 -0
- package/dist/spaceGroups/planeLattice.js.map +1 -0
- package/dist/spaceGroups/planePointGroups.d.ts +6 -2
- package/dist/spaceGroups/planePointGroups.d.ts.map +1 -1
- package/dist/spaceGroups/planePointGroups.js +14 -2
- package/dist/spaceGroups/planePointGroups.js.map +1 -1
- package/dist/spaceGroups/positions.d.ts +48 -19
- package/dist/spaceGroups/positions.d.ts.map +1 -1
- package/dist/spaceGroups/positions.js +166 -67
- package/dist/spaceGroups/positions.js.map +1 -1
- package/dist/spaceGroups/rational.d.ts +18 -0
- package/dist/spaceGroups/rational.d.ts.map +1 -1
- package/dist/spaceGroups/rational.js +58 -0
- package/dist/spaceGroups/rational.js.map +1 -1
- package/dist/tensors/propertyTable.d.ts +3 -1
- package/dist/tensors/propertyTable.d.ts.map +1 -1
- package/dist/tensors/propertyTable.js +17 -10
- package/dist/tensors/propertyTable.js.map +1 -1
- package/dist/tensors/rowEchelon.d.ts +3 -3
- package/dist/tensors/rowEchelon.d.ts.map +1 -1
- package/dist/tensors/rowEchelon.js +4 -4
- package/dist/tensors/rowEchelon.js.map +1 -1
- package/dist/tensors/tensorForm.d.ts +75 -34
- package/dist/tensors/tensorForm.d.ts.map +1 -1
- package/dist/tensors/tensorForm.js +171 -67
- package/dist/tensors/tensorForm.js.map +1 -1
- package/dist/tensors/tensorProperties.d.ts +10 -9
- package/dist/tensors/tensorProperties.d.ts.map +1 -1
- package/dist/tensors/tensorProperties.js +22 -12
- package/dist/tensors/tensorProperties.js.map +1 -1
- package/dist/tensors/voigt.d.ts +56 -0
- package/dist/tensors/voigt.d.ts.map +1 -0
- package/dist/tensors/voigt.js +188 -0
- package/dist/tensors/voigt.js.map +1 -0
- package/dist/tolerances.d.ts +56 -1
- package/dist/tolerances.d.ts.map +1 -1
- package/dist/tolerances.js +51 -1
- package/dist/tolerances.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/cell.ts +78 -51
- package/src/checks.ts +84 -0
- package/src/closure.ts +214 -0
- package/src/coordinates.ts +370 -0
- package/src/crystalClasses.ts +271 -157
- package/src/freeze.ts +14 -0
- package/src/index.ts +33 -12
- package/src/indices.ts +102 -42
- package/src/lattice.ts +41 -1
- package/src/linalg.ts +3 -3
- package/src/magnetic.ts +24 -11
- package/src/notation.ts +73 -0
- package/src/operations.ts +78 -71
- package/src/plane.ts +531 -151
- package/src/pointGroups/crystalForms.ts +11 -44
- package/src/pointGroups/crystalFormsData.ts +66 -1
- package/src/pointGroups/elements.ts +82 -92
- package/src/pointGroups/identify.ts +38 -97
- package/src/pointGroups/itaOrder.ts +117 -101
- package/src/pointGroups/itcData.ts +404 -0
- package/src/pointGroups/itcMagneticData.ts +206 -0
- package/src/pointGroups/keys.ts +144 -0
- package/src/pointGroups/magneticSymbols.ts +18 -17
- package/src/pointGroups/orbits.ts +41 -89
- package/src/pointGroups/pointGroups.ts +593 -298
- package/src/pointGroups/properties.ts +44 -40
- package/src/pointGroups/seitzData.ts +147 -0
- package/src/pointGroups/shubnikovData.ts +103 -0
- package/src/pointGroups/wyckoff.ts +137 -112
- package/src/pointGroups/wyckoffData.ts +793 -170
- package/src/siteSymmetry.ts +43 -40
- package/src/spaceGroups/affine.ts +3 -2
- package/src/spaceGroups/cell.ts +227 -116
- package/src/spaceGroups/describe.ts +23 -19
- package/src/spaceGroups/planeGroupData.ts +28 -9
- package/src/spaceGroups/planeGroups.ts +2 -1
- package/src/spaceGroups/planeLattice.ts +208 -0
- package/src/spaceGroups/planePointGroups.ts +23 -3
- package/src/spaceGroups/positions.ts +202 -78
- package/src/spaceGroups/rational.ts +59 -0
- package/src/tensors/propertyTable.ts +26 -14
- package/src/tensors/rowEchelon.ts +4 -3
- package/src/tensors/tensorForm.ts +258 -88
- package/src/tensors/tensorProperties.ts +34 -14
- package/src/tensors/voigt.ts +268 -0
- package/src/tolerances.ts +66 -1
- package/src/version.ts +1 -1
- package/dist/pointGroups/data.d.ts +0 -75
- package/dist/pointGroups/data.d.ts.map +0 -1
- package/dist/pointGroups/data.js +0 -212
- package/dist/pointGroups/data.js.map +0 -1
- package/dist/pointGroups/magneticData.d.ts +0 -66
- package/dist/pointGroups/magneticData.d.ts.map +0 -1
- package/dist/pointGroups/magneticData.js +0 -184
- package/dist/pointGroups/magneticData.js.map +0 -1
- package/dist/spaceGroups/snap.d.ts +0 -20
- package/dist/spaceGroups/snap.d.ts.map +0 -1
- package/dist/spaceGroups/snap.js +0 -103
- package/dist/spaceGroups/snap.js.map +0 -1
- package/src/pointGroups/data.ts +0 -305
- package/src/pointGroups/magneticData.ts +0 -328
- package/src/spaceGroups/snap.ts +0 -121
package/dist/crystalClasses.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Everything is computed by the modules that serve both entry points; this module checks what
|
|
11
11
|
* comes in and leaves time reversal out of what goes back.
|
|
12
12
|
*/
|
|
13
|
+
import { checkOptions, shown, TOLERANCE_KEYS } from './checks.js';
|
|
13
14
|
import * as elements from './pointGroups/elements.js';
|
|
14
15
|
import * as groups from './pointGroups/pointGroups.js';
|
|
15
16
|
import * as properties from './pointGroups/properties.js';
|
|
@@ -21,6 +22,8 @@ import * as cell from './cell.js';
|
|
|
21
22
|
import * as site from './siteSymmetry.js';
|
|
22
23
|
import { TENSOR_PROPERTIES as ALL_TENSOR_PROPERTIES } from './tensors/propertyTable.js';
|
|
23
24
|
import * as tensors from './tensors/tensorForm.js';
|
|
25
|
+
import * as voigtNotation from './tensors/voigt.js';
|
|
26
|
+
import { deepFreeze } from './freeze.js';
|
|
24
27
|
const USE_MAGNETIC = "the crystallographic API has no time reversal; use the magnetic API ('symcrys/magnetic', in Python symcrys.magnetic)";
|
|
25
28
|
/**
|
|
26
29
|
* The named tensor properties of the crystal classes: those of time-even tensors. `'gyrotropic'`
|
|
@@ -28,11 +31,11 @@ const USE_MAGNETIC = "the crystallographic API has no time reversal; use the mag
|
|
|
28
31
|
* magnetic API.
|
|
29
32
|
*/
|
|
30
33
|
export const TENSOR_PROPERTIES = Object.freeze(Object.fromEntries(Object.entries(ALL_TENSOR_PROPERTIES)
|
|
31
|
-
.filter(([, p]) => p.spec.timeParity === '
|
|
34
|
+
.filter(([, p]) => p.spec.timeParity === 'even')
|
|
32
35
|
.map(([name, { spec, description, source }]) => [
|
|
33
36
|
name,
|
|
34
37
|
Object.freeze({
|
|
35
|
-
spec: Object.freeze({ rank: spec.rank,
|
|
38
|
+
spec: Object.freeze({ rank: spec.rank, kind: spec.kind, intrinsic: spec.intrinsic }),
|
|
36
39
|
description,
|
|
37
40
|
source,
|
|
38
41
|
}),
|
|
@@ -44,9 +47,9 @@ function classKey(key) {
|
|
|
44
47
|
if (groups.isPointGroupKey(key))
|
|
45
48
|
return key;
|
|
46
49
|
if (groups.isMagneticPointGroupKey(key)) {
|
|
47
|
-
throw new RangeError(`${
|
|
50
|
+
throw new RangeError(`${shown(key)} is a magnetic point group, not a crystal class: ${USE_MAGNETIC}`);
|
|
48
51
|
}
|
|
49
|
-
throw new RangeError(`Unknown point group key: ${
|
|
52
|
+
throw new RangeError(`Unknown point group key: ${shown(key)}`);
|
|
50
53
|
}
|
|
51
54
|
/** A name of the table of this API, checked. */
|
|
52
55
|
function propertyName(name) {
|
|
@@ -54,50 +57,59 @@ function propertyName(name) {
|
|
|
54
57
|
if (Object.hasOwn(TENSOR_PROPERTIES, name))
|
|
55
58
|
return name;
|
|
56
59
|
if (Object.hasOwn(ALL_TENSOR_PROPERTIES, name)) {
|
|
57
|
-
throw new RangeError(`${
|
|
60
|
+
throw new RangeError(`${shown(name)} is the property of a time-odd tensor: ${USE_MAGNETIC}`);
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
|
-
throw new RangeError(`Unknown tensor property: ${
|
|
63
|
+
throw new RangeError(`Unknown tensor property: ${shown(name)} (known: ${TENSOR_PROPERTY_NAMES.join(', ')})`);
|
|
61
64
|
}
|
|
62
65
|
/** The time-even tensor of a specification or of a property name, as the shared modules take it. */
|
|
63
66
|
function timeEven(specOrName) {
|
|
64
67
|
if (typeof specOrName === 'string')
|
|
65
68
|
return propertyName(specOrName);
|
|
66
69
|
if (typeof specOrName !== 'object' || specOrName === null) {
|
|
67
|
-
throw new RangeError(`Not a tensor specification: ${
|
|
70
|
+
throw new RangeError(`Not a tensor specification: ${shown(specOrName)}`);
|
|
68
71
|
}
|
|
69
72
|
const timeParity = specOrName.timeParity;
|
|
70
|
-
if (timeParity === 'c')
|
|
71
|
-
throw new RangeError(`A time-odd tensor (timeParity '
|
|
72
|
-
if (timeParity !== undefined && timeParity !== 'i') {
|
|
73
|
-
throw new RangeError(`Unknown time parity: ${JSON.stringify(timeParity)}`);
|
|
73
|
+
if (timeParity === 'odd' || timeParity === 'c') {
|
|
74
|
+
throw new RangeError(`A time-odd tensor (timeParity '${timeParity}'): ${USE_MAGNETIC}`);
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
+
if (timeParity !== undefined && timeParity !== 'even') {
|
|
77
|
+
// The shared check names the values and the names up to 0.10 ('i', 'c').
|
|
78
|
+
return { ...specOrName, timeParity: timeParity };
|
|
79
|
+
}
|
|
80
|
+
// The other fields are passed on as they are, so that the shared check reports a field of 0.10 (parity).
|
|
81
|
+
return { ...specOrName, timeParity: 'even' };
|
|
76
82
|
}
|
|
77
83
|
/** Checks a list of operations of a caller: an operation with time reversal is an error. */
|
|
78
84
|
function checkUnitary(operations) {
|
|
85
|
+
if (!Array.isArray(operations))
|
|
86
|
+
throw new RangeError('The operations must be an array');
|
|
79
87
|
operations.forEach((op, i) => {
|
|
88
|
+
if (typeof op !== 'object' || op === null)
|
|
89
|
+
throw new RangeError(`Operation ${i} is not an object`);
|
|
80
90
|
const timeReversal = op.timeReversal;
|
|
81
91
|
if (timeReversal === true) {
|
|
82
92
|
throw new RangeError(`Operation ${i} is combined with time reversal: ${USE_MAGNETIC}`);
|
|
83
93
|
}
|
|
84
94
|
if (timeReversal !== undefined && timeReversal !== false) {
|
|
85
|
-
throw new RangeError(`Operation ${i}: timeReversal must be false or absent, not ${
|
|
95
|
+
throw new RangeError(`Operation ${i}: timeReversal must be false or absent, not ${shown(timeReversal)}`);
|
|
86
96
|
}
|
|
87
97
|
});
|
|
88
98
|
}
|
|
89
99
|
/** A list of operations as the shared modules take it. */
|
|
90
100
|
function unitary(operations) {
|
|
91
101
|
checkUnitary(operations);
|
|
92
|
-
|
|
102
|
+
// The other fields are kept for the checks of the shared modules (a record with `matrix` only
|
|
103
|
+
// is refused there with a hint).
|
|
104
|
+
return operations.map((op) => ({ ...op, timeReversal: false }));
|
|
93
105
|
}
|
|
94
106
|
// --- what goes back --------------------------------------------------------------------------------
|
|
95
107
|
const withoutTimeCache = new WeakMap();
|
|
96
|
-
/** The operations
|
|
97
|
-
function
|
|
108
|
+
/** The operations without time reversal; the shared modules return the same frozen list for the same call. */
|
|
109
|
+
function withoutTime(ops) {
|
|
98
110
|
let result = withoutTimeCache.get(ops);
|
|
99
111
|
if (!result) {
|
|
100
|
-
result = Object.freeze(ops.map((op) => Object.freeze({ matrix: op.matrix })));
|
|
112
|
+
result = Object.freeze(ops.map((op) => Object.freeze({ matrix: op.matrix, cartesian: op.cartesian })));
|
|
101
113
|
withoutTimeCache.set(ops, result);
|
|
102
114
|
}
|
|
103
115
|
return result;
|
|
@@ -114,73 +126,98 @@ const groupCache = new Map();
|
|
|
114
126
|
export function pointGroup(key) {
|
|
115
127
|
let g = groupCache.get(classKey(key));
|
|
116
128
|
if (!g) {
|
|
117
|
-
const { crystalSystem, order, centrosymmetric, polar,
|
|
118
|
-
g = Object.freeze({ key, crystalSystem, order, centrosymmetric, polar,
|
|
129
|
+
const { crystalSystem, order, centrosymmetric, polar, enantiomorphic, laueClass } = groups.pointGroup(key);
|
|
130
|
+
g = Object.freeze({ key, crystalSystem, order, centrosymmetric, polar, enantiomorphic, laueClass });
|
|
119
131
|
groupCache.set(key, g);
|
|
120
132
|
}
|
|
121
133
|
return g;
|
|
122
134
|
}
|
|
123
135
|
/** All 32 crystal classes, in the order of `POINT_GROUP_KEYS` (by crystal system, as in ITA). */
|
|
124
136
|
export function pointGroups() {
|
|
125
|
-
return groups.POINT_GROUP_KEYS.map((key) => pointGroup(key));
|
|
137
|
+
return deepFreeze(groups.POINT_GROUP_KEYS.map((key) => pointGroup(key)));
|
|
126
138
|
}
|
|
127
139
|
/**
|
|
128
|
-
* Finds a crystal class by a
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* the
|
|
135
|
-
*
|
|
140
|
+
* Finds a crystal class by a symbol, read tolerantly.
|
|
141
|
+
* It reads, spaces ignored (#96; docs/conventions.md, "Reading symbols"): the key; the short or
|
|
142
|
+
* full symbol of a setting (`312`, `1 1 2`); a Schoenflies symbol, ITA's or ITC Vol. D's (`D3`,
|
|
143
|
+
* `C3i`, `S6`); Birss's cubic symbols without the overbar on the 3 (`m3m`). A symbol that names
|
|
144
|
+
* several settings (the key `32`, which is also the symbol of the setting with rhombohedral axes;
|
|
145
|
+
* `2` for unique axis b, c and a; any Schoenflies symbol) gives the standard (ITC default) setting,
|
|
146
|
+
* unless the options `axes` or `uniqueAxis` choose another, as the headlines of ITA name the
|
|
147
|
+
* settings (the option `axes` set to `'rhombohedral'` for the key `32`).
|
|
148
|
+
*
|
|
149
|
+
* Spellings: the overbar as `-`, `−`, a combining overbar or `¯` after the digit (`m3̄m`), `bar3` (also with a backslash and braces, as in LaTeX);
|
|
150
|
+
* Schoenflies subscripts also as Unicode or LaTeX subscripts (`C₃ᵥ`, `C_{3v}`). Returns `undefined` if nothing matches,
|
|
151
|
+
* also for the symbol of a magnetic group with time reversal; a value that is not a string, and a
|
|
152
|
+
* symbol that names several groups, are a RangeError (the latter lists the groups).
|
|
136
153
|
*/
|
|
137
|
-
export function findPointGroup(
|
|
138
|
-
|
|
154
|
+
export function findPointGroup(symbol, options) {
|
|
155
|
+
if (arguments.length > 2)
|
|
156
|
+
groups.rejectConventionArgument(arguments.length);
|
|
157
|
+
return deepFreeze(groups.findPointGroup(symbol, options));
|
|
139
158
|
}
|
|
140
|
-
/** The settings of a crystal class, with symbols and the
|
|
141
|
-
export function settings(key
|
|
142
|
-
|
|
159
|
+
/** The settings of a crystal class, with their symbols and the ITC default. */
|
|
160
|
+
export function settings(key) {
|
|
161
|
+
groups.rejectConventionArgument(arguments.length);
|
|
162
|
+
return deepFreeze(groups.settings(classKey(key)));
|
|
143
163
|
}
|
|
144
164
|
/**
|
|
145
|
-
* All operations of the crystal class in the requested setting (default: the
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
165
|
+
* All operations of the crystal class in the requested setting (default: the ITC default setting),
|
|
166
|
+
* in ITA's order: identity first, then as ITA numbers the general position (docs/conventions.md,
|
|
167
|
+
* "Order of the operations"). Each operation is ITA's matrix W in the lattice basis of the setting
|
|
168
|
+
* (`matrix`) with the same operation as a Cartesian matrix (`cartesian`; docs/conventions.md,
|
|
169
|
+
* "Operations").
|
|
149
170
|
*/
|
|
150
171
|
export function operations(key, options) {
|
|
151
|
-
return
|
|
172
|
+
return withoutTime(groups.operations(classKey(key), options));
|
|
152
173
|
}
|
|
153
174
|
/**
|
|
154
|
-
* Generators of the crystal class in the requested setting (docs/conventions.md, "Generators")
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* the identity, as in birss-app).
|
|
175
|
+
* Generators of the crystal class in the requested setting (docs/conventions.md, "Generators"):
|
|
176
|
+
* ITA's selected generators in printed order, without the identity and ITA's lattice translations,
|
|
177
|
+
* so the list is empty for `1`; for the settings ITA does not print (`mm2` settings 2 and 3, monoclinic unique axis a), those of setting 1
|
|
178
|
+
* carried into their frame.
|
|
159
179
|
*/
|
|
160
180
|
export function generators(key, options) {
|
|
161
|
-
return
|
|
181
|
+
return withoutTime(groups.generators(classKey(key), options));
|
|
162
182
|
}
|
|
163
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* A symbol of the crystal class in the requested setting, as ITA writes it (Tables 3.2.1.2 and
|
|
185
|
+
* 3.2.3.2: `321`, `C3i`; docs/conventions.md, "Symbols").
|
|
186
|
+
*/
|
|
164
187
|
export function symbol(key, options) {
|
|
165
|
-
|
|
188
|
+
const result = groups.symbol(classKey(key), options);
|
|
189
|
+
// The Schoenflies symbol as ITA writes it (`C3i`); the magnetic API follows ITC Vol. D (`S6`).
|
|
190
|
+
return options?.form === 'schoenflies' ? groups.itaSchoenflies(key) : result;
|
|
166
191
|
}
|
|
167
192
|
// --- properties that follow from operations ---------------------------------------------------------
|
|
168
193
|
export { holohedry } from './pointGroups/properties.js';
|
|
194
|
+
/**
|
|
195
|
+
* The lattice systems of a crystal class: those whose lattices it can act on (ITA § 1.3.4.4.2 and
|
|
196
|
+
* Table 1.3.4.1, p. 39). One for every class but the trigonal ones, which belong to the hexagonal
|
|
197
|
+
* (hP) or the rhombohedral (hR) lattice system depending on the basis, so they give both,
|
|
198
|
+
* `['hexagonal', 'rhombohedral']`. The holohedry of each is `holohedry(latticeSystem)`. Throws a
|
|
199
|
+
* RangeError for an unknown key.
|
|
200
|
+
*/
|
|
201
|
+
export function latticeSystems(key) {
|
|
202
|
+
return groups.latticeSystems(classKey(key));
|
|
203
|
+
}
|
|
169
204
|
/**
|
|
170
205
|
* True if the group generated by `operations` contains the inversion, e.g. for the operations of a
|
|
171
|
-
* distorted crystal.
|
|
172
|
-
* `pointGroup(key).centrosymmetric`. Throws a
|
|
206
|
+
* distorted crystal. The list is closed into a group within the tolerance and made exact first, as
|
|
207
|
+
* `tensorFormOf` does. For a crystal class, read `pointGroup(key).centrosymmetric`. Throws a
|
|
208
|
+
* RangeError as `tensorFormOf`.
|
|
173
209
|
*/
|
|
174
|
-
export function isCentrosymmetricOf(operations) {
|
|
175
|
-
return properties.isCentrosymmetricOf(unitary(operations));
|
|
210
|
+
export function isCentrosymmetricOf(operations, options) {
|
|
211
|
+
return properties.isCentrosymmetricOf(unitary(operations), options);
|
|
176
212
|
}
|
|
177
213
|
/**
|
|
178
|
-
* True if the group generated by `operations` is
|
|
179
|
-
* class, read `pointGroup(key).
|
|
180
|
-
* `allowsPropertyOf(operations, 'pyroelectric')`. Throws a RangeError for
|
|
214
|
+
* True if the group generated by `operations` is enantiomorphic: proper rotations only (ITA
|
|
215
|
+
* § 3.2.2.1.3). For a crystal class, read `pointGroup(key).enantiomorphic`. Polar is the named property `'pyroelectric'`:
|
|
216
|
+
* `allowsPropertyOf(operations, 'pyroelectric')`. Throws a RangeError for an operation without an
|
|
217
|
+
* orthogonal Cartesian matrix (`cartesian`; within the tolerance).
|
|
181
218
|
*/
|
|
182
|
-
export function
|
|
183
|
-
return properties.
|
|
219
|
+
export function isEnantiomorphicOf(operations, options) {
|
|
220
|
+
return properties.isEnantiomorphicOf(unitary(operations), options);
|
|
184
221
|
}
|
|
185
222
|
/**
|
|
186
223
|
* The crystal class generated by a list of Cartesian operations, for instance those left after
|
|
@@ -188,8 +225,7 @@ export function isChiralOf(operations) {
|
|
|
188
225
|
* (absent if the group is the class in another orientation, e.g. a threefold axis along [111]). The
|
|
189
226
|
* list is closed into a group first, two matrices being equal when no entry differs by `tolerance`
|
|
190
227
|
* (default `EPSILON`) or more. Returns undefined if the operations generate no crystal class (an
|
|
191
|
-
* operation of order 5, a group larger than 48). Throws a RangeError for
|
|
192
|
-
* orthogonal (within `tolerance`, at least `EPSILON`). The classes `1` and `-1` have no
|
|
228
|
+
* operation of order 5, a group larger than 48). Throws a RangeError for an operation without an orthogonal Cartesian matrix (`cartesian`; within `tolerance`, at least `EPSILON`). The classes `1` and `-1` have no
|
|
193
229
|
* orientation, so they always have setting 1. The first call builds a table of the groups (about
|
|
194
230
|
* 0.1 s; docs/conventions.md, "Point group of a list of operations").
|
|
195
231
|
*/
|
|
@@ -201,7 +237,7 @@ export function pointGroupOf(operations, options) {
|
|
|
201
237
|
* Cartesian axis (rotation or rotoinversion axis, mirror normal) with its first non-zero component,
|
|
202
238
|
* in the order x, y, z, positive, and for n ≥ 3 the sense about that axis. The axes are not named
|
|
203
239
|
* by lattice directions, since the list need not belong to a setting; for a crystal class given by
|
|
204
|
-
* its key, `describeOperations` names them. Throws a RangeError for
|
|
240
|
+
* its key, `describeOperations` names them. Throws a RangeError for an operation without an orthogonal Cartesian matrix (`cartesian`)
|
|
205
241
|
* or not a crystallographic operation (a rotation part by an angle other than 360°/n, n = 1, 2, 3,
|
|
206
242
|
* 4, 6), both within `tolerance` (default `EPSILON`, as for `pointGroupOf`).
|
|
207
243
|
*/
|
|
@@ -214,26 +250,27 @@ export function describeOperationsOf(operations, options) {
|
|
|
214
250
|
// --- symmetry elements -----------------------------------------------------------------------------
|
|
215
251
|
/**
|
|
216
252
|
* Each operation of the crystal class described geometrically, in the order of `operations` for
|
|
217
|
-
* the same key and options.
|
|
218
|
-
*
|
|
219
|
-
*
|
|
253
|
+
* the same key and options. An axis lies along a symmetry direction and has the sign of the
|
|
254
|
+
* operation's Seitz symbol (ITA 6th ed., Tables 1.4.2.1–1.4.2.3, p. 52), e.g. [1, 1, 0] for 2₁₁₀ in
|
|
255
|
+
* the hexagonal family, where ITA Table 2.1.3.1 lists [1̄, 1̄, 0]; for n ≥ 3 the sign fixes what the
|
|
256
|
+
* sense refers to.
|
|
220
257
|
*/
|
|
221
258
|
export function describeOperations(key, options) {
|
|
222
259
|
const described = elements.describeOperations(classKey(key), options);
|
|
223
260
|
let result = descriptionCache.get(described);
|
|
224
261
|
if (!result) {
|
|
225
|
-
result = Object.freeze(described.map(({ kind,
|
|
262
|
+
result = Object.freeze(described.map(({ kind, n, axis, sense }) => Object.freeze({ kind, n, ...(axis ? { axis } : {}), ...(sense ? { sense } : {}) })));
|
|
226
263
|
descriptionCache.set(described, result);
|
|
227
264
|
}
|
|
228
265
|
return result;
|
|
229
266
|
}
|
|
230
267
|
/**
|
|
231
|
-
* The positions of the full Hermann–Mauguin symbol in the requested
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* without `symbol`); the triclinic family has none.
|
|
235
|
-
*
|
|
236
|
-
*
|
|
268
|
+
* The positions of the full Hermann–Mauguin symbol in the requested setting, each with its
|
|
269
|
+
* symmetry directions (ITA Table 2.1.3.1) and the symmetry elements along them. All positions of the
|
|
270
|
+
* crystal family are listed (for rhombohedral axes the two of that row of the table), also those the
|
|
271
|
+
* symbol of the class leaves out (then without `symbol`); the triclinic family has none. A direction
|
|
272
|
+
* has the sign of ITA Table 2.1.3.1, the axis of an operation along it that of its Seitz symbol, so
|
|
273
|
+
* the two are parallel and may be opposite: match them by direction, up to sign.
|
|
237
274
|
*/
|
|
238
275
|
export function symmetryDirections(key, options) {
|
|
239
276
|
return elements.symmetryDirections(classKey(key), options);
|
|
@@ -245,19 +282,27 @@ export function symmetryDirections(key, options) {
|
|
|
245
282
|
* fixing the direction within the tolerance are closed under the products found in the list and
|
|
246
283
|
* the direction is set onto their fixed space, repeated until stable, so that for a group the
|
|
247
284
|
* result is a subgroup and the set direction lies exactly on its elements. For a list that is not a
|
|
248
|
-
* group, `multiplicity` may not be an integer.
|
|
249
|
-
*
|
|
285
|
+
* group, `multiplicity` may not be an integer. Each operation is read by its Cartesian matrix
|
|
286
|
+
* (`cartesian`). Throws a RangeError for an operation without an orthogonal Cartesian matrix (`cartesian`; within
|
|
250
287
|
* `tolerance`, at least `EPSILON`), for a zero vector, and if the closed operations fix no common
|
|
251
288
|
* direction or do not settle into a group (a tolerance far too large, e.g. 0.5).
|
|
252
289
|
*/
|
|
253
|
-
export function
|
|
290
|
+
export function siteSymmetryOf(operations, direction, options) {
|
|
254
291
|
checkUnitary(operations);
|
|
255
292
|
// The shared function reads the matrices only, so the list of the caller is passed on as it is.
|
|
256
|
-
return site.
|
|
293
|
+
return site.siteSymmetryOf(operations, direction, options);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The site symmetry of a direction (any non-zero Cartesian vector) under a crystal class in a
|
|
297
|
+
* setting: `siteSymmetryOf` applied to `operations(key, options)`, so the indices refer to those
|
|
298
|
+
* operations (#137 C1). Throws a RangeError as `siteSymmetryOf` does.
|
|
299
|
+
*/
|
|
300
|
+
export function siteSymmetry(key, direction, options) {
|
|
301
|
+
return wyckoff.siteSymmetry(classKey(key), direction, options);
|
|
257
302
|
}
|
|
258
303
|
/**
|
|
259
304
|
* The Wyckoff positions of a crystal class for directions, as ITA tabulates them (general position
|
|
260
|
-
* first)
|
|
305
|
+
* first) (docs/conventions.md, "Site symmetry and Wyckoff positions").
|
|
261
306
|
*/
|
|
262
307
|
export function wyckoffPositions(key, options) {
|
|
263
308
|
return wyckoff.wyckoffPositions(classKey(key), options);
|
|
@@ -265,16 +310,16 @@ export function wyckoffPositions(key, options) {
|
|
|
265
310
|
/**
|
|
266
311
|
* The Wyckoff position of a direction (Cartesian) in a crystal class: the position whose site
|
|
267
312
|
* symmetry is conjugate to that of the direction (ITA's definition). `tolerance` as for
|
|
268
|
-
* `
|
|
313
|
+
* `siteSymmetryOf`.
|
|
269
314
|
*/
|
|
270
|
-
export function
|
|
271
|
-
return wyckoff.
|
|
315
|
+
export function wyckoffPosition(key, direction, options) {
|
|
316
|
+
return wyckoff.wyckoffPosition(classKey(key), direction, options);
|
|
272
317
|
}
|
|
273
318
|
// --- lattice basis and orbits ---------------------------------------------------------------------
|
|
274
319
|
/**
|
|
275
320
|
* The operations of a list that keep the metric of a cell: W with WᵀGW = G, G the metric tensor
|
|
276
|
-
* of `basis`. The operations are integer
|
|
277
|
-
* gives them; the list is taken as it is and the kept operations are the ones of the list, in its
|
|
321
|
+
* of `basis`. The operations are read by `matrix`, the integer matrix W on lattice coordinates, as
|
|
322
|
+
* `operations` gives them; the list is taken as it is and the kept operations are the ones of the list, in its
|
|
278
323
|
* order. The deviation counts relative to the largest entry of G (`tolerance`, default
|
|
279
324
|
* `EPSILON`). An operation combined with time reversal belongs to the magnetic API.
|
|
280
325
|
*/
|
|
@@ -282,20 +327,6 @@ export function residualOperations(operations, basis, options) {
|
|
|
282
327
|
checkUnitary(operations);
|
|
283
328
|
return cell.residualOperations(operations, basis, options);
|
|
284
329
|
}
|
|
285
|
-
/**
|
|
286
|
-
* The operations of the crystal class in the conventional lattice basis (a, b, c; for the trigonal
|
|
287
|
-
* classes the hexagonal axes), in the order of `operations` for the same setting and convention:
|
|
288
|
-
* integer matrices W acting on the coordinates of a lattice direction [uvw], W = B⁻¹·R·B with the
|
|
289
|
-
* basis B of `latticeBasis` and the Cartesian matrix R of `operations`. They do not depend on the
|
|
290
|
-
* cell angles, so they exist for every family; for the monoclinic and triclinic families a, b, c
|
|
291
|
-
* are taken along x, y, z, as for the Wyckoff positions. In the ITC convention they are the
|
|
292
|
-
* matrices of ITA's general position (6th ed., Table 3.2.3.2). Not orthogonal in general: pass
|
|
293
|
-
* them to no function that takes Cartesian operations (docs/conventions.md, "Lattice basis and
|
|
294
|
-
* orbits").
|
|
295
|
-
*/
|
|
296
|
-
export function latticeOperations(key, options) {
|
|
297
|
-
return matricesOnly(orbits.latticeOperations(classKey(key), options));
|
|
298
|
-
}
|
|
299
330
|
export function orbit(key, indices, options) {
|
|
300
331
|
return orbits.orbit(classKey(key), indices, options);
|
|
301
332
|
}
|
|
@@ -303,9 +334,9 @@ export function orbit(key, indices, options) {
|
|
|
303
334
|
* The orbit of a direction (any non-zero vector, Cartesian, e.g. a face normal) under a list of
|
|
304
335
|
* operations, for instance those of a distorted crystal: the images of its unit vector under each
|
|
305
336
|
* operation, coinciding images merged (closer than `tolerance`, default `EPSILON`, as for
|
|
306
|
-
* `
|
|
337
|
+
* `siteSymmetryOf`), in the order in which the operations reach them, each with the indices of the
|
|
307
338
|
* operations that map the direction there. The list is taken as it is, not closed into a group.
|
|
308
|
-
* Throws a RangeError for a zero vector and for
|
|
339
|
+
* Throws a RangeError for a zero vector and for an operation without an orthogonal Cartesian matrix (`cartesian`; within
|
|
309
340
|
* `tolerance`, at least `EPSILON`).
|
|
310
341
|
*/
|
|
311
342
|
export function orbitOf(operations, direction, options) {
|
|
@@ -323,19 +354,16 @@ export const CRYSTAL_FORM_TYPES = forms.CRYSTAL_FORM_TYPES;
|
|
|
323
354
|
/**
|
|
324
355
|
* The crystal forms of a crystal class, as ITA 6th ed. Table 3.2.3.2 prints them: for each Wyckoff
|
|
325
356
|
* position (general position first) its basic form (two for the cubic faces (hhl) of -43m and
|
|
326
|
-
* m-3m), then its limiting forms.
|
|
327
|
-
* only, like the Wyckoff positions (docs/conventions.md, "Crystal forms").
|
|
357
|
+
* m-3m), then its limiting forms (docs/conventions.md, "Crystal forms").
|
|
328
358
|
*/
|
|
329
359
|
export function crystalForms(key, options) {
|
|
330
360
|
return forms.crystalForms(classKey(key), options);
|
|
331
361
|
}
|
|
332
362
|
// --- tensors ---------------------------------------------------------------------------------------
|
|
333
363
|
/**
|
|
334
|
-
* The form of a tensor under a crystal class in the requested setting (default: the default
|
|
335
|
-
* setting
|
|
336
|
-
*
|
|
337
|
-
* through the setting: the same setting index gives the same form in both conventions
|
|
338
|
-
* (docs/conventions.md, "Tensors").
|
|
364
|
+
* The form of a tensor under a crystal class in the requested setting (default: the ITC default
|
|
365
|
+
* setting). The tensor is given by its specification or by the name of a property in
|
|
366
|
+
* `TENSOR_PROPERTIES` (`'piezoelectric'`; docs/conventions.md, "Tensors").
|
|
339
367
|
*/
|
|
340
368
|
export function tensorForm(key, spec, options) {
|
|
341
369
|
return tensors.tensorForm(classKey(key), timeEven(spec), options);
|
|
@@ -343,28 +371,61 @@ export function tensorForm(key, spec, options) {
|
|
|
343
371
|
/**
|
|
344
372
|
* The form of a tensor under the group generated by `operations`, e.g. the site symmetry of a
|
|
345
373
|
* surface normal (`siteSymmetry`) or the operations of a distorted crystal. The tensor is given by
|
|
346
|
-
* its specification or by the name of a property in `TENSOR_PROPERTIES`.
|
|
347
|
-
* Cartesian
|
|
348
|
-
*
|
|
374
|
+
* its specification or by the name of a property in `TENSOR_PROPERTIES`. Each operation is read by
|
|
375
|
+
* its Cartesian matrix (`cartesian`), which must be orthogonal. The list is closed into a group
|
|
376
|
+
* within the tolerance, and that group is made exact before the form is computed, so that matrices
|
|
377
|
+
* with rounding errors (e.g. rounded to 6 decimals) give the form of the exact group, with its
|
|
378
|
+
* number of free parameters (docs/conventions.md, "Tolerances"). Throws a RangeError for an
|
|
379
|
+
* operation without an orthogonal Cartesian matrix (`cartesian`; within the tolerance) and for
|
|
380
|
+
* operations that generate no finite group within the tolerance.
|
|
349
381
|
*/
|
|
350
|
-
export function tensorFormOf(operations, spec) {
|
|
351
|
-
return tensors.tensorFormOf(unitary(operations), timeEven(spec));
|
|
382
|
+
export function tensorFormOf(operations, spec, options) {
|
|
383
|
+
return tensors.tensorFormOf(unitary(operations), timeEven(spec), options);
|
|
352
384
|
}
|
|
353
385
|
/**
|
|
354
|
-
* The
|
|
386
|
+
* The tensor `tensor` in a frame rotated by the orthogonal
|
|
355
387
|
* matrix `rotation`: t′_{i…} = f·Σ R_{ia}…R_{…}·t_{a…}, with f = det(R) for an axial tensor and 1
|
|
356
388
|
* for a polar one. To express a tensor in the frame of a surface, pass the matrix whose rows are
|
|
357
389
|
* the new axes in the old frame. The kind of tensor is given by its specification or by the name
|
|
358
|
-
* of a property in `TENSOR_PROPERTIES`.
|
|
390
|
+
* of a property in `TENSOR_PROPERTIES`. Throws a RangeError for a rotation that is not orthogonal
|
|
391
|
+
* within the tolerance (per matrix entry of RᵀR).
|
|
392
|
+
*/
|
|
393
|
+
export function rotateTensor(tensor, rotation, spec, options) {
|
|
394
|
+
return tensors.rotateTensor(tensor, rotation, timeEven(spec), options);
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* A tensor in Voigt's two-index notation (ITC Vol. D (2013) § 1.1.4.10, pp. 24–27): each contracted
|
|
398
|
+
* index pair ij becomes α = 1…6 for 11, 22, 33, 23, 31, 12 (eq. (1.1.4.6)), and a component with
|
|
399
|
+
* α = 4, 5, 6 is the tensor component times the factor of its pair (`factors`). A symmetric tensor of
|
|
400
|
+
* rank 2 gives 6 components, one of rank 3 symmetric in its last pair a 3 × 6 matrix (d_iα), in its
|
|
401
|
+
* first pair a 6 × 3 matrix (e_αk), one of rank 4 a 6 × 6 matrix (s_αβ, c_αβ). Throws a RangeError for a specification
|
|
402
|
+
* without a symmetric index pair, factors that are missing or not one 1 or 2 per pair, and a tensor
|
|
403
|
+
* that lacks the index symmetry of its specification (within the tolerance, relative to its largest
|
|
404
|
+
* component).
|
|
405
|
+
*
|
|
406
|
+
* @remarks The tensor is flat, 3^rank components, as `tensorForm` gives a basis tensor.
|
|
359
407
|
*/
|
|
360
|
-
export function
|
|
361
|
-
return
|
|
408
|
+
export function toVoigt(tensor, spec, options) {
|
|
409
|
+
return voigtNotation.toVoigt(tensor, timeEven(spec), options);
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* The tensor of a Voigt array (`toVoigt` in reverse): each tensor component is the Voigt component
|
|
413
|
+
* of its index pairs over the factors of the pairs, so that the tensor has the index symmetry of its
|
|
414
|
+
* specification. Throws a RangeError for a Voigt array of
|
|
415
|
+
* the wrong shape, and for one that is no tensor of the specification (for rank 4 with interchangeable
|
|
416
|
+
* pairs a 6 × 6 matrix that is not symmetric, for a totally symmetric tensor one whose
|
|
417
|
+
* components do not agree), within the tolerance relative to its largest component.
|
|
418
|
+
*
|
|
419
|
+
* @remarks The tensor is flat, 3^rank components, as `tensorForm` gives a basis tensor.
|
|
420
|
+
*/
|
|
421
|
+
export function fromVoigt(voigt, spec, options) {
|
|
422
|
+
return voigtNotation.fromVoigt(voigt, timeEven(spec), options);
|
|
362
423
|
}
|
|
363
424
|
/**
|
|
364
425
|
* True if the crystal class allows the named property, e.g. `allowsProperty('-6m2',
|
|
365
426
|
* 'piezoelectric')`: the tensor that describes it (`TENSOR_PROPERTIES`) has a non-zero form under
|
|
366
427
|
* the class. Symmetry only allows a property; whether a crystal shows it is a question of the
|
|
367
|
-
* material. It does not depend on setting
|
|
428
|
+
* material. It does not depend on the setting. Throws a RangeError for an unknown key or
|
|
368
429
|
* name.
|
|
369
430
|
*/
|
|
370
431
|
export function allowsProperty(key, name) {
|
|
@@ -372,19 +433,27 @@ export function allowsProperty(key, name) {
|
|
|
372
433
|
}
|
|
373
434
|
/** The named properties the crystal class allows, in the order of `TENSOR_PROPERTIES`. */
|
|
374
435
|
export function allowedProperties(key) {
|
|
375
|
-
return TENSOR_PROPERTY_NAMES.filter((name) => allowsProperty(key, name));
|
|
436
|
+
return deepFreeze(TENSOR_PROPERTY_NAMES.filter((name) => allowsProperty(key, name)));
|
|
376
437
|
}
|
|
377
438
|
/**
|
|
378
439
|
* True if the group generated by `operations` allows the named property, e.g. for the site
|
|
379
|
-
* symmetry of a surface normal or the operations of a distorted crystal. The
|
|
380
|
-
*
|
|
440
|
+
* symmetry of a surface normal or the operations of a distorted crystal. The operations are read
|
|
441
|
+
* and closed as `tensorFormOf` reads them, within the tolerance, and it throws a RangeError as
|
|
442
|
+
* `tensorFormOf` does.
|
|
381
443
|
*/
|
|
382
|
-
export function allowsPropertyOf(operations, name) {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
444
|
+
export function allowsPropertyOf(operations, name, options) {
|
|
445
|
+
checkOptions(options, TOLERANCE_KEYS, 'allowsPropertyOf');
|
|
446
|
+
const checked = propertyName(name);
|
|
447
|
+
const { spec, perms } = tensors.checkedSpec(checked);
|
|
448
|
+
return tensors.formOfGroup(tensors.callerGroup(unitary(operations), options), spec, perms).basis.length > 0;
|
|
449
|
+
}
|
|
450
|
+
/** The named properties the group generated by `operations` allows. Reads the operations as `allowsPropertyOf`. */
|
|
451
|
+
export function allowedPropertiesOf(operations, options) {
|
|
452
|
+
checkOptions(options, TOLERANCE_KEYS, 'allowedPropertiesOf');
|
|
453
|
+
const group = tensors.callerGroup(unitary(operations), options);
|
|
454
|
+
return deepFreeze(TENSOR_PROPERTY_NAMES.filter((name) => {
|
|
455
|
+
const { spec, perms } = tensors.checkedSpec(name);
|
|
456
|
+
return tensors.formOfGroup(group, spec, perms).basis.length > 0;
|
|
457
|
+
}));
|
|
389
458
|
}
|
|
390
459
|
//# sourceMappingURL=crystalClasses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crystalClasses.js","sourceRoot":"","sources":["../src/crystalClasses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AAEvD,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AACvD,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExF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I,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9G,CAAC;AAED,mHAAmH;AACnH,MAAM,UAAU,mBAAmB,CACjC,UAAwC,EACxC,OAA0B;IAE1B,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,qBAAqB,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAC;IAChE,OAAO,UAAU,CACf,qBAAqB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACpC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAClD,OAAO,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAClE,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/freeze.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Freezing of results: every result of the API is frozen, nested arrays and objects included
|
|
3
|
+
* (#137 C4), so that a caller who wants to change one copies it. Internal.
|
|
4
|
+
*/
|
|
5
|
+
/** `value`, frozen with everything it holds (plain arrays and objects). */
|
|
6
|
+
export declare function deepFreeze<T>(value: T): T;
|
|
7
|
+
//# sourceMappingURL=freeze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freeze.d.ts","sourceRoot":"","sources":["../src/freeze.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAOzC"}
|
package/dist/freeze.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Freezing of results: every result of the API is frozen, nested arrays and objects included
|
|
3
|
+
* (#137 C4), so that a caller who wants to change one copies it. Internal.
|
|
4
|
+
*/
|
|
5
|
+
/** `value`, frozen with everything it holds (plain arrays and objects). */
|
|
6
|
+
export function deepFreeze(value) {
|
|
7
|
+
if (value !== null && typeof value === 'object') {
|
|
8
|
+
// Also into a container that is frozen already: its children need not be.
|
|
9
|
+
for (const v of Object.values(value))
|
|
10
|
+
deepFreeze(v);
|
|
11
|
+
Object.freeze(value);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=freeze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freeze.js","sourceRoot":"","sources":["../src/freeze.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAI,KAAQ;IACpC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,0EAA0E;QAC1E,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YAAE,UAAU,CAAC,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|