Skip to content

Commit f3e90f1

Browse files
sridhar-maniSridharNCInikoscham
authored
Feature/web gpu (#53)
Co-authored-by: Sridhar.Mani <sridhar.mani@novacastindia.com> Co-authored-by: nikoscham <nikoscham@gmail.com>
1 parent a8605a0 commit f3e90f1

25 files changed

+1795
-494
lines changed

β€Ž.npmignoreβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
examples/
22
test/
33
.gitignore
4+
README.md
5+
LICENSE
6+
dist/
47
package-lock.json

β€ŽNOTICE.mdβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ FEAScript makes use of the following third-party software:
1111

1212
3. **Comlink**
1313
- License: Apache 2.0 (https://github.com/GoogleChromeLabs/comlink/blob/main/LICENSE)
14-
- Source: https://github.com/GoogleChromeLabs/comlink
14+
- Source: https://github.com/GoogleChromeLabs/comlink
15+
16+
4. **taichi.js**
17+
- License: MIT (https://github.com/AmesingFlank/taichi.js/blob/main/LICENSE)
18+
- Source: https://github.com/AmesingFlank/taichi.js

β€ŽREADME.mdβ€Ž

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44

55
[![npm version](https://img.shields.io/npm/v/feascript)](https://www.npmjs.com/package/feascript)
66

7-
<!-- [![liberapay](https://img.shields.io/liberapay/receives/FEAScript.svg?logo=liberapay)](https://liberapay.com/FEAScript/) -->
8-
97
[FEAScript](https://feascript.com/) is a lightweight finite element simulation library written in JavaScript. It empowers users to perform simulations for physics and engineering applications in both browser-based and server-side environments. This is the core library of the FEAScript project.
108

119
> 🚧 **FEAScript is currently under heavy development.** Its functionality and interfaces may change rapidly as new features and enhancements are introduced.
1210
1311
## Contents
1412

1513
- [Ways to Use FEAScript](#ways-to-use-feascript)
16-
- [JavaScript API (FEAScript Core)](#javascript-api-feascript-core)
14+
- [FEAScript API](#feascript-api)
1715
- [Use FEAScript in the Browser](#use-feascript-in-the-browser)
1816
- [Use FEAScript with Node.js](#use-feascript-with-nodejs)
19-
- [Use FEAScript with Scribbler](#use-feascript-with-scribbler)
20-
- [Visual Editor (FEAScript Platform)](#visual-editor-feascript-platform)
17+
- [Use FEAScript in JavaScript Playgrounds](#use-feascript-in-javascript-playgrounds)
18+
- [FEAScript Platform](#feascript-platform)
2119
- [Quick Example](#quick-example)
2220
- [Support FEAScript](#support-feascript)
2321
- [Contributing](#contributing)
@@ -27,22 +25,22 @@
2725

2826
FEAScript offers two main approaches to creating simulations:
2927

30-
1. **[JavaScript API (FEAScript Core)](#javascript-api-feascript-core)** – For developers comfortable with coding, providing full programmatic control in browsers, Node.js, or interactive notebooks.
31-
2. **[Visual Editor (FEAScript Platform)](#visual-editor-feascript-platform)** – For users who prefer a no-code approach, offering a block-based visual interface built with [Blockly](https://developers.google.com/blockly).
28+
1. **[FEAScript API](#feascript-api)** – For developers comfortable with coding, providing full programmatic control in browsers, Node.js, or interactive notebooks.
29+
2. **[FEAScript Platform](#feascript-platform)** – For users who prefer a no-code approach, offering a block-based visual interface built with [Blockly](https://blockly.com/).
3230

3331
Each approach is explained in detail below.
3432

35-
### JavaScript API (FEAScript Core)
33+
### FEAScript API
3634

37-
The JavaScript API is the core programmatic interface for FEAScript. Written entirely in pure JavaScript, it runs in three environments:
35+
The FEAScript API is the core programmatic interface for FEAScript. Written entirely in pure JavaScript, it runs in three environments:
3836

3937
1. **[In the browser](#use-feascript-in-the-browser)** – Use FEAScript in a simple HTML page, running simulations locally without additional installations or cloud services.
4038
2. **[With Node.js](#use-feascript-with-nodejs)** – Use FEAScript in server-side JavaScript applications or CLI tools.
41-
3. **[With Scribbler](#use-feascript-with-scribbler)** – Use FEAScript in the [Scribbler](https://scribbler.live/) interactive JavaScript notebook environment.
39+
3. **[In JavaScript playgrounds](#use-feascript-in-javascript-playgrounds)** – Use FEAScript in the [Scribbler](https://scribbler.live/) interactive JavaScript notebook environment.
4240

4341
#### Use FEAScript in the Browser
4442

45-
You can use FEAScript in browser environments in two ways:
43+
You can use FEAScript in browser environments in three ways:
4644

4745
- **Import from Hosted ESM Build:**
4846

@@ -52,6 +50,14 @@ You can use FEAScript in browser environments in two ways:
5250
</script>
5351
```
5452

53+
- **Import from CDN:**
54+
55+
```html
56+
<script type="module">
57+
import { FEAScriptModel } from "https://cdn.jsdelivr.net/gh/FEAScript/FEAScript-core/dist/feascript.esm.js";
58+
</script>
59+
```
60+
5561
- **Download and Use Locally:**
5662

5763
You can download the latest stable release from [GitHub Releases](https://github.com/FEAScript/FEAScript-core/releases).
@@ -89,27 +95,29 @@ When running examples from within this repository, this step isn’t needed as t
8995

9096
πŸ‘‰ Explore Node.js use cases on the [examples directory](https://github.com/FEAScript/FEAScript-core/tree/main/examples).
9197

92-
#### Use FEAScript with Scribbler
98+
#### Use FEAScript in JavaScript Playgrounds
9399

94-
FEAScript also works well in interactive JavaScript notebook environments where you can write code, visualize results inline, and share your work with others. [Scribbler](https://scribbler.live/) is one such platform that comes with preloaded scientific libraries, making it an excellent choice for FEAScript simulations.
100+
FEAScript works well in interactive JavaScript playgrounds where you can write code, visualize results inline, and share your work.
95101

96-
πŸ‘‰ Explore FEAScript notebook examples on the [Scribbler Hub](https://hub.scribbler.live/portfolio/#!nikoscham/FEAScript-Scribbler-examples).
102+
πŸ‘‰ Explore the following examples:
103+
- [CodePen (interactive pens)](https://codepen.io/FEAScript)
104+
- [Scribbler (notebooks)](https://hub.scribbler.live/portfolio/#!nikoscham/FEAScript-Scribbler-examples)
97105

98-
### Visual Editor (FEAScript Platform)
106+
### FEAScript Platform
99107

100-
For users who prefer a visual approach to creating simulations, we offer the [FEAScript Platform](https://platform.feascript.com/) - a browser-based visual editor built on the [Blockly](https://developers.google.com/blockly) library. This no-code interface allows you to:
108+
For users who prefer a visual approach to creating simulations, we offer the [FEAScript Platform](https://feascript.com/feascript-platform.html) - a browser-based visual editor built on the [Blockly](https://blockly.com/) library. This no-code interface allows you to:
101109

102110
- Build and run finite element simulations directly in your browser by connecting visual blocks together.
103111
- Create complex simulations without writing any JavaScript code.
104112
- Save and load projects in XML format for easy sharing and reuse.
105113

106-
While FEAScript's JavaScript API offers full programmatic control for advanced customization, the FEAScript Platform provides an accessible entry point for users without coding experience.
114+
While FEAScript API offers full programmatic control for advanced customization, the FEAScript Platform provides an accessible entry point for users without coding experience.
107115

108-
πŸ‘‰ Explore FEAScript Platform examples on our [website](https://feascript.com/#tutorials).
116+
<!-- > Note: The FEAScript Platform is not yet available -->
109117

110118
## Quick Example
111119

112-
Here is a minimal browser-based example using the JavaScript API. Adapt paths, solver types, and boundary conditions as needed for your specific problem:
120+
Here is a minimal browser-based example using the FEAScript API. Adapt paths, solver types, and boundary conditions as needed for your specific problem:
113121

114122
```html
115123
<body>

β€Ždist/feascript.cjs.js.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/feascript.esm.js.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/feascript.umd.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/feascript.umd.js.mapβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)