Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b494dd5
Made the initial build for npm (#25)
sridhar-mani May 22, 2025
261a474
Update author and contributors information in package.json
nikoscham May 22, 2025
21abdee
Add publishConfig to package.json for public access
nikoscham May 22, 2025
c556727
sync with dev branch (#26)
nikoscham May 22, 2025
eb7eeed
Update import statements in README.md to use ESM version of FEAScript
nikoscham May 22, 2025
767da8a
Merge remote-tracking branch 'origin/dev'
nikoscham May 22, 2025
9750827
frontPropagationScript solver (#29)
nikoscham Jul 30, 2025
c97116b
Set default value for eikonalActivationFlag in assembleFrontPropagati…
nikoscham Jul 30, 2025
b8eee2d
Refactor eikonalActivationFlag handling in FEAScriptModel and frontPr…
nikoscham Jul 30, 2025
0f188d7
Refactor FEAScript and Newton-Raphson methods
nikoscham Jul 30, 2025
1560d41
Add Solidification Front 2D example (#30)
nikoscham Jul 31, 2025
d16b94b
chore: bump version to 0.1.3 and update description in package.json (…
nikoscham Aug 22, 2025
46edd41
Add Liberapay username to FUNDING.yml
nikoscham Aug 22, 2025
4d88687
Fix capitalization in download instructions
nikoscham Aug 22, 2025
c07d377
Initial plan
Copilot Sep 2, 2025
4aaf7ef
Initial plan for WebGPU conjugate gradient solver implementation
Copilot Sep 2, 2025
ac704dc
Implement WebGPU conjugate gradient solver with improved precision
Copilot Sep 2, 2025
34bd6a0
Complete WebGPU conjugate gradient solver with robust fallback mechan…
Copilot Sep 2, 2025
474bc4c
Add comprehensive examples and WebGPU demo for conjugate gradient solver
Copilot Sep 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: bump version to 0.1.3 and update description in package.json (#34
)

* Update README.md to include npm version badge

* Feature/frontal solver (#33)

* Refactor solver imports

* chore: bump version to 0.1.3 and update description in package.json

- Updated version from 0.1.2 to 0.1.3
- Modified description for clarity
- Added contributor Felipe Ferrari to package.json
- Changed homepage URL to https://feascript.com/
- Updated version constant in src/index.js to 0.1.3
  • Loading branch information
nikoscham authored Aug 22, 2025
commit d16b94be9391a5e4617bfb73274a1e4c3ac7a062
19 changes: 15 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ To contribute a new feature or fix:

All files in the FEAScript-core codebase should follow this structure:

1. **Banner**: All files start with the FEAScript ASCII art banner
1. **Banner**: All files start with the FEAScript ASCII art banner.
2. **Imports**:
- External imports (from npm packages) first, alphabetically ordered
- Internal imports next, grouped by module/folder
3. **Classes/Functions**: Implementation with proper JSDoc comments
- External imports (from npm packages) first, alphabetically ordered.
- Internal imports next, grouped by module/folder.
3. **Classes/Functions**: Implementation with proper JSDoc comments.

Example:

Expand Down Expand Up @@ -88,3 +88,14 @@ export class MyClass {
}
}
```

## File Naming Convention

All JavaScript source files in FEAScript end with the suffix `Script` before the `.js` extension (e.g., `loggingScript.js`, `meshGenerationScript.js`, `newtonRaphsonScript.js`). This is an explicit, project‑level stylistic choice to:

- Visually distinguish internal FEAScript modules from third‑party or external library files.
- Keep historical and stylistic consistency across the codebase.

Exceptions:
- Public entry file: `index.js` (standard entry point convention).
- Core model file: `FEAScript.js` (matches the library name; appending "Script" would be redundant).
12 changes: 5 additions & 7 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
FEAScript makes use of the following third-party software:

1. **math.js**
- License: Apache 2.0 License
- License: Apache 2.0 (https://github.com/josdejong/mathjs/blob/develop/LICENSE)
- Source: https://github.com/josdejong/mathjs
- License: https://github.com/josdejong/mathjs/blob/develop/LICENSE


2. **plotly.js**
- License: MIT License
- License: MIT (https://github.com/plotly/plotly.js/blob/master/LICENSE)
- Source: https://github.com/plotly/plotly.js/tree/master
- License: https://github.com/plotly/plotly.js/blob/master/LICENSE

3. **Comlink**
- License: Apache 2.0 License
- Source: https://github.com/GoogleChromeLabs/comlink
- License: https://github.com/GoogleChromeLabs/comlink/blob/main/LICENSE
- License: Apache 2.0 (https://github.com/GoogleChromeLabs/comlink/blob/main/LICENSE)
- Source: https://github.com/GoogleChromeLabs/comlink
101 changes: 60 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,117 @@

# FEAScript-core

[![npm version](https://img.shields.io/npm/v/feascript)](https://www.npmjs.com/package/feascript) <img src="https://img.shields.io/liberapay/receives/FEAScript.svg?logo=liberapay">

[FEAScript](https://feascript.com/) is a lightweight finite element simulation library built in JavaScript. It empowers users to create and execute simulations for physics and engineering applications in both browser-based and server-side environments. 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. 🚧

## Contents

- [Installation](#installation)
- [Example Usage](#example-usage)
- [FEAScript Platform](#feascript-platform)
- [Contribute](#contribute)
- [License](#license)

## Installation

FEAScript is entirely implemented in pure JavaScript and can run in two environments:

1. **In the browser** with a simple HTML page, where all simulations are executed locally without any installations or using any cloud services
2. **Via Node.js** with plain JavaScript files, for server-side simulations
1. **In the browser** with a simple HTML page, where all simulations are executed locally without any installations or using any cloud services.
2. **Via Node.js** with plain JavaScript files, for server-side simulations.

### Option 1: In the Browser

You can use FEAScript in browser environments in two ways:

**Direct Import from CDN**:
Add this to your HTML file:
**Direct Import from the Web (ES Module):**

```html
<script type="module">
import { FEAScriptModel } from "https://core.feascript.com/dist/feascript.esm.js";
</script>
```

**Download and Use Locally**:
1. Download the latest release from [GitHub Releases](https://github.com/FEAScript/FEAScript-core/releases)
2. Include it in your HTML file:
**Download and Use Locally:**

```html
<script type="module">
import { FEAScriptModel } from "./path/to/dist/feascript.esm.js";
</script>
```

For browser-based examples and use cases, visit [our website tutorials](https://feascript.com/#tutorials).
You can Download the latest release from [GitHub Releases](https://github.com/FEAScript/FEAScript-core/releases). Explore various browser-based examples and use cases in our [website](https://feascript.com/#tutorials).

### Option 2: Via Node.js

Install FEAScript and its peer dependencies from npm:

```bash
# Install FEAScript and its peer dependencies
npm install feascript mathjs plotly.js
```

Then import it in your JavaScript/TypeScript file:
Then, import it in your JavaScript file:

```javascript
import { FEAScriptModel } from "feascript";
```

**Important:** FEAScript is built as an ES module. If you're starting a completely new project (outside this repository), make sure to configure it to use ES modules by (when running examples from within this repository, this step is not needed as the root package.json already has the proper configuration):
**Important:** FEAScript is built as an ES module. If you're starting a completely new project (outside this repository), make sure to configure it to use ES modules by:

```bash
# Create package.json with type=module for ES modules support
echo '{"type":"module"}' > package.json
```

Explore various Node.js examples and use cases [here](https://github.com/FEAScript/FEAScript-core/tree/main/examples).
When running examples from within this repository, this step is not needed as the root package.json already has the proper configuration. Explore various Node.js examples and use cases [here](https://github.com/FEAScript/FEAScript-core/tree/main/examples).

## Example Usage

**Browser Import:**
```javascript
// Import FEAScript library in browser
import { FEAScriptModel } from "https://core.feascript.com/dist/feascript.esm.js";
```
This is an indicative example of FEAScript, shown for execution in the browser. Adapt paths, solver types, and boundary conditions as needed for your specific problem:

**Node.js Import:**
```javascript
// Import FEAScript library in Node.js
import { FEAScriptModel } from "feascript";
```
```javascript
// Create and configure model
const model = new FEAScriptModel();
model.setSolverConfig("solverType"); // e.g., "solidHeatTransfer" for a stationary solid heat transfer case
model.setMeshConfig({
meshDimension: "1D" | "2D", // Mesh dimension
elementOrder: "linear" | "quadratic", // Element order
numElementsX: number, // Number of elements in x-direction
numElementsY: number, // Number of elements in y-direction (for 2D)
maxX: number, // Domain length in x-direction
maxY: number, // Domain length in y-direction (for 2D)
});

// Apply boundary conditions
model.addBoundaryCondition("boundaryIndex", ["conditionType", /* parameters */]);

// Solve
model.setSolverMethod("linearSolver"); // lusolve (via mathjs) or jacobi
const { solutionVector, nodesCoordinates } = model.solve();
```html
<body>
<!-- ...body region... -->
<script type="module">
// Import FEAScript library
import { FEAScriptModel } from "https://core.feascript.com/dist/feascript.esm.js";

window.addEventListener("DOMContentLoaded", async () => {
// Create and configure model
const model = new FEAScriptModel();
model.setSolverConfig("solverType"); // e.g., "solidHeatTransfer" for a stationary solid heat transfer case
model.setMeshConfig({
meshDimension: "1D" | "2D", // Mesh dimension
elementOrder: "linear" | "quadratic", // Element order
numElementsX: number, // Number of elements in x-direction
numElementsY: number, // Number of elements in y-direction (for 2D)
maxX: number, // Domain length in x-direction
maxY: number, // Domain length in y-direction (for 2D)
});

// Apply boundary conditions
model.addBoundaryCondition("boundaryIndex", ["conditionType" /* parameters */]);

// Solve
const { solutionVector, nodesCoordinates } = model.solve();
});
</script>
<!-- ...continue of body region... -->
</body>
```

## FEAScript Platform

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:

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

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.

## Contribute

We warmly welcome contributors to help expand and refine FEAScript. Please see the [CONTRIBUTING.md](./CONTRIBUTING.md) file for detailed guidance on how to contribute.
Expand Down
Loading