react-cheminfo 0.134.1 → 0.135.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 +13 -0
- package/lib/crystal/core/bondGrid.d.ts +26 -0
- package/lib/crystal/core/bondGrid.d.ts.map +1 -0
- package/lib/crystal/core/bondGrid.js +76 -0
- package/lib/crystal/core/bondGrid.js.map +1 -0
- package/lib/crystal/core/cellBonds.d.ts +21 -0
- package/lib/crystal/core/cellBonds.d.ts.map +1 -0
- package/lib/crystal/core/cellBonds.js +100 -0
- package/lib/crystal/core/cellBonds.js.map +1 -0
- package/lib/crystal/core/cif/element.d.ts +9 -0
- package/lib/crystal/core/cif/element.d.ts.map +1 -0
- package/lib/crystal/core/cif/element.js +41 -0
- package/lib/crystal/core/cif/element.js.map +1 -0
- package/lib/crystal/core/cif/index.d.ts +4 -0
- package/lib/crystal/core/cif/index.d.ts.map +1 -0
- package/lib/crystal/core/cif/index.js +3 -0
- package/lib/crystal/core/cif/index.js.map +1 -0
- package/lib/crystal/core/cif/number.d.ts +27 -0
- package/lib/crystal/core/cif/number.d.ts.map +1 -0
- package/lib/crystal/core/cif/number.js +57 -0
- package/lib/crystal/core/cif/number.js.map +1 -0
- package/lib/crystal/core/cif/read.d.ts +12 -0
- package/lib/crystal/core/cif/read.d.ts.map +1 -0
- package/lib/crystal/core/cif/read.js +183 -0
- package/lib/crystal/core/cif/read.js.map +1 -0
- package/lib/crystal/core/cif/readGeometry.d.ts +17 -0
- package/lib/crystal/core/cif/readGeometry.d.ts.map +1 -0
- package/lib/crystal/core/cif/readGeometry.js +93 -0
- package/lib/crystal/core/cif/readGeometry.js.map +1 -0
- package/lib/crystal/core/cif/tags.d.ts +62 -0
- package/lib/crystal/core/cif/tags.d.ts.map +1 -0
- package/lib/crystal/core/cif/tags.js +115 -0
- package/lib/crystal/core/cif/tags.js.map +1 -0
- package/lib/crystal/core/cif/types.d.ts +158 -0
- package/lib/crystal/core/cif/types.d.ts.map +1 -0
- package/lib/crystal/core/cif/types.js +2 -0
- package/lib/crystal/core/cif/types.js.map +1 -0
- package/lib/crystal/core/components.d.ts +56 -0
- package/lib/crystal/core/components.d.ts.map +1 -0
- package/lib/crystal/core/components.js +132 -0
- package/lib/crystal/core/components.js.map +1 -0
- package/lib/crystal/core/covalentRadii.d.ts +24 -0
- package/lib/crystal/core/covalentRadii.d.ts.map +1 -0
- package/lib/crystal/core/covalentRadii.js +55 -0
- package/lib/crystal/core/covalentRadii.js.map +1 -0
- package/lib/crystal/core/disorder.d.ts +59 -0
- package/lib/crystal/core/disorder.d.ts.map +1 -0
- package/lib/crystal/core/disorder.js +168 -0
- package/lib/crystal/core/disorder.js.map +1 -0
- package/lib/crystal/core/expand.d.ts +62 -0
- package/lib/crystal/core/expand.d.ts.map +1 -0
- package/lib/crystal/core/expand.js +61 -0
- package/lib/crystal/core/expand.js.map +1 -0
- package/lib/crystal/core/index.d.ts +18 -0
- package/lib/crystal/core/index.d.ts.map +1 -0
- package/lib/crystal/core/index.js +12 -0
- package/lib/crystal/core/index.js.map +1 -0
- package/lib/crystal/core/moleculeOf.d.ts +31 -0
- package/lib/crystal/core/moleculeOf.d.ts.map +1 -0
- package/lib/crystal/core/moleculeOf.js +128 -0
- package/lib/crystal/core/moleculeOf.js.map +1 -0
- package/lib/crystal/core/moleculeTypes.d.ts +80 -0
- package/lib/crystal/core/moleculeTypes.d.ts.map +1 -0
- package/lib/crystal/core/moleculeTypes.js +2 -0
- package/lib/crystal/core/moleculeTypes.js.map +1 -0
- package/lib/crystal/core/molecules.d.ts +39 -0
- package/lib/crystal/core/molecules.d.ts.map +1 -0
- package/lib/crystal/core/molecules.js +140 -0
- package/lib/crystal/core/molecules.js.map +1 -0
- package/lib/crystal/core/operations.d.ts +19 -0
- package/lib/crystal/core/operations.d.ts.map +1 -0
- package/lib/crystal/core/operations.js +68 -0
- package/lib/crystal/core/operations.js.map +1 -0
- package/lib/crystal/core/packing.d.ts +43 -0
- package/lib/crystal/core/packing.d.ts.map +1 -0
- package/lib/crystal/core/packing.js +89 -0
- package/lib/crystal/core/packing.js.map +1 -0
- package/lib/crystal/core/periodicBonds.d.ts +57 -0
- package/lib/crystal/core/periodicBonds.d.ts.map +1 -0
- package/lib/crystal/core/periodicBonds.js +167 -0
- package/lib/crystal/core/periodicBonds.js.map +1 -0
- package/lib/crystal/core/resolve.d.ts +61 -0
- package/lib/crystal/core/resolve.d.ts.map +1 -0
- package/lib/crystal/core/resolve.js +149 -0
- package/lib/crystal/core/resolve.js.map +1 -0
- package/lib/crystal/core/spaceGroups/index.d.ts +5 -0
- package/lib/crystal/core/spaceGroups/index.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/index.js +4 -0
- package/lib/crystal/core/spaceGroups/index.js.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupOperations.d.ts +14 -0
- package/lib/crystal/core/spaceGroups/spaceGroupOperations.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupOperations.js +24 -0
- package/lib/crystal/core/spaceGroups/spaceGroupOperations.js.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupRows.d.ts +3 -0
- package/lib/crystal/core/spaceGroups/spaceGroupRows.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupRows.js +536 -0
- package/lib/crystal/core/spaceGroups/spaceGroupRows.js.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupSymbols.d.ts +43 -0
- package/lib/crystal/core/spaceGroups/spaceGroupSymbols.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroupSymbols.js +169 -0
- package/lib/crystal/core/spaceGroups/spaceGroupSymbols.js.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroups.d.ts +78 -0
- package/lib/crystal/core/spaceGroups/spaceGroups.d.ts.map +1 -0
- package/lib/crystal/core/spaceGroups/spaceGroups.js +83 -0
- package/lib/crystal/core/spaceGroups/spaceGroups.js.map +1 -0
- package/lib/crystal/core/symmetry/group.d.ts +15 -0
- package/lib/crystal/core/symmetry/group.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/group.js +37 -0
- package/lib/crystal/core/symmetry/group.js.map +1 -0
- package/lib/crystal/core/symmetry/index.d.ts +8 -0
- package/lib/crystal/core/symmetry/index.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/index.js +6 -0
- package/lib/crystal/core/symmetry/index.js.map +1 -0
- package/lib/crystal/core/symmetry/integerMatrix.d.ts +45 -0
- package/lib/crystal/core/symmetry/integerMatrix.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/integerMatrix.js +139 -0
- package/lib/crystal/core/symmetry/integerMatrix.js.map +1 -0
- package/lib/crystal/core/symmetry/lattice.d.ts +64 -0
- package/lib/crystal/core/symmetry/lattice.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/lattice.js +113 -0
- package/lib/crystal/core/symmetry/lattice.js.map +1 -0
- package/lib/crystal/core/symmetry/operation.d.ts +91 -0
- package/lib/crystal/core/symmetry/operation.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/operation.js +184 -0
- package/lib/crystal/core/symmetry/operation.js.map +1 -0
- package/lib/crystal/core/symmetry/parseOperation.d.ts +18 -0
- package/lib/crystal/core/symmetry/parseOperation.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/parseOperation.js +145 -0
- package/lib/crystal/core/symmetry/parseOperation.js.map +1 -0
- package/lib/crystal/core/symmetry/types.d.ts +29 -0
- package/lib/crystal/core/symmetry/types.d.ts.map +1 -0
- package/lib/crystal/core/symmetry/types.js +5 -0
- package/lib/crystal/core/symmetry/types.js.map +1 -0
- package/lib/crystal/core/symmetryClasses.d.ts +28 -0
- package/lib/crystal/core/symmetryClasses.d.ts.map +1 -0
- package/lib/crystal/core/symmetryClasses.js +93 -0
- package/lib/crystal/core/symmetryClasses.js.map +1 -0
- package/lib/crystal.d.ts +12 -0
- package/lib/crystal.d.ts.map +1 -0
- package/lib/crystal.js +12 -0
- package/lib/crystal.js.map +1 -0
- package/package.json +3 -1
- package/src/crystal/core/bondGrid.ts +98 -0
- package/src/crystal/core/cellBonds.ts +121 -0
- package/src/crystal/core/cif/element.ts +40 -0
- package/src/crystal/core/cif/index.ts +12 -0
- package/src/crystal/core/cif/number.ts +62 -0
- package/src/crystal/core/cif/read.ts +218 -0
- package/src/crystal/core/cif/readGeometry.ts +104 -0
- package/src/crystal/core/cif/tags.ts +143 -0
- package/src/crystal/core/cif/types.ts +164 -0
- package/src/crystal/core/components.ts +183 -0
- package/src/crystal/core/covalentRadii.ts +56 -0
- package/src/crystal/core/disorder.ts +190 -0
- package/src/crystal/core/expand.ts +105 -0
- package/src/crystal/core/index.ts +44 -0
- package/src/crystal/core/moleculeOf.ts +169 -0
- package/src/crystal/core/moleculeTypes.ts +85 -0
- package/src/crystal/core/molecules.ts +165 -0
- package/src/crystal/core/operations.ts +79 -0
- package/src/crystal/core/packing.ts +116 -0
- package/src/crystal/core/periodicBonds.ts +234 -0
- package/src/crystal/core/resolve.ts +187 -0
- package/src/crystal/core/spaceGroups/index.ts +16 -0
- package/src/crystal/core/spaceGroups/spaceGroupOperations.ts +32 -0
- package/src/crystal/core/spaceGroups/spaceGroupRows.ts +536 -0
- package/src/crystal/core/spaceGroups/spaceGroupSymbols.ts +179 -0
- package/src/crystal/core/spaceGroups/spaceGroups.ts +154 -0
- package/src/crystal/core/symmetry/group.ts +42 -0
- package/src/crystal/core/symmetry/index.ts +23 -0
- package/src/crystal/core/symmetry/integerMatrix.ts +153 -0
- package/src/crystal/core/symmetry/lattice.ts +152 -0
- package/src/crystal/core/symmetry/operation.ts +223 -0
- package/src/crystal/core/symmetry/parseOperation.ts +180 -0
- package/src/crystal/core/symmetry/types.ts +32 -0
- package/src/crystal/core/symmetryClasses.ts +105 -0
- package/src/crystal.ts +12 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { resolveStructureSetting } from "./resolve.js";
|
|
2
|
+
import { spaceGroupOperations } from "./spaceGroups/spaceGroupOperations.js";
|
|
3
|
+
import { closure } from "./symmetry/group.js";
|
|
4
|
+
import { operationKey } from "./symmetry/operation.js";
|
|
5
|
+
import { parseOperation } from "./symmetry/parseOperation.js";
|
|
6
|
+
/**
|
|
7
|
+
* The full coset list a structure's asymmetric unit is expanded with.
|
|
8
|
+
*
|
|
9
|
+
* The file's own operations come first, in file order, so an atom's
|
|
10
|
+
* `operationIndex` points at the line of the file that made it. A file that
|
|
11
|
+
* lists only part of the group — one coset of a centred group, or a few
|
|
12
|
+
* generators — is completed: from the setting its symbol names when every
|
|
13
|
+
* listed operation belongs to it, else by composing the listed ones. A file
|
|
14
|
+
* that lists none, or one that cannot be read, is expanded with the setting its
|
|
15
|
+
* Hall symbol, Hermann–Mauguin symbol or number names.
|
|
16
|
+
* @param structure - What `readCif` returned.
|
|
17
|
+
* @returns The operations, the identity among them.
|
|
18
|
+
* @throws {Error} When no listed operation can be used and the file names no space
|
|
19
|
+
* group the catalogue knows.
|
|
20
|
+
*/
|
|
21
|
+
export function structureOperations(structure) {
|
|
22
|
+
const resolved = resolveStructureSetting(structure);
|
|
23
|
+
const listed = readListed(structure.symopsXyz);
|
|
24
|
+
if (typeof listed === 'string' || listed.length === 0) {
|
|
25
|
+
if (resolved.setting !== null) {
|
|
26
|
+
return spaceGroupOperations(resolved.setting);
|
|
27
|
+
}
|
|
28
|
+
throw new Error(typeof listed === 'string'
|
|
29
|
+
? `This CIF names no space group this reader knows, and its operation list cannot be read: ${listed}.`
|
|
30
|
+
: 'This CIF names no space group this reader knows, and lists no symmetry operation.');
|
|
31
|
+
}
|
|
32
|
+
const keys = new Set();
|
|
33
|
+
const operations = [];
|
|
34
|
+
appendNew(operations, keys, listed);
|
|
35
|
+
if (resolved.setting !== null && resolved.agrees === true) {
|
|
36
|
+
appendNew(operations, keys, spaceGroupOperations(resolved.setting));
|
|
37
|
+
return operations;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
appendNew(operations, keys, closure(operations));
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Operations that close on no group are left as the file wrote them.
|
|
44
|
+
}
|
|
45
|
+
return operations;
|
|
46
|
+
}
|
|
47
|
+
function readListed(symopsXyz) {
|
|
48
|
+
const operations = [];
|
|
49
|
+
for (const xyz of symopsXyz) {
|
|
50
|
+
try {
|
|
51
|
+
operations.push(parseOperation(xyz, 3));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return error instanceof Error ? error.message : String(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return operations;
|
|
58
|
+
}
|
|
59
|
+
function appendNew(operations, keys, candidates) {
|
|
60
|
+
for (const operation of candidates) {
|
|
61
|
+
const key = operationKey(operation);
|
|
62
|
+
if (keys.has(key))
|
|
63
|
+
continue;
|
|
64
|
+
keys.add(key);
|
|
65
|
+
operations.push(operation);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/crystal/core/operations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAA2B;IAE3B,MAAM,QAAQ,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC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CAAC;AACpB,CAAC;AAED,SAAS,SAAS,CAChB,UAAsC,EACtC,IAAiB,EACjB,UAA8C;IAE9C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whole molecules instead of atoms cut at the cell walls.
|
|
3
|
+
*
|
|
4
|
+
* The expanded cell holds every atom wrapped into [0, 1), so a molecule lying
|
|
5
|
+
* across a face is drawn in pieces at opposite ends of the box. Here the cell
|
|
6
|
+
* is read as the periodic graph it is: two atoms are bonded, possibly across a
|
|
7
|
+
* face, by the rule handed in — a viewer hands the one it draws bonds with, so
|
|
8
|
+
* what is completed here is exactly what it joins. Each molecule is then moved,
|
|
9
|
+
* whole, to the cell its centre falls in, and appears once per cell.
|
|
10
|
+
*
|
|
11
|
+
* A component that reaches its own translate is not a molecule but a network
|
|
12
|
+
* — rock salt, quartz, a metal — and has no whole to complete: its atoms stay
|
|
13
|
+
* where the cell put them.
|
|
14
|
+
*/
|
|
15
|
+
import type { BondLimit, PackedAtom } from './periodicBonds.ts';
|
|
16
|
+
import type { Lattice } from './symmetry/lattice.ts';
|
|
17
|
+
/** What {@link packMolecules} found. */
|
|
18
|
+
export interface PackingResult {
|
|
19
|
+
/** The atoms, each molecule whole and once per cell. */
|
|
20
|
+
readonly atoms: readonly PackedAtom[];
|
|
21
|
+
/**
|
|
22
|
+
* How many molecules one cell holds: sets of two atoms or more bonded to
|
|
23
|
+
* nothing outside themselves. A lone ion is not counted.
|
|
24
|
+
*/
|
|
25
|
+
readonly molecules: number;
|
|
26
|
+
/** Whether some atoms belong to a network extending through the crystal. */
|
|
27
|
+
readonly extended: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The most atoms per cell the bonds are searched over, so a cell beyond it is
|
|
31
|
+
* drawn as it is rather than holding a page.
|
|
32
|
+
*/
|
|
33
|
+
export declare const MAX_PACKED_ATOMS = 2000;
|
|
34
|
+
/**
|
|
35
|
+
* Complete the molecules of one cell.
|
|
36
|
+
* @param atoms - Every atom of one cell, fractional, wrapped into [0, 1).
|
|
37
|
+
* @param lattice - The cell they sit in.
|
|
38
|
+
* @param bondLimit - When two atoms are bonded.
|
|
39
|
+
* @returns The atoms, molecules whole; the input unchanged when it holds more
|
|
40
|
+
* than {@link MAX_PACKED_ATOMS}.
|
|
41
|
+
*/
|
|
42
|
+
export declare function packMolecules(atoms: readonly PackedAtom[], lattice: Lattice, bondLimit: BondLimit): PackingResult;
|
|
43
|
+
//# sourceMappingURL=packing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packing.d.ts","sourceRoot":"","sources":["../../../src/crystal/core/packing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAKrC;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,GACnB,aAAa,CAsBf"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whole molecules instead of atoms cut at the cell walls.
|
|
3
|
+
*
|
|
4
|
+
* The expanded cell holds every atom wrapped into [0, 1), so a molecule lying
|
|
5
|
+
* across a face is drawn in pieces at opposite ends of the box. Here the cell
|
|
6
|
+
* is read as the periodic graph it is: two atoms are bonded, possibly across a
|
|
7
|
+
* face, by the rule handed in — a viewer hands the one it draws bonds with, so
|
|
8
|
+
* what is completed here is exactly what it joins. Each molecule is then moved,
|
|
9
|
+
* whole, to the cell its centre falls in, and appears once per cell.
|
|
10
|
+
*
|
|
11
|
+
* A component that reaches its own translate is not a molecule but a network
|
|
12
|
+
* — rock salt, quartz, a metal — and has no whole to complete: its atoms stay
|
|
13
|
+
* where the cell put them.
|
|
14
|
+
*/
|
|
15
|
+
import { bondGraph, walkComponents } from "./components.js";
|
|
16
|
+
import { findPeriodicBonds } from "./periodicBonds.js";
|
|
17
|
+
/**
|
|
18
|
+
* The most atoms per cell the bonds are searched over, so a cell beyond it is
|
|
19
|
+
* drawn as it is rather than holding a page.
|
|
20
|
+
*/
|
|
21
|
+
export const MAX_PACKED_ATOMS = 2000;
|
|
22
|
+
/** Slack on a centroid sitting on a cell face, so it lands in one cell only. */
|
|
23
|
+
const CENTRE_TOLERANCE = 1e-6;
|
|
24
|
+
/**
|
|
25
|
+
* Complete the molecules of one cell.
|
|
26
|
+
* @param atoms - Every atom of one cell, fractional, wrapped into [0, 1).
|
|
27
|
+
* @param lattice - The cell they sit in.
|
|
28
|
+
* @param bondLimit - When two atoms are bonded.
|
|
29
|
+
* @returns The atoms, molecules whole; the input unchanged when it holds more
|
|
30
|
+
* than {@link MAX_PACKED_ATOMS}.
|
|
31
|
+
*/
|
|
32
|
+
export function packMolecules(atoms, lattice, bondLimit) {
|
|
33
|
+
const count = atoms.length;
|
|
34
|
+
if (count === 0 || count > MAX_PACKED_ATOMS) {
|
|
35
|
+
return { atoms, molecules: 0, extended: false };
|
|
36
|
+
}
|
|
37
|
+
const graph = bondGraph(count, findPeriodicBonds(atoms, lattice, bondLimit));
|
|
38
|
+
const { components, shifts } = walkComponents(graph);
|
|
39
|
+
const packed = [];
|
|
40
|
+
let molecules = 0;
|
|
41
|
+
let extended = false;
|
|
42
|
+
for (const component of components) {
|
|
43
|
+
if (component.periodicity > 0) {
|
|
44
|
+
extended = true;
|
|
45
|
+
for (const index of component.atoms) {
|
|
46
|
+
packed.push(atoms[index]);
|
|
47
|
+
}
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (component.atoms.length > 1)
|
|
51
|
+
molecules++;
|
|
52
|
+
pushMolecule(packed, atoms, component.atoms, shifts);
|
|
53
|
+
}
|
|
54
|
+
return { atoms: packed, molecules, extended };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Add one molecule, moved whole to the cell its centre falls in.
|
|
58
|
+
* @param packed - The atoms placed so far, appended to.
|
|
59
|
+
* @param atoms - The atoms of the cell.
|
|
60
|
+
* @param members - The atoms of the molecule.
|
|
61
|
+
* @param shifts - The cell each atom was reached in.
|
|
62
|
+
*/
|
|
63
|
+
function pushMolecule(packed, atoms, members, shifts) {
|
|
64
|
+
const centre = [0, 0, 0];
|
|
65
|
+
for (const index of members) {
|
|
66
|
+
const position = atoms[index].position;
|
|
67
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
68
|
+
centre[axis] =
|
|
69
|
+
(centre[axis] ?? 0) +
|
|
70
|
+
(position[axis] ?? 0) +
|
|
71
|
+
(shifts[index * 3 + axis] ?? 0);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const move = [0, 0, 0];
|
|
75
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
76
|
+
const mean = (centre[axis] ?? 0) / members.length;
|
|
77
|
+
move[axis] = -Math.floor(mean + CENTRE_TOLERANCE);
|
|
78
|
+
}
|
|
79
|
+
for (const index of members) {
|
|
80
|
+
const atom = atoms[index];
|
|
81
|
+
const position = [0, 0, 0];
|
|
82
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
83
|
+
const shift = shifts[index * 3 + axis] ?? 0;
|
|
84
|
+
position[axis] = (atom.position[axis] ?? 0) + shift + (move[axis] ?? 0);
|
|
85
|
+
}
|
|
86
|
+
packed.push({ element: atom.element, position });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=packing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packing.js","sourceRoot":"","sources":["../../../src/crystal/core/packing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAgBvD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,gFAAgF;AAChF,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,KAA4B,EAC5B,OAAgB,EAChB,SAAoB;IAEpB,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3B,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,GAAG,gBAAgB,EAAE,CAAC;QAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClD,CAAC;IACD,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IAC7E,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACrD,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,IAAI,SAAS,GAAG,CAA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IAAI,GAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjD,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;QAClD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,gBAAgB,CAAC,CAAC;IACpD,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAe,CAAC;QACxC,MAAM,QAAQ,GAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACrD,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;YACpC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1E,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bonds of one cell, found across its faces.
|
|
3
|
+
*
|
|
4
|
+
* The atoms are binned on a grid of the cell itself, each bin at least one
|
|
5
|
+
* bond long across, so an atom is compared only with the atoms of its own bin
|
|
6
|
+
* and of the bins around it — wrapped across the faces with the cell they lie
|
|
7
|
+
* in — rather than with every atom of 27 cells. A cell a bond is longer than
|
|
8
|
+
* is searched over as many cells as the bond can reach.
|
|
9
|
+
*/
|
|
10
|
+
import type { Lattice } from './symmetry/lattice.ts';
|
|
11
|
+
/**
|
|
12
|
+
* The longest bond between two elements, in ångström; 0 for a pair never
|
|
13
|
+
* bonded.
|
|
14
|
+
*/
|
|
15
|
+
export type BondLimit = (a: string, b: string) => number;
|
|
16
|
+
/** One atom of a cell, in fractional coordinates. */
|
|
17
|
+
export interface PackedAtom {
|
|
18
|
+
readonly element: string;
|
|
19
|
+
readonly position: readonly [number, number, number];
|
|
20
|
+
}
|
|
21
|
+
/** The bonded pairs of one cell, each listed once. */
|
|
22
|
+
export interface PeriodicPairs {
|
|
23
|
+
/** How many pairs. */
|
|
24
|
+
readonly count: number;
|
|
25
|
+
/** The first atom of each pair. */
|
|
26
|
+
readonly from: Int32Array;
|
|
27
|
+
/** The second atom of each pair; never lower than `from`. */
|
|
28
|
+
readonly to: Int32Array;
|
|
29
|
+
/** The cell `to` is bonded in, seen from `from`: three integers per pair. */
|
|
30
|
+
readonly shifts: Int32Array;
|
|
31
|
+
/** The length of each bond, Å. */
|
|
32
|
+
readonly lengths: Float64Array;
|
|
33
|
+
/**
|
|
34
|
+
* The pairs of atoms closer than `samePlace`, which are one atom written
|
|
35
|
+
* twice and are never bonded: `[i, j, i, j, …]`, each `i` below its `j`.
|
|
36
|
+
*/
|
|
37
|
+
readonly coincident: Int32Array;
|
|
38
|
+
}
|
|
39
|
+
/** Options of {@link findPeriodicBonds}. */
|
|
40
|
+
export interface PeriodicBondOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Two atoms closer than this, in ångström, are one atom written twice.
|
|
43
|
+
* @default 1e-4
|
|
44
|
+
*/
|
|
45
|
+
readonly samePlace?: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Every bond of one cell, each from an atom of the cell to an atom of it or of
|
|
49
|
+
* a cell around it.
|
|
50
|
+
* @param atoms - The atoms of one cell, fractional, wrapped into [0, 1).
|
|
51
|
+
* @param lattice - The cell they sit in.
|
|
52
|
+
* @param bondLimit - When two atoms are bonded.
|
|
53
|
+
* @param options - Options.
|
|
54
|
+
* @returns The bonded pairs, and the atoms written twice.
|
|
55
|
+
*/
|
|
56
|
+
export declare function findPeriodicBonds(atoms: readonly PackedAtom[], lattice: Lattice, bondLimit: BondLimit, options?: PeriodicBondOptions): PeriodicPairs;
|
|
57
|
+
//# sourceMappingURL=periodicBonds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"periodicBonds.d.ts","sourceRoot":"","sources":["../../../src/crystal/core/periodicBonds.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAEzD,qDAAqD;AACrD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACtD;AAED,sDAAsD;AACtD,MAAM,WAAW,aAAa;IAC5B,sBAAsB;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,kCAAkC;IAClC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACjC;AAED,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,GAAE,mBAAwB,GAChC,aAAa,CA+Df"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bonds of one cell, found across its faces.
|
|
3
|
+
*
|
|
4
|
+
* The atoms are binned on a grid of the cell itself, each bin at least one
|
|
5
|
+
* bond long across, so an atom is compared only with the atoms of its own bin
|
|
6
|
+
* and of the bins around it — wrapped across the faces with the cell they lie
|
|
7
|
+
* in — rather than with every atom of 27 cells. A cell a bond is longer than
|
|
8
|
+
* is searched over as many cells as the bond can reach.
|
|
9
|
+
*/
|
|
10
|
+
import { createGrid } from "./bondGrid.js";
|
|
11
|
+
/**
|
|
12
|
+
* Every bond of one cell, each from an atom of the cell to an atom of it or of
|
|
13
|
+
* a cell around it.
|
|
14
|
+
* @param atoms - The atoms of one cell, fractional, wrapped into [0, 1).
|
|
15
|
+
* @param lattice - The cell they sit in.
|
|
16
|
+
* @param bondLimit - When two atoms are bonded.
|
|
17
|
+
* @param options - Options.
|
|
18
|
+
* @returns The bonded pairs, and the atoms written twice.
|
|
19
|
+
*/
|
|
20
|
+
export function findPeriodicBonds(atoms, lattice, bondLimit, options = {}) {
|
|
21
|
+
const { samePlace = 1e-4 } = options;
|
|
22
|
+
const count = atoms.length;
|
|
23
|
+
const kinds = elementKinds(atoms);
|
|
24
|
+
const limits = pairLimits(kinds.symbols, bondLimit);
|
|
25
|
+
let reach = samePlace;
|
|
26
|
+
for (let index = 0; index < limits.length; index++) {
|
|
27
|
+
reach = Math.max(reach, limits[index] ?? 0);
|
|
28
|
+
}
|
|
29
|
+
const xyz = cartesianOf(atoms, lattice);
|
|
30
|
+
const grid = createGrid(atoms, lattice, reach);
|
|
31
|
+
const found = new PairBuffer();
|
|
32
|
+
const reachSquared = reach * reach;
|
|
33
|
+
const sameSquared = samePlace * samePlace;
|
|
34
|
+
const kindCount = kinds.symbols.length;
|
|
35
|
+
const { counts, reaches, start, members, cells } = grid;
|
|
36
|
+
const [na, nb, nc] = counts;
|
|
37
|
+
const [ka, kb, kc] = reaches;
|
|
38
|
+
const m = lattice.cartesian;
|
|
39
|
+
for (let i = 0; i < count; i++) {
|
|
40
|
+
const xi = xyz[i * 3] ?? 0;
|
|
41
|
+
const yi = xyz[i * 3 + 1] ?? 0;
|
|
42
|
+
const zi = xyz[i * 3 + 2] ?? 0;
|
|
43
|
+
const row = (kinds.indices[i] ?? 0) * kindCount;
|
|
44
|
+
for (let oa = -ka; oa <= ka; oa++) {
|
|
45
|
+
const ta = (cells[i * 3] ?? 0) + oa;
|
|
46
|
+
const sa = Math.floor(ta / na);
|
|
47
|
+
for (let ob = -kb; ob <= kb; ob++) {
|
|
48
|
+
const tb = (cells[i * 3 + 1] ?? 0) + ob;
|
|
49
|
+
const sb = Math.floor(tb / nb);
|
|
50
|
+
for (let oc = -kc; oc <= kc; oc++) {
|
|
51
|
+
const tc = (cells[i * 3 + 2] ?? 0) + oc;
|
|
52
|
+
const sc = Math.floor(tc / nc);
|
|
53
|
+
const positive = sa > 0 || (sa === 0 && (sb > 0 || (sb === 0 && sc > 0)));
|
|
54
|
+
const bin = ((ta - sa * na) * nb + (tb - sb * nb)) * nc + (tc - sc * nc);
|
|
55
|
+
const ox = shiftAxis(m, 0, sa, sb, sc) - xi;
|
|
56
|
+
const oy = shiftAxis(m, 1, sa, sb, sc) - yi;
|
|
57
|
+
const oz = shiftAxis(m, 2, sa, sb, sc) - zi;
|
|
58
|
+
const last = start[bin + 1] ?? 0;
|
|
59
|
+
for (let slot = start[bin] ?? 0; slot < last; slot++) {
|
|
60
|
+
const j = members[slot] ?? 0;
|
|
61
|
+
if (j < i || (j === i && !positive))
|
|
62
|
+
continue;
|
|
63
|
+
const dx = (xyz[j * 3] ?? 0) + ox;
|
|
64
|
+
const dy = (xyz[j * 3 + 1] ?? 0) + oy;
|
|
65
|
+
const dz = (xyz[j * 3 + 2] ?? 0) + oz;
|
|
66
|
+
const squared = dx * dx + dy * dy + dz * dz;
|
|
67
|
+
if (squared > reachSquared)
|
|
68
|
+
continue;
|
|
69
|
+
if (squared < sameSquared) {
|
|
70
|
+
if (j !== i)
|
|
71
|
+
found.coincide(i, j);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const limit = limits[row + (kinds.indices[j] ?? 0)] ?? 0;
|
|
75
|
+
if (squared > limit * limit)
|
|
76
|
+
continue;
|
|
77
|
+
found.bond(i, j, sa, sb, sc, Math.sqrt(squared));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return found.result();
|
|
84
|
+
}
|
|
85
|
+
function shiftAxis(m, axis, sa, sb, sc) {
|
|
86
|
+
const row = m[axis];
|
|
87
|
+
return (row?.[0] ?? 0) * sa + (row?.[1] ?? 0) * sb + (row?.[2] ?? 0) * sc;
|
|
88
|
+
}
|
|
89
|
+
function cartesianOf(atoms, lattice) {
|
|
90
|
+
const m = lattice.cartesian;
|
|
91
|
+
const xyz = new Float64Array(atoms.length * 3);
|
|
92
|
+
for (let index = 0; index < atoms.length; index++) {
|
|
93
|
+
const [x, y, z] = atoms[index].position;
|
|
94
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
95
|
+
const row = m[axis];
|
|
96
|
+
xyz[index * 3 + axis] =
|
|
97
|
+
(row?.[0] ?? 0) * x + (row?.[1] ?? 0) * y + (row?.[2] ?? 0) * z;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return xyz;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The elements present, and which of them each atom is.
|
|
104
|
+
* @param atoms - The atoms of the cell.
|
|
105
|
+
* @returns The index of each atom’s element, and the elements.
|
|
106
|
+
*/
|
|
107
|
+
function elementKinds(atoms) {
|
|
108
|
+
const indices = new Int32Array(atoms.length);
|
|
109
|
+
const symbols = [];
|
|
110
|
+
const known = new Map();
|
|
111
|
+
for (let index = 0; index < atoms.length; index++) {
|
|
112
|
+
const element = atoms[index].element;
|
|
113
|
+
let kind = known.get(element);
|
|
114
|
+
if (kind === undefined) {
|
|
115
|
+
kind = symbols.length;
|
|
116
|
+
known.set(element, kind);
|
|
117
|
+
symbols.push(element);
|
|
118
|
+
}
|
|
119
|
+
indices[index] = kind;
|
|
120
|
+
}
|
|
121
|
+
return { indices, symbols };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The bond limit of every pair of the elements present, row-major.
|
|
125
|
+
* @param symbols - The elements present.
|
|
126
|
+
* @param bondLimit - When two atoms are bonded.
|
|
127
|
+
* @returns The limits, row-major over the elements present.
|
|
128
|
+
*/
|
|
129
|
+
function pairLimits(symbols, bondLimit) {
|
|
130
|
+
const size = symbols.length;
|
|
131
|
+
const limits = new Float64Array(size * size);
|
|
132
|
+
for (let a = 0; a < size; a++) {
|
|
133
|
+
for (let b = 0; b < size; b++) {
|
|
134
|
+
const limit = bondLimit(symbols[a] ?? '', symbols[b] ?? '');
|
|
135
|
+
limits[a * size + b] = Math.max(limit, 0);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return limits;
|
|
139
|
+
}
|
|
140
|
+
/** The pairs as they are found, turned into typed arrays once at the end. */
|
|
141
|
+
class PairBuffer {
|
|
142
|
+
#from = [];
|
|
143
|
+
#to = [];
|
|
144
|
+
#shifts = [];
|
|
145
|
+
#lengths = [];
|
|
146
|
+
#coincident = [];
|
|
147
|
+
bond(i, j, sa, sb, sc, length) {
|
|
148
|
+
this.#from.push(i);
|
|
149
|
+
this.#to.push(j);
|
|
150
|
+
this.#shifts.push(sa, sb, sc);
|
|
151
|
+
this.#lengths.push(length);
|
|
152
|
+
}
|
|
153
|
+
coincide(i, j) {
|
|
154
|
+
this.#coincident.push(i, j);
|
|
155
|
+
}
|
|
156
|
+
result() {
|
|
157
|
+
return {
|
|
158
|
+
count: this.#from.length,
|
|
159
|
+
from: Int32Array.from(this.#from),
|
|
160
|
+
to: Int32Array.from(this.#to),
|
|
161
|
+
shifts: Int32Array.from(this.#shifts),
|
|
162
|
+
lengths: Float64Array.from(this.#lengths),
|
|
163
|
+
coincident: Int32Array.from(this.#coincident),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=periodicBonds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"periodicBonds.js","sourceRoot":"","sources":["../../../src/crystal/core/periodicBonds.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA2C3C;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAA4B,EAC5B,OAAgB,EAChB,SAAoB,EACpB,UAA+B,EAAE;IAEjC,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3B,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACpD,IAAI,KAAK,GAAG,SAAS,CAAC;IACtB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACnD,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,M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AAC;IAC9B,CAAC;IAED,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;YACxB,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACjC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;YAC7B,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACrC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;YACzC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;SAC9C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which setting a file is written in.
|
|
3
|
+
*
|
|
4
|
+
* A CIF names its group up to four ways and they do not always agree, so the
|
|
5
|
+
* order matters: the Hall symbol pins a setting on its own, a Hermann–Mauguin
|
|
6
|
+
* symbol usually does, a number alone never does. The operations in the file
|
|
7
|
+
* are then checked against whatever won, because a file whose symbol and
|
|
8
|
+
* operations disagree is common and the operations are what the structure
|
|
9
|
+
* actually has.
|
|
10
|
+
*/
|
|
11
|
+
import type { CrystalStructure } from './cif/types.ts';
|
|
12
|
+
import type { SpaceGroupSetting } from './spaceGroups/spaceGroups.ts';
|
|
13
|
+
/** What the file says its group is, and whether it says it twice the same way. */
|
|
14
|
+
export interface ResolvedSetting {
|
|
15
|
+
/** The setting to build the cell in, or `null` when the file names none. */
|
|
16
|
+
readonly setting: SpaceGroupSetting | null;
|
|
17
|
+
/** Which field decided it. */
|
|
18
|
+
readonly from: 'hall' | 'symbol' | 'number' | 'operations' | null;
|
|
19
|
+
/** Every setting the file's symbol matches, `setting` first. */
|
|
20
|
+
readonly candidates: readonly SpaceGroupSetting[];
|
|
21
|
+
/**
|
|
22
|
+
* The setting the file's own operation list is. Searched only when the symbol
|
|
23
|
+
* decided nothing or disagreed with it, because the search reads every one of
|
|
24
|
+
* the 521 settings.
|
|
25
|
+
*/
|
|
26
|
+
readonly fromOperations: SpaceGroupSetting | null;
|
|
27
|
+
/**
|
|
28
|
+
* Whether every operation the file lists belongs to `setting`. `null` when
|
|
29
|
+
* the file lists none, which is the usual case for a published structure.
|
|
30
|
+
*/
|
|
31
|
+
readonly agrees: boolean | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Read a structure's space group off the file.
|
|
35
|
+
* @param structure - What `readCif` returned.
|
|
36
|
+
* @returns The setting and how it was decided; `setting` is `null` only when
|
|
37
|
+
* the file names no group the catalogue recognises.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveStructureSetting(structure: CrystalStructure): ResolvedSetting;
|
|
40
|
+
/**
|
|
41
|
+
* Whether every operation the file lists is an operation of the setting.
|
|
42
|
+
*
|
|
43
|
+
* A file often lists one coset of a centred group and leaves the centring to
|
|
44
|
+
* the symbol, so the test is containment rather than equality: a shorter list
|
|
45
|
+
* is not a disagreement, an operation outside the group is.
|
|
46
|
+
* @param symopsXyz - The operation triplets the file carries, verbatim.
|
|
47
|
+
* @param setting - The setting they are checked against.
|
|
48
|
+
* @returns `null` when the file lists no operation; `false` when one of them is
|
|
49
|
+
* not the setting's, a triplet nothing can parse included.
|
|
50
|
+
*/
|
|
51
|
+
export declare function operationsBelong(symopsXyz: readonly string[], setting: SpaceGroupSetting): boolean | null;
|
|
52
|
+
/**
|
|
53
|
+
* The one setting whose coset list is exactly the file's, or `null`.
|
|
54
|
+
*
|
|
55
|
+
* The last resort — a file with operations and no readable symbol — and what
|
|
56
|
+
* names the group when a file contradicts its own symbol.
|
|
57
|
+
* @param symopsXyz - The operation triplets the file carries.
|
|
58
|
+
* @returns The setting, or `null` when none matches exactly.
|
|
59
|
+
*/
|
|
60
|
+
export declare function settingOfOperations(symopsXyz: readonly string[]): SpaceGroupSetting | null;
|
|
61
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../src/crystal/core/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKtE,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC3C,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;IAClE,gEAAgE;IAChE,QAAQ,CAAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClD;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,gBAAgB,GAC1B,eAAe,CA4CjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,OAAO,EAAE,iBAAiB,GACzB,OAAO,GAAG,IAAI,CAQhB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,iBAAiB,GAAG,IAAI,CAoB1B"}
|