handy-diffusion 1.0.4 → 1.0.6

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/ADI.js CHANGED
@@ -17,7 +17,6 @@ export const setADIProperties = (
17
17
  diffusionCoefficient,
18
18
  deltaX,
19
19
  deltaT,
20
- decayRates = 0
21
20
  ) => {
22
21
  WIDTH = width;
23
22
  HEIGHT = height;
@@ -74,16 +73,11 @@ const updateMainDiagonalYstep = (xCoord) => {
74
73
 
75
74
  export const ADI = (
76
75
  concentrationData,
77
- sources,
78
76
  totalNumberOfIterations,
79
77
  allowNegativeValues = false
80
78
  ) => {
81
79
  let reachedNegativeValue = false;
82
80
 
83
- for (let idx = 0; idx < WIDTH * HEIGHT; idx++) {
84
- scaledSources[idx] = sources[idx] * halfDeltaT;
85
- }
86
-
87
81
  const currentConcentrationData = concentrationData;
88
82
 
89
83
  for (let iteration = 0; iteration < totalNumberOfIterations; iteration++) {
package/index.d.ts CHANGED
@@ -9,7 +9,6 @@
9
9
  * @param diffusionCoefficient - Diffusion coefficient
10
10
  * @param deltaX - Spatial step size
11
11
  * @param deltaT - Time step size
12
- * @param decayRate - Decay rate constant (default: 0)
13
12
  */
14
13
  export function setADIProperties(
15
14
  width: number,
@@ -17,7 +16,6 @@ export function setADIProperties(
17
16
  diffusionCoefficient: number,
18
17
  deltaX: number,
19
18
  deltaT: number,
20
- decayRate?: number
21
19
  ): void;
22
20
 
23
21
  /**
@@ -115,4 +113,8 @@ export function thomasAlgorithm(
115
113
  b: Float64Array | number[],
116
114
  c: Float64Array | number[],
117
115
  d: Float64Array | number[]
118
- ): Float64Array;
116
+ ): Float64Array;
117
+
118
+ export function updateSinksAndSources(
119
+ sinks: Float64Array | number[],
120
+ sources: Float64Array | number[]): void;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Import and re-export ADI functions
2
- export { ADI, setADIProperties } from './ADI.js';
2
+ export { ADI, setADIProperties , updateSinksAndSources} from './ADI.js';
3
3
 
4
4
  // Import and re-export Crank-Nicolson functions
5
5
  export { CrankNicolson, setCNProperties } from './CrankNicolson.js';
@@ -11,4 +11,5 @@ export { analyticSteadyState } from './analyticSolution.js';
11
11
  export { efectiveInfluence } from './effective.js';
12
12
 
13
13
  // Import and re-export thomas algorithm
14
- export { thomasAlgorithm } from './thomasAlgorithm.js';
14
+ export { thomasAlgorithm } from './thomasAlgorithm.js';
15
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handy-diffusion",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "algorithms to simulate diffusion",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",