@ferscloud/fers-calculation-web 0.2.48 → 0.2.49
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/LICENSE +12 -0
- package/fers-models.d.ts +81 -29
- package/fers_calculations.d.ts +10 -0
- package/fers_calculations.js +1 -1
- package/fers_calculations_bg.js +42 -0
- package/fers_calculations_bg.wasm +0 -0
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, Jeroen Hermsen
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
10
|
+
3. Neither the name of the Jeroen Hermsen nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/fers-models.d.ts
CHANGED
|
@@ -162,6 +162,20 @@ export interface components {
|
|
|
162
162
|
* @default false
|
|
163
163
|
*/
|
|
164
164
|
render_unity_reports: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* @description Whitelist of result blocks to emit. `None`/absent (default) = full output
|
|
167
|
+
* (backward compatible). When present, only the listed blocks are emitted:
|
|
168
|
+
* scalar force/displacement blocks are omitted from member results; list/map
|
|
169
|
+
* blocks (`section_forces`, `internal_force_series`, `displacement_nodes`,
|
|
170
|
+
* `reaction_nodes`) are emitted empty. Applies to load cases and load
|
|
171
|
+
* combinations alike. Unity checks, `summary`, `solver_diagnostics`,
|
|
172
|
+
* `errors_and_warnings`, plate/modal/buckling/seismic results and
|
|
173
|
+
* `report_html` are never filtered, and unity checks always evaluate on the
|
|
174
|
+
* full results (the filter is applied after them, just before
|
|
175
|
+
* serialization). `member_displacements` stays governed solely by
|
|
176
|
+
* `include_member_deflected_shape`. An empty list is a maximal strip.
|
|
177
|
+
*/
|
|
178
|
+
result_filter?: components["schemas"]["ResultBlock"][] | null;
|
|
165
179
|
rigid_strategy: components["schemas"]["RigidStrategy"];
|
|
166
180
|
/**
|
|
167
181
|
* Format: int32
|
|
@@ -993,13 +1007,15 @@ export interface components {
|
|
|
993
1007
|
* `T`, and the interior sections inherit it. Consumers that need a
|
|
994
1008
|
* tension-positive axial value (e.g. code checks classifying compression) must
|
|
995
1009
|
* flip the sign of the series value.
|
|
1010
|
+
*
|
|
1011
|
+
* All force/displacement blocks except `section_forces` are `Option` so that
|
|
1012
|
+
* `AnalysisOptions::result_filter` can omit unrequested blocks from the output;
|
|
1013
|
+
* they are always `Some` during the solve and are only set to `None` by the
|
|
1014
|
+
* post-unity-check strip pass (`functions::result_filter`). Absent (default =
|
|
1015
|
+
* no filter) every block is emitted.
|
|
996
1016
|
*/
|
|
997
1017
|
MemberResult: {
|
|
998
|
-
|
|
999
|
-
* @description Member-end force at the end node, in the **global** frame (Newton's-3rd-law
|
|
1000
|
-
* opposite of the start-node internal force).
|
|
1001
|
-
*/
|
|
1002
|
-
end_node_forces: components["schemas"]["NodeForces"];
|
|
1018
|
+
end_node_forces?: null | components["schemas"]["NodeForces"];
|
|
1003
1019
|
/**
|
|
1004
1020
|
* @description Continuous, ready-to-plot internal force diagram from `x_frac = 0` (start) to
|
|
1005
1021
|
* `x_frac = 1` (end), in the local frame: `local_start_forces`, then
|
|
@@ -1008,25 +1024,13 @@ export interface components {
|
|
|
1008
1024
|
* is continuous with no sawtooth across shared nodes.
|
|
1009
1025
|
*/
|
|
1010
1026
|
internal_force_series?: components["schemas"]["SectionForce"][];
|
|
1011
|
-
local_displacement_end_node
|
|
1012
|
-
local_displacement_start_node
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
local_end_forces: components["schemas"]["NodeForces"];
|
|
1019
|
-
/** @description Per-component maxima over the member, in the local frame. */
|
|
1020
|
-
local_maximums: components["schemas"]["NodeForces"];
|
|
1021
|
-
/** @description Per-component minima over the member, in the local frame. */
|
|
1022
|
-
local_minimums: components["schemas"]["NodeForces"];
|
|
1023
|
-
/**
|
|
1024
|
-
* @description Internal force at the start node, in the member **local centroidal** frame
|
|
1025
|
-
* (corotated frame for nonlinear results). Equals `internal_force_series[0]`.
|
|
1026
|
-
*/
|
|
1027
|
-
local_start_forces: components["schemas"]["NodeForces"];
|
|
1028
|
-
/** @description Per-component maxima over the member (global frame). */
|
|
1029
|
-
maximums: components["schemas"]["NodeForces"];
|
|
1027
|
+
local_displacement_end_node?: null | components["schemas"]["NodeDisplacement"];
|
|
1028
|
+
local_displacement_start_node?: null | components["schemas"]["NodeDisplacement"];
|
|
1029
|
+
local_end_forces?: null | components["schemas"]["NodeForces"];
|
|
1030
|
+
local_maximums?: null | components["schemas"]["NodeForces"];
|
|
1031
|
+
local_minimums?: null | components["schemas"]["NodeForces"];
|
|
1032
|
+
local_start_forces?: null | components["schemas"]["NodeForces"];
|
|
1033
|
+
maximums?: null | components["schemas"]["NodeForces"];
|
|
1030
1034
|
/**
|
|
1031
1035
|
* @description Optional sampled deflected shape: the member's global displacement at
|
|
1032
1036
|
* evenly-spaced stations from `x_frac = 0` to `1`, reconstructed by
|
|
@@ -1037,8 +1041,7 @@ export interface components {
|
|
|
1037
1041
|
* is slightly under-rendered (matching client-side Hermite reconstructions).
|
|
1038
1042
|
*/
|
|
1039
1043
|
member_displacements?: components["schemas"]["MemberDisplacementSample"][];
|
|
1040
|
-
|
|
1041
|
-
minimums: components["schemas"]["NodeForces"];
|
|
1044
|
+
minimums?: null | components["schemas"]["NodeForces"];
|
|
1042
1045
|
/**
|
|
1043
1046
|
* @description Continuous internal forces at evenly-spaced **interior** fractions
|
|
1044
1047
|
* (`0 < x_frac < 1`), in the local frame. These already follow the internal-force
|
|
@@ -1046,8 +1049,7 @@ export interface components {
|
|
|
1046
1049
|
* endpoints use [`MemberResult::internal_force_series`].
|
|
1047
1050
|
*/
|
|
1048
1051
|
section_forces: components["schemas"]["SectionForce"][];
|
|
1049
|
-
|
|
1050
|
-
start_node_forces: components["schemas"]["NodeForces"];
|
|
1052
|
+
start_node_forces?: null | components["schemas"]["NodeForces"];
|
|
1051
1053
|
};
|
|
1052
1054
|
/**
|
|
1053
1055
|
* @description A member set represents one physical beam: the ordered chain of collinear
|
|
@@ -1936,6 +1938,24 @@ export interface components {
|
|
|
1936
1938
|
points: number[][];
|
|
1937
1939
|
};
|
|
1938
1940
|
};
|
|
1941
|
+
/**
|
|
1942
|
+
* @description Selectable result-block groups for [`AnalysisOptions::result_filter`].
|
|
1943
|
+
* Wire tokens are snake_case, mirroring the JSON result field names they govern.
|
|
1944
|
+
*
|
|
1945
|
+
* Python:
|
|
1946
|
+
* class ResultBlock(Enum):
|
|
1947
|
+
* LOCAL_ENVELOPES = "local_envelopes"
|
|
1948
|
+
* GLOBAL_ENVELOPES = "global_envelopes"
|
|
1949
|
+
* LOCAL_END_FORCES = "local_end_forces"
|
|
1950
|
+
* GLOBAL_END_FORCES = "global_end_forces"
|
|
1951
|
+
* SECTION_FORCES = "section_forces"
|
|
1952
|
+
* INTERNAL_FORCE_SERIES = "internal_force_series"
|
|
1953
|
+
* LOCAL_DISPLACEMENTS = "local_displacements"
|
|
1954
|
+
* NODE_DISPLACEMENTS = "node_displacements"
|
|
1955
|
+
* REACTIONS = "reactions"
|
|
1956
|
+
* @enum {string}
|
|
1957
|
+
*/
|
|
1958
|
+
ResultBlock: "local_envelopes" | "global_envelopes" | "local_end_forces" | "global_end_forces" | "section_forces" | "internal_force_series" | "local_displacements" | "node_displacements" | "reactions";
|
|
1939
1959
|
ResultType: {
|
|
1940
1960
|
/** Format: int32 */
|
|
1941
1961
|
Loadcase: number;
|
|
@@ -1987,6 +2007,13 @@ export interface components {
|
|
|
1987
2007
|
*/
|
|
1988
2008
|
report_html?: string | null;
|
|
1989
2009
|
seismic?: null | components["schemas"]["SeismicResults"];
|
|
2010
|
+
/**
|
|
2011
|
+
* @description Load combinations that failed to solve and are therefore missing from
|
|
2012
|
+
* `loadcombinations`. Always inspect before trusting envelopes or
|
|
2013
|
+
* unity-check verdicts computed over the surviving combinations.
|
|
2014
|
+
* @default []
|
|
2015
|
+
*/
|
|
2016
|
+
solve_failures: components["schemas"]["SolveFailure"][];
|
|
1990
2017
|
/**
|
|
1991
2018
|
* @description Unity-check results (one entry per check definition), enveloped over the
|
|
1992
2019
|
* applicable load combinations.
|
|
@@ -2289,6 +2316,24 @@ export interface components {
|
|
|
2289
2316
|
name: string;
|
|
2290
2317
|
shape_commands: components["schemas"]["ShapeCommand"][];
|
|
2291
2318
|
};
|
|
2319
|
+
/**
|
|
2320
|
+
* @description A load combination that failed to solve (e.g. second-order non-convergence).
|
|
2321
|
+
* Failed combinations are absent from `ResultsBundle::loadcombinations`, so a
|
|
2322
|
+
* non-empty failure list means the result set is INCOMPLETE. Consumers must
|
|
2323
|
+
* surface this: non-convergence is often the physical signature of
|
|
2324
|
+
* instability — i.e. exactly the governing case.
|
|
2325
|
+
*/
|
|
2326
|
+
SolveFailure: {
|
|
2327
|
+
/**
|
|
2328
|
+
* Format: int32
|
|
2329
|
+
* @description Id of the load combination that failed to solve.
|
|
2330
|
+
*/
|
|
2331
|
+
combination_id: number;
|
|
2332
|
+
/** @description Human-readable solver error (non-convergence, singular system, …). */
|
|
2333
|
+
error: string;
|
|
2334
|
+
/** @description Name of the load combination that failed to solve. */
|
|
2335
|
+
name: string;
|
|
2336
|
+
};
|
|
2292
2337
|
/**
|
|
2293
2338
|
* @description Per-result solver run diagnostics: how the solve for this load case /
|
|
2294
2339
|
* combination actually ran. Populated best-effort; fields that are not
|
|
@@ -2509,13 +2554,20 @@ export interface components {
|
|
|
2509
2554
|
/** @default [] */
|
|
2510
2555
|
per_entity: components["schemas"]["EntityUnityResult"][];
|
|
2511
2556
|
status: components["schemas"]["UnityStatus"];
|
|
2557
|
+
/**
|
|
2558
|
+
* @description Applicable load combinations that failed to solve and therefore could
|
|
2559
|
+
* not be evaluated. Non-empty ⇒ `status` is `Indeterminate` and the
|
|
2560
|
+
* reported utilizations cover only the combinations that solved.
|
|
2561
|
+
* @default []
|
|
2562
|
+
*/
|
|
2563
|
+
unsolved_combination_ids: number[];
|
|
2512
2564
|
};
|
|
2513
2565
|
/**
|
|
2514
2566
|
* @description 4-colour utilization status. Derived from utilization vs the check's
|
|
2515
2567
|
* thresholds `[green→yellow, yellow→orange, orange→red]`.
|
|
2516
2568
|
* @enum {string}
|
|
2517
2569
|
*/
|
|
2518
|
-
UnityStatus: "Green" | "Yellow" | "Orange" | "Red";
|
|
2570
|
+
UnityStatus: "Green" | "Yellow" | "Orange" | "Red" | "Indeterminate";
|
|
2519
2571
|
/** @description Binds a friendly placeholder name (used in `{{name}}`) to a value source. */
|
|
2520
2572
|
VarBinding: {
|
|
2521
2573
|
name: string;
|
package/fers_calculations.d.ts
CHANGED
|
@@ -27,3 +27,13 @@ export function load_fers_from_file(path: string): string;
|
|
|
27
27
|
* `report_html`. Returns the JSON envelope.
|
|
28
28
|
*/
|
|
29
29
|
export function render_reports_from_json(json_data: string): string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Route panic messages to the browser console. wasm32-unknown-unknown does
|
|
33
|
+
* not unwind, so `run_enveloped`'s catch_unwind never fires in the browser —
|
|
34
|
+
* a panic aborts the instance with an opaque `RuntimeError: unreachable`.
|
|
35
|
+
* The hook at least makes the panic message + location readable in the
|
|
36
|
+
* console. Callers must still treat a thrown exception as fatal for the
|
|
37
|
+
* instance and recycle the worker.
|
|
38
|
+
*/
|
|
39
|
+
export function wasm_init(): void;
|
package/fers_calculations.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./fers_calculations_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
wasm.__wbindgen_start();
|
|
7
7
|
export {
|
|
8
|
-
calculate_from_json, calculate_from_json_with_token, load_fers_from_file, render_reports_from_json
|
|
8
|
+
calculate_from_json, calculate_from_json_with_token, load_fers_from_file, render_reports_from_json, wasm_init
|
|
9
9
|
} from "./fers_calculations_bg.js";
|
package/fers_calculations_bg.js
CHANGED
|
@@ -87,13 +87,47 @@ export function render_reports_from_json(json_data) {
|
|
|
87
87
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Route panic messages to the browser console. wasm32-unknown-unknown does
|
|
93
|
+
* not unwind, so `run_enveloped`'s catch_unwind never fires in the browser —
|
|
94
|
+
* a panic aborts the instance with an opaque `RuntimeError: unreachable`.
|
|
95
|
+
* The hook at least makes the panic message + location readable in the
|
|
96
|
+
* console. Callers must still treat a thrown exception as fatal for the
|
|
97
|
+
* instance and recycle the worker.
|
|
98
|
+
*/
|
|
99
|
+
export function wasm_init() {
|
|
100
|
+
wasm.wasm_init();
|
|
101
|
+
}
|
|
90
102
|
export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
|
|
91
103
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
92
104
|
}
|
|
105
|
+
export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
|
|
106
|
+
let deferred0_0;
|
|
107
|
+
let deferred0_1;
|
|
108
|
+
try {
|
|
109
|
+
deferred0_0 = arg0;
|
|
110
|
+
deferred0_1 = arg1;
|
|
111
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
112
|
+
} finally {
|
|
113
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export function __wbg_new_227d7c05414eb861() {
|
|
117
|
+
const ret = new Error();
|
|
118
|
+
return ret;
|
|
119
|
+
}
|
|
93
120
|
export function __wbg_now_86c0d4ba3fa605b8() {
|
|
94
121
|
const ret = Date.now();
|
|
95
122
|
return ret;
|
|
96
123
|
}
|
|
124
|
+
export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
125
|
+
const ret = arg1.stack;
|
|
126
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
127
|
+
const len1 = WASM_VECTOR_LEN;
|
|
128
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
129
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
130
|
+
}
|
|
97
131
|
export function __wbindgen_init_externref_table() {
|
|
98
132
|
const table = wasm.__wbindgen_externrefs;
|
|
99
133
|
const offset = table.grow(4);
|
|
@@ -103,6 +137,14 @@ export function __wbindgen_init_externref_table() {
|
|
|
103
137
|
table.set(offset + 2, true);
|
|
104
138
|
table.set(offset + 3, false);
|
|
105
139
|
}
|
|
140
|
+
let cachedDataViewMemory0 = null;
|
|
141
|
+
function getDataViewMemory0() {
|
|
142
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
143
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
144
|
+
}
|
|
145
|
+
return cachedDataViewMemory0;
|
|
146
|
+
}
|
|
147
|
+
|
|
106
148
|
function getStringFromWasm0(ptr, len) {
|
|
107
149
|
return decodeText(ptr >>> 0, len);
|
|
108
150
|
}
|
|
Binary file
|
package/package.json
CHANGED