Skip to content

Commit 79d7e2f

Browse files
committed
Update the docs for FEAScript-core 0.4.2 and the lite build
The current docs are labeled 0.4.2, and the jsDelivr example, the version examples and llms.txt name 0.4.2. The Installation page has a Lite build section: what the smaller file has and leaves out, its size, the script-tag and npm forms, and that it runs under a strict Content Security Policy. The Solvers page and the FEAScriptModel constructor say that the lite build has only frontal (its default) and Jacobi, and llms.txt describes the lite build for coding assistants. Signed-off-by: Nikos Chamakos <nikoscham@gmail.com>
1 parent 7c3ebab commit 79d7e2f

7 files changed

Lines changed: 64 additions & 17 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ npx -y -p node@20 -c "npm run build && npm run serve"
3535
- Verification: `python3 scripts/generate-verification-figures.py`, which reads the Gmsh meshes from `../FEAScript-core/tests/meshes`.
3636
- Examples: `node scripts/export-example-results.mjs` runs the Node.js examples of `../FEAScript-core` (built with `npm run build`) unchanged and records their meshes and solutions; then `python3 scripts/generate-example-figures.py` draws the geometries, meshes and results.
3737
- Log-log plots (convergence, comparison with Elmer, solver times): `python3 scripts/generate-plot-figures.py`. Their values are those of the tables next to each plot; update both together.
38-
- `docs/` always holds the docs of the current FEAScript-core version ("0.4.1" in the version dropdown).
38+
- `docs/` always holds the docs of the current FEAScript-core version ("0.4.2" in the version dropdown).
3939
- `static/llms.txt` (served at `docs.feascript.com/llms.txt`) is a hand-written, single-file API summary for AI assistants. Update it whenever the API changes: new models, options, boundary conditions or solvers.
4040

4141
## Appearance

‎docs/api/feascript-model.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const { solutionVector, nodesCoordinates } = model.solve();
2525

2626
### `new FEAScriptModel()`
2727

