8000 sync with dev branch by nikoscham · Pull Request #26 · FEAScript/FEAScript-core · GitHub
[go: up one dir, main page]

Skip to content

sync with dev branch #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
node_modules
node_modules/
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
examples/
test/
.gitignore
package-lock.json
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,67 @@

> 🚧 **FEAScript is currently under heavy development.** Functionality and interfaces may change rapidly as new features and enhancements are introduced. 🚧

## Getting Started
## Installation

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.
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:

### Option 1: NPM Installation

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

Then import it in your JavaScript/TypeScript file:

```javascript
// ES Modules
import { FEAScriptModel, plotSolution } from "feascript";

// CommonJS
const { 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:

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

If you already have a package.json file, manually add `"type": "module"` to enable ES modules in your project.

### Option 2: Direct Import from CDN

Add this line to your HTML or JavaScript module:

```javascript
import { FEAScriptModel, plotSolution } from "https://core.feascript.com/dist/feascript.umd.js";
```

### Option 3: Download and Use Locally

1. Download the latest release from [GitHub Releases](https://github.com/FEAScript/FEAScript-core/releases)
2. Include it in your project:

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

### Example Usage

```javascript
// Import FEAScript library
import { FEAScriptModel, plotSolution } from "https://core.feascript.com/src/index.js";
import { FEAScriptModel, plotSolution } from "https://core.feascript.com/dist/feascript.umd.js";

// Create and configure model
const model = new FEAScriptModel();
model.setSolverConfig("solverType"); // e.g., "solidHeatTransfer" for a stationary solid heat transfer case
model.setMeshConfig({ // Define mesh configuration (assuming a rectangular domain for 2D)
model.setMeshConfig({
// Define mesh configuration (assuming a rectangular domain for 2D)
meshDimension: "1D" | "2D", // Mesh dimension
elementOrder: "linear" | "quadratic", // Element order
numElementsX: number, // Number of elements in x-direction
Expand Down
8 changes: 8 additions & 0 deletions dist/feascript.cjs.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/feascript.cjs.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dist/feascript.esm.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/feascript.esm.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions dist/feascript.umd.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/feascript.umd.js.map

Large diffs are not rendered by default.

Binary file added feascript-0.1.1.tgz
Binary file not shown.
Loading
0