No installation
Run simulations straight from the browser, with no setup, licenses or admin rights needed.
FEAScript enables engineering simulations across both browser-based and server-side environments without the overhead of traditional desktop software.
npm install feascript
Our goal
We are closing the gap between complex computational mechanics and the accessibility of the web, empowering developers to build professional-grade simulation tools that work on any device, anywhere.
Why use FEAScript
Run simulations straight from the browser, with no setup, licenses or admin rights needed.
Works everywhere JavaScript runs (Windows, macOS and Linux systems that use x64, IA-32, or ARM processors).
The core library of FEAScript is open-source, removing the high cost barrier of traditional FEA software.
How to use FEAScript
You can run simulations with FEAScript by calling its functions from JavaScript (the FEAScript API). The API offers full programmatic control and works across multiple environments, including the browser (simple HTML pages and online JavaScript playgrounds, e.g. CodePen and Scribbler) and server-side runtimes such as Node.js.
The example below demonstrates a simulation workflow: steady-state heat conduction in a 2D rectangular fin with a circular hole, solved using a Gmsh-generated mesh. Create an HTML file with the code below to run the simulation. See the tutorials section for more examples, and the documentation for every model, option and function of the API.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Heat Conduction in a 2D Fin with a Hole</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/plotly.js/2.35.3/plotly.min.js"></script>
</head>
<body>
<div id="resultsCanvas"></div>
<script type="module">
import {
FEAScriptModel,
importGmshMesh,
plotInterpolatedSolution,
} from "https://core.feascript.com/dist/feascript.esm.js";
window.addEventListener("DOMContentLoaded", async () => {
// 1. Create the model and select the physics
const model = new FEAScriptModel();
model.setModelConfig("heatConductionScript");
// 2. Load the Gmsh mesh (any hosted .msh file works)
const response = await fetch("https://feascript.com/tutorials/rect_with_hole.msh");
const meshFile = new File([await response.text()], "rect_with_hole.msh");
const mesh = await importGmshMesh(meshFile);
model.setMeshConfig({ parsedMesh: mesh });
// 3. Apply the boundary conditions (key = Gmsh physical group tag - 1)
model.addBoundaryCondition("0", ["constantTemperature", 200]); // Bottom
model.addBoundaryCondition("1", ["symmetry"]); // Left
model.addBoundaryCondition("2", ["convection", 1, 20]); // Top
model.addBoundaryCondition("3", ["constantTemperature", 200]); // Right
model.addBoundaryCondition("4", ["convection", 1, 20]); // Hole
// 4. Solve
model.setSolverMethod("lusolve");
const result = model.solve();
// 5. Plot the results
plotInterpolatedSolution(model, result, "contour", "resultsCanvas");
});
</script>
</body>
</html>
Features
From physics and meshing to solvers and visualization, the following list highlights the key FEAScript features.
.msh file
format) with quadrilateral and triangular elements (linear and quadratic)
In development FEAScript is currently under heavy development with new features being added regularly. Donations help accelerate the next generation of FEAScript's solvers, performance, documentation and tutorials. Interested in contributing? Check out our contribution guidelines to get started.
Tutorials
These tutorials provide a step-by-step introduction to FEAScript. They show how to integrate finite element simulations into your own websites and applications or to run them in interactive JavaScript playgrounds such as CodePen and Scribbler. Each tutorial includes different variations that demonstrate the same physical problem under different configurations, ranging from simple examples to advanced setups using external meshes or multiple threads. For the equations and options behind each example, see the documentation.
General-form PDE
1D steady-state scalar transport governed by the advection-diffusion equation with a localized Gaussian source term
Structural mechanics
1D Euler-Bernoulli cantilever beam bending under a concentrated tip load, with the finite element solution verified against the classical analytical solution
Creeping flow
Stokes flow in a square 2D cavity driven by a moving lid, with velocity and pressure fields resolved
Heat conduction
2D steady-state heat conduction in a cooling fin with mixed boundary conditions including constant temperature, symmetry, and convective cooling
Heat conduction
1D steady-state heat conduction across a wall with convection boundary condition at one end and constant temperature at the other
Front propagation
Transient simulation of a solidification front advancing through a 2D domain using the eikonal equation
Please report any feedback or issues with the above tutorials to the FEAScript support.
Powered by FEAScript
Better Building integrated FEAScript to power their online Heat Transfer Simulator for architects and engineers.
Resources
The FEAScript documentation covers installation, a first simulation, the finite element formulation, meshes, boundary conditions and solvers, every physical model with its equations, and the full API reference. For more background on the numerical methods, please also visit our blog.
The core library of FEAScript is distributed under the terms of the MIT license.
If you find FEAScript useful, please consider supporting its development with a donation. Your support helps fund new features, performance improvements, documentation and tutorials.
Stay in the loop
Receive project updates and news.