[ Web Proxy ]
URL:
Viewing: https://feascript.com/ [Back]  [Original]

FEAScript Finite Element Simulation Library
Latest release GitHub release badge [GitHub release badge] npm version badge [npm version badge] Get Early Access to FEAScript Studio

FEAScript Logo [FEAScript Logo]

A JavaScript Finite Element Simulation Library

FEAScript Icon [FEAScript Icon]FEAScript is a finite element simulation library developed in JavaScript. It enables engineering simulations across both browser-based and server-side environments without the overhead of traditional desktop software.
Our goal is to provide the most 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

POWERED BY FEASCRIPT

BetterBuilding Logo [BetterBuilding Logo] Better BuildingExternal Link Icon [External Link Icon] integrated FEAScript to power their online Heat Transfer SimulatorExternal Link Icon [External Link Icon] for architects and engineers.

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. CodePenExternal Link Icon [External Link Icon] and ScribblerExternal Link Icon [External Link Icon]) and server-side runtimes such as Node.jsExternal Link Icon [External Link Icon].

QUICK START

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.

Copy
Watch tutorialExternal Link Icon [External Link Icon] Run on CodePenExternal Link Icon [External Link Icon]
<!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/mathjs/11.12.0/math.min.js"></script>
  <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),
      meshDimension: "2D",
      elementOrder: "quadratic",
    });

    // 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

The following list highlights key FEAScript features:

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

Below you can explore tutorials that provide a step-by-step introduction to FEAScript. These tutorials show how to integrate finite element simulations into your own websites and applications or to run them in interactive JavaScript playgrounds such as CodePenExternal Link Icon [External Link Icon] and ScribblerExternal Link Icon [External Link Icon]. Each tutorial include different variations that demonstrate the same physical problem under different configurations, ranging from simple examples to advanced setups using external meshes or multiple threads.

Please report any feedback or issues with the above tutorials to the FEAScript support.

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 [GitHub Sponsors] Donate on Liberapay [Donate on Liberapay]

You can also join the FEAScript mailing list to receive project updates and news: Subscribe hereExternal Link Icon [External Link Icon]

Documentation

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

Licensing

The core library of FEAScript is distributed under the terms of the MIT license. This website is licensed under the Creative Commons Attribution 4.0 License.

Contact: info@feascript.com

© 2023- FEAScript


Web Proxy Viewer  |  New URL  |  Original Page