driftlet 0.13.0 → 0.14.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 +1 -1
- package/docs/device.md +10 -5
- package/docs/kit.md +57 -1
- package/docs/logo-dark.svg +3 -2
- package/docs/logo.svg +3 -2
- package/docs/reliability.md +1 -1
- package/llms.txt +293 -333
- package/package.json +1 -1
- package/src/checks.js +5 -1
- package/src/device.js +55 -0
- package/src/kit.js +1 -0
- package/src/particles.js +331 -0
- package/src/solution.js +26 -2
- package/src/solver.js +89 -2
- package/types/checks.d.ts +2 -1
- package/types/kit.d.ts +1 -0
- package/types/particles.d.ts +42 -0
- package/types/solution.d.ts +1 -0
- package/types/solver.d.ts +4 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A swarm of dots sampling a solution's concentrations and fluxes. Amounts are per area (a planar
|
|
3
|
+
* device's). `step(dt)` moves them on in the device's time, at the rates of the solution last
|
|
4
|
+
* given; `update(sol)` gives a new one.
|
|
5
|
+
* @param {object} sol a solution (from solve(), advance(), live(), …)
|
|
6
|
+
* @param {object} [opts]
|
|
7
|
+
* @param {string[]} [opts.species] which species (default: every species with a concentration)
|
|
8
|
+
* @param {number} [opts.dots] about how many dots per species (default 200), for the default weight
|
|
9
|
+
* @param {number|object} [opts.weight] amount per dot, mol/m²: one number for every species (so
|
|
10
|
+
* their dots compare), or { name: weight }; default, each species' total over `dots`
|
|
11
|
+
* @param {number} [opts.cap] the most dots a cell holds on average before it's a sea (default ∞)
|
|
12
|
+
* @param {number} [opts.cells] about how many cells across the device (default 120)
|
|
13
|
+
* @param {() => number} [opts.random] a uniform random source in [0, 1) (default Math.random)
|
|
14
|
+
*/
|
|
15
|
+
export function particles(sol: object, { species, dots, weight, cap, cells, random }?: {
|
|
16
|
+
species?: string[];
|
|
17
|
+
dots?: number;
|
|
18
|
+
weight?: number | object;
|
|
19
|
+
cap?: number;
|
|
20
|
+
cells?: number;
|
|
21
|
+
random?: () => number;
|
|
22
|
+
}): {
|
|
23
|
+
cells: {
|
|
24
|
+
x0: any;
|
|
25
|
+
x1: any;
|
|
26
|
+
region: any;
|
|
27
|
+
}[];
|
|
28
|
+
species: any;
|
|
29
|
+
weight: {};
|
|
30
|
+
sea: {};
|
|
31
|
+
dots: any[];
|
|
32
|
+
events: any[];
|
|
33
|
+
crossed: {};
|
|
34
|
+
time: number;
|
|
35
|
+
update: (next: any, { resample }?: {
|
|
36
|
+
resample?: boolean;
|
|
37
|
+
}) => /*elided*/ any;
|
|
38
|
+
step: (dt: any, { maxHops }?: {
|
|
39
|
+
maxHops?: number;
|
|
40
|
+
}) => /*elided*/ any;
|
|
41
|
+
expected: (nm: any) => Float64Array<ArrayBuffer>;
|
|
42
|
+
};
|
package/types/solution.d.ts
CHANGED
package/types/solver.d.ts
CHANGED
|
@@ -209,9 +209,11 @@ export class Solver {
|
|
|
209
209
|
mixWork: Float64Array<any>[];
|
|
210
210
|
_dc(g: any, k: any, d: any): void;
|
|
211
211
|
bulkRate(rx: any, g: any): number;
|
|
212
|
+
bulkForward(rx: any, g: any): any;
|
|
212
213
|
bulkOneWay(rx: any, g: any): number;
|
|
213
214
|
_srhRate(law: any, cn: any, cp: any, a: any): {
|
|
214
215
|
rate: number;
|
|
216
|
+
forward: number;
|
|
215
217
|
oneWay: number;
|
|
216
218
|
Cn: number;
|
|
217
219
|
Cp: number;
|
|
@@ -387,6 +389,8 @@ export class Solver {
|
|
|
387
389
|
g: any[];
|
|
388
390
|
d: any[];
|
|
389
391
|
}[];
|
|
392
|
+
segmentFluxes(): Float64Array<ArrayBuffer>[];
|
|
393
|
+
faceOneWay(f: any): any;
|
|
390
394
|
_smallSignalProfiles(xr: any, xi: any): {
|
|
391
395
|
phi: {
|
|
392
396
|
re: Float64Array<any>;
|