28-
Creates an empty model. The solver method defaults to `"lusolve"`.
28+
Creates an empty model. The solver method defaults to `"lusolve"` (`"frontal"` in the
29+
[lite build](../getting-started/installation.md#lite-build)).
2930

3031
## Methods
3132

‎docs/api/utilities.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ at every level.
3131
```javascript
3232
import { version } from "feascript";
3333

34-
console.log("FEAScript version:", version); // "0.4.1"
34+
console.log("FEAScript version:", version); // "0.4.2"
3535
```
3636

37-
A string constant with the version of the library, as in its npm package (`"0.4.1"`; a release candidate reads
37+
A string constant with the version of the library, as in its npm package (`"0.4.2"`; a release candidate reads
3838
`"0.4.0-rc.1"`).
3939

4040
`printVersion`, the name used up to FEAScript 0.3, is still exported but deprecated; use `version`. It will be

‎docs/fundamentals/solvers.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ sidebar_position: 4
77
<img className="topic-logo" src="/assets/topics/solver.svg" alt="" />
88

99
The linear system solver is selected with the `solver` option of `setModelConfig`. If it is not set, FEAScript
10-
uses `"lusolve"`.
10+
uses `"lusolve"`. The [lite build](../getting-started/installation.md#lite-build) has only `"frontal"` (its
11+
default) and `"jacobi"`, so it solves the models of the table below that have a ✓ under `"frontal"`.
1112

1213
```javascript
1314
model.setModelConfig("heatConduction", { solver: { method: "frontal" } });

‎docs/getting-started/installation.md‎

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ to the jsDelivr URL:
2929

3030
```html
3131
<script type="module">
32-
import { FEAScriptModel } from "https://cdn.jsdelivr.net/gh/FEAScript/FEAScript-core@0.4.1/dist/feascript.esm.js";
32+
import { FEAScriptModel } from "https://cdn.jsdelivr.net/gh/FEAScript/FEAScript-core@0.4.2/dist/feascript.esm.js";
3333
</script>
3434
```
35+
3536
:::
3637

3738
You can also download a release from [GitHub Releases](https://github.com/FEAScript/FEAScript-core/releases) and import it locally.
@@ -51,6 +52,48 @@ Pages that do not use ES modules can load the UMD build with a classic `<script>
5152
`FEAScriptWorker` also works with this build. It loads `feascript-worker.esm.js` from the same folder as
5253
`feascript.umd.js`. If you host the library yourself, keep all the files of `dist/` in one folder.
5354

55+
### Lite build
56+
57+
Added in FEAScript 0.4.2.
58+
59+
The lite build is a smaller file for pages that embed one model, such as course pages, interactive explainers,
60+
games and offline tools. It has the same API as the full build. It does not include math.js, the WebGPU solver,
61+
the web worker or the vtk.js plots.
62+
63+
| Property | Full build | Lite build |
64+
| ---------- | ----------------- | ---------------------------------------------------------- |
65+
| Size | About 360 KB | About 147 KB (45 KB gzipped) |
66+
| Models | All | `heatConduction`, `generalFormPDE`, `frontPropagation` |
67+
| Solvers | All | `"frontal"` (the default in the lite build) and `"jacobi"` |
68+
| Plots | Plotly and vtk.js | Plotly |
69+
| Web worker | `FEAScriptWorker` | Not included |
70+
71+
The lite build includes the models that run on the frontal solver. Creeping flow and the Euler–Bernoulli beam
72+
need `"lusolve"`, so the lite build does not include them. A model, solver or function that is not in the lite
73+
build throws a `FEAScriptError` with the code `UNSUPPORTED_SOLVER`, and the message tells you to use the full
74+
build.
75+
76+
The lite build makes no network requests and starts no workers, so it runs on pages with a strict Content
77+
Security Policy. Its files contain no `http://` or `https://` links, for sites that check files for links.
78+
79+
Load it with a script tag (global `FEAScript`):
80+
81+
```html
82+
<script src="https://cdn.jsdelivr.net/npm/feascript@0.4.2/dist/feascript-lite.umd.min.js"></script>
83+
<script>
84+
const { FEAScriptModel } = FEAScript;
85+
</script>
86+
```
87+
88+
Or import it as an ES module from npm:
89+
90+
```javascript
91+
import { FEAScriptModel } from "feascript/lite";
92+
```
93+
94+
Both files, `feascript-lite.umd.min.js` and `feascript-lite.esm.min.js`, are in the `dist/` folder of each
95+
release. To build them from the source, run `npm run build:lite` in FEAScript-core.
96+
5497
## With Node.js
5598

5699
```bash
@@ -96,11 +139,11 @@ See [Visualization](../api/visualization.md) for the details.
96139

97140
## Environments
98141

99-
| Feature | Browser | Node.js |
100-
| ---------------------------------- | ------------------- | ----------------------------------------- |
101-
| Models, meshes, `solve()` | ✓ | ✓ |
102-
| `generateTriangleMesh`, `generateQuadrilateralMesh` | ✓ | ✓ |
103-
| `importGmshMesh` | ✓ | ✓ (pass an object with a `text()` method) |
104-
| Plotting with Plotly or vtk.js | ✓ | |
105-
| `FEAScriptWorker` | ✓ | |
106-
| `"jacobi-gpu"` with `solveAsync()` | ✓ (WebGPU required) | |
142+
| Feature | Browser | Node.js |
143+
| --------------------------------------------------- | ------------------- | ----------------------------------------- |
144+
| Models, meshes, `solve()` | ✓ | ✓ |
145+
| `generateTriangleMesh`, `generateQuadrilateralMesh` | ✓ | ✓ |
146+
| `importGmshMesh` | ✓ | ✓ (pass an object with a `text()` method) |
147+
| Plotting with Plotly or vtk.js | ✓ | |
148+
| `FEAScriptWorker` | ✓ | |
149+
| `"jacobi-gpu"` with `solveAsync()` | ✓ (WebGPU required) | |

‎docusaurus.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const config = {
5050
// "current" holds the docs of the latest minor version; older minor versions are snapshots (see README)
5151
lastVersion: "current",
5252
versions: {
53-
current: { label: "0.4.1" },
53+
current: { label: "0.4.2" },
5454
"0.3.1": { label: "0.3.1" },
5555
"0.2.0": { label: "0.2.0", banner: "unmaintained" },
5656
},

‎static/llms.txt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FEAScript
22

3-
> FEAScript is a finite element simulation library written in JavaScript (ES modules). It runs in the browser and in Node.js. This file is a compact, exact reference of the FEAScript 0.4.1 API for AI assistants. Use only the functions, options and string values listed here: anything not listed is not supported.
3+
> FEAScript is a finite element simulation library written in JavaScript (ES modules). It runs in the browser and in Node.js. This file is a compact, exact reference of the FEAScript 0.4.2 API for AI assistants. Use only the functions, options and string values listed here: anything not listed is not supported.
44

55
Full documentation: https://docs.feascript.com
66
Source code: https://github.com/FEAScript/FEAScript-core
@@ -23,7 +23,9 @@ import { FEAScriptModel } from "feascript";
2323
</script>
2424
```
2525

26-
Exports: `FEAScriptModel`, `FEAScriptWorker`, `FEAScriptError`, `importGmshMesh`, `generateTriangleMesh`, `generateQuadrilateralMesh`, `logSystem`, `version` (a string constant, e.g. `"0.4.1"`), `plotSolution`, `plotInterpolatedSolution`, `plotSolutionVtk`, `plotInterpolatedSolutionVtk`, `createColorScale`, `createContourLineOptions`, `transformSolverOutputToVtkData`, `transformSolverOutputToVTP`, `transformSolverOutputToMLBuffers`, and from 0.4.1 `evaluateSolution`.
26+
Lite build (0.4.2 and later): `https://cdn.jsdelivr.net/npm/feascript@0.4.2/dist/feascript-lite.umd.min.js` (global `FEAScript`) or `import { FEAScriptModel } from "feascript/lite"`. Same API, about 147 KB, no dependencies. Only `heatConduction`, `generalFormPDE` and `frontPropagation`, with `"frontal"` (its default) and `"jacobi"`; `creepingFlow`, `eulerBernoulliBeam`, `"lusolve"`, `"jacobi-gpu"`, `FEAScriptWorker` and the vtk.js functions throw `"UNSUPPORTED_SOLVER"`. Use it when the page needs a small file or has a strict Content Security Policy.
27+
28+
Exports: `FEAScriptModel`, `FEAScriptWorker`, `FEAScriptError`, `importGmshMesh`, `generateTriangleMesh`, `generateQuadrilateralMesh`, `logSystem`, `version` (a string constant, e.g. `"0.4.2"`), `plotSolution`, `plotInterpolatedSolution`, `plotSolutionVtk`, `plotInterpolatedSolutionVtk`, `createColorScale`, `createContourLineOptions`, `transformSolverOutputToVtkData`, `transformSolverOutputToVTP`, `transformSolverOutputToMLBuffers`, and from 0.4.1 `evaluateSolution`.
2729

2830
## Workflow
2931

0 commit comments

Comments
 (0)