Installation
In the browser
Import the ES module build from the hosted build or from a CDN:
<script type="module">
import { FEAScriptModel } from "https://core.feascript.com/dist/feascript.esm.js";
</script>
<script type="module">
import { FEAScriptModel } from "https://cdn.jsdelivr.net/gh/FEAScript/FEAScript-core/dist/feascript.esm.js";
</script>
You can also download a release from GitHub Releases and import it locally.
With Node.js
npm install feascript
import { FEAScriptModel } from "feascript";
FEAScript is built as an ES module. In a new project, set "type": "module" in your package.json.
Optional dependencies
FEAScript itself needs no extra setup to solve a model. The plotting functions use two optional libraries:
| Library | Used by | Browser | npm |
|---|---|---|---|
| Plotly | plotSolution, plotInterpolatedSolution | Load plotly.min.js with a <script> tag (global Plotly) | npm install plotly.js |
| vtk.js | plotSolutionVtk, plotInterpolatedSolutionVtk, VTK export | Map @kitware/vtk.js/ with an import map | npm install @kitware/vtk.js |
See Visualization for the details.
Environments
| Feature | Browser | Node.js |
|---|---|---|
Models, meshes, solve() | ✓ | ✓ |
importGmshMesh | ✓ | ✓ (pass an object with a text() method) |
| Plotting with Plotly or vtk.js | ✓ | |
FEAScriptWorker | ✓ | |
"jacobi-gpu" with solveAsync() | ✓ (WebGPU required) |