- Notifications
You must be signed in to change notification settings - Fork3
A JavaScript finite element simulation library
License
FEAScript/FEAScript-core
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
FEAScript is a lightweight finite element simulation library built in JavaScript. It empowers users to create and execute browser-based simulations for physics and engineering applications. This is the core library of FEAScript.
🚧FEAScript is currently under heavy development. Functionality and interfaces may change rapidly as new features and enhancements are introduced. 🚧
FEAScript is entirely implemented in pure JavaScript and requires only a simple HTML page to operate. All simulations are executed locally in your browser, without the need for any cloud services. You can use FEAScript in your projects through one of the following methods:
# Install FEAScript and its peer dependenciesnpm install feascript mathjs plotly.js
Then import it in your JavaScript/TypeScript file:
// ES Modulesimport{FEAScriptModel,plotSolution}from"feascript";// CommonJSconst{ FEAScriptModel, plotSolution}=require("feascript");
Important: FEAScript is built as an ES module. If you're starting a new project, make sure to configure it to use ES modules by running:
# Create package.json with type=module for ES modules supportecho'{"type":"module"}'> package.json
If you already have a package.json file, manually add"type": "module"
to enable ES modules in your project.
Add this line to your HTML or JavaScript module:
import{FEAScriptModel,plotSolution}from"https://core.feascript.com/dist/feascript.esm.js";
- Download the latest release fromGitHub Releases
- Include it in your project:
<scripttype="module">import{FEAScriptModel,plotSolution}from"./path/to/dist/feascript.esm.js";// Your code here</script>
// Import FEAScript libraryimport{FEAScriptModel,plotSolution}from"https://core.feascript.com/dist/feascript.esm.js";// Create and configure modelconstmodel=newFEAScriptModel();model.setSolverConfig("solverType");// e.g., "solidHeatTransfer" for a stationary solid heat transfer casemodel.setMeshConfig({// Define mesh configuration (assuming a rectangular domain for 2D)meshDimension:"1D"|"2D",// Mesh dimensionelementOrder:"linear"|"quadratic",// Element ordernumElementsX:number,// Number of elements in x-directionnumElementsY:number,// Number of elements in y-direction (for 2D)maxX:number,// Domain length in x-directionmaxY:number,// Domain length in y-direction (for 2D)});// Apply boundary conditionsmodel.addBoundaryCondition("boundaryIndex",["conditionType",/* parameters */]);// Solveconst{ solutionVector, nodesCoordinates}=model.solve();// Plot resultsplotSolution(solutionVector,nodesCoordinates,model.solverConfig,model.meshConfig.meshDimension,"plotType",// e.g., "contour""targetDivId"// HTML div ID for plot);
Explore various examples and use cases of FEAScripthere.
We warmly welcome contributors to help expand and refine FEAScript. Please see theCONTRIBUTING.md file for detailed guidance on how to contribute.
The core library of FEAScript is released under theMIT license. © 2023-2025 FEAScript.
About
A JavaScript finite element simulation library
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.