Latest release GitHub release badge npm version badge Get early access to FEAScript Studio

A JavaScript finite element library, for the web.

FEAScript enables engineering simulations across both browser-based and server-side environments without the overhead of traditional desktop software.

npm install feascript
MIT licensed Browser and Node.js Try FEAScript Studio

Our goal

A powerful JavaScript API for FEM.

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

Engineering simulation, without the barriers.

No installation

Run simulations straight from the browser, with no setup, licenses or admin rights needed.

Portability

Works everywhere JavaScript runs (Windows, macOS and Linux systems that use x64, IA-32, or ARM processors).

Open-source

The core library of FEAScript is open-source, removing the high cost barrier of traditional FEA software.

How to use FEAScript

Run a simulation with a few lines.

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.

<!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 FEAScript library
  import {
    FEAScriptModel,
    importGmshMesh,
    plotInterpolatedSolution,
  } from "https://core.feascript.com/dist/feascript.esm.js";

  window.addEventListener("DOMContentLoaded", async () => {
    // Fetch mesh from GitHub Gist (swap the URL for any other hosted .msh file)
    const response = await fetch(
      "https://gist.githubusercontent.com/nikoscham/0c5a78922a16111ceef42de54fc631ea/raw/aeadcd2808f5531fd0ca1ca16d198f7d1e7f8e96/rect_with_hole.msh"
    );
    const meshFile = new File([await response.text()], "rect_with_hole.msh");

    // Create and configure model
    const model = new FEAScriptModel();
    model.setModelConfig("heatConductionScript");
    model.setMeshConfig({
      parsedMesh: await importGmshMesh(meshFile),
    });

    // Apply boundary conditions (Gmsh physical group tag - 1)
    model.addBoundaryCondition("0", ["constantTemp", 200]); // Bottom
    model.addBoundaryCondition("1", ["constantTemp", 200]); // Right
    model.addBoundaryCondition("2", ["convection", 1, 20]); // Top
    model.addBoundaryCondition("3", ["symmetry"]);          // Left
    model.addBoundaryCondition("4", ["convection", 1, 20]); // Hole surface

    // Solve
    model.setSolverMethod("lusolve");
    const result = model.solve();

    // Plot results
    plotInterpolatedSolution(model, result, "contour", "resultsCanvas");
  });
  </script>
</body>
</html>

Features

Everything you need, in the browser.

From physics and meshing to solvers and visualization, the following list highlights the key FEAScript features.

Physical modeling

  • Creeping (Stokes) flow
  • Euler-Bernoulli beam bending
  • Front propagation
  • Heat conduction

Geometry and meshing

  • Simple mesh generation (1D & 2D domains)
  • Unstructured mesh import from Gmsh (.msh file format) with quadrilateral and triangular elements (linear and quadratic)

Numerical methods

  • General form PDE (linear & nonlinear)
  • Linear system solvers:
    • Frontal
    • Jacobi (CPU & WebGPU versions)
    • LU (via math.js)
  • Newton-Raphson method for nonlinear systems

Performance & parallelization

  • Web worker support for multi-threaded computation

Visualization & post-processing

In development FEAScript is currently under heavy development with new features being added regularly. See the roadmap for the next major release: 0.3.0. 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

Learn by running.

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.

Advection-diffusion with Gaussian source results

General-form PDE

Advection-Diffusion with Gaussian Source

1D steady-state scalar transport governed by the advection-diffusion equation with a localized Gaussian source term

Cantilever beam under a tip load results

Structural mechanics

Cantilever Beam Under a Tip Load

1D Euler-Bernoulli cantilever beam bending under a concentrated tip load, with the finite element solution verified against the classical analytical solution

Creeping flow on a lid-driven 2D cavity results

Creeping flow

Creeping Flow on a Lid-Driven 2D Cavity

Stokes flow in a square 2D cavity driven by a moving lid, with velocity and pressure fields resolved

Heat conduction through a wall results

Heat conduction

Heat Conduction Through a Wall

1D steady-state heat conduction across a wall with convection boundary condition at one end and constant temperature at the other

Solidification front propagation results

Front propagation

Solidification Front Propagation in a 2D Domain

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

Built with FEAScript.

Resources

Open, documented, and growing.

Documentation

The documentation for FEAScript is currently under development and is growing steadily. For information on the numerical methods used in FEAScript and other technical resources, please also visit our blog.

Licensing

The core library of FEAScript is distributed under the terms of the MIT license.

Help FEAScript grow

If you find FEAScript useful, please consider supporting its development with a donation. Your support helps fund new features, performance improvements, documentation and tutorials.

GitHub Sponsors Donate on Liberapay

Stay in the loop

Join the mailing list.

Receive project updates and news.