Skip to content

Commit d036587

Browse files
authored
Feature/frontal solver (#43)
1 parent d606061 commit d036587

25 files changed

+1548
-767
lines changed

CONTRIBUTING.md

Lines changed: 109 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -2,105 +2,112 @@
22

33
Thank you for your interest in contributing! FEAScript is in early development, with continuous additions of new features and improvements. To ensure a smooth and collaborative development process, please review and follow the guidelines below.
44

5-
## Contribution Guidelines
6-
7-
1. **Development Tools:**
8-
We recommend using [Visual Studio Code](https://code.visualstudio.com/) with the [Prettier plugin](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for automatic code formatting. Additionally, use a **110-character line width** to maintain consistent formatting.
9-
10-
2. **Coding Style:**
11-
Observe the code near your intended changes and aim to preserve that style in your modifications.
12-
13-
3. **Variable Naming:**
14-
Use [camelCase](https://en.wikipedia.org/wiki/Camel_case) formatting for variable names throughout the code.
15-
16-
4. **File Naming:**
17-
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:
18-
19-
- Visually distinguish internal FEAScript modules from third‑party or external library files.
20-
- Keep historical and stylistic consistency across the codebase.
21-
22-
Exceptions:
23-
24-
- Public entry file: `index.js` (standard entry point convention).
25-
- Core model file: `FEAScript.js` (matches the library name; appending "Script" would be redundant).
26-
27-
5. **File Structure:**
28-
All files in the FEAScript-core codebase should follow this structure:
29-
30-
1. **Banner**: All files start with the FEAScript ASCII art banner.
31-
2. **Imports**:
32-
- External imports (from npm packages) first, alphabetically ordered.
33-
- Internal imports next, grouped by module/folder.
34-
3. **Classes/Functions**: Implementation with proper JSDoc comments.
35-
36-
Example:
37-
38-
```javascript
39-
// ______ ______ _____ _ _ //
40-
// | ____| ____| /\ / ____| (_) | | //
41-
// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
42-
// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
43-
// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
44-
// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
45-
// | | | | //
46-
// |_| | |_ //
47-
// Website: https://feascript.com/ \__| //
48-
49-
// External imports
50-
import { mathLibrary } from "math-package";
51-
52-
// Internal imports
53-
import { relatedFunction } from "../utilities/helperScript.js";
54-
55-
/**
56-
* Class to handle specific functionality
57-
*/
58-
export class MyClass {
59-
/**
60-
* Constructor to initialize the class
61-
* @param {object} options - Configuration options
62-
*/
63-
constructor(options) {
64-
// Implementation
65-
}
66-
67-
/**
68-
* Function to perform a specific action
69-
* @param {number} input - Input value
70-
* @returns {number} Processed result
71-
*/
72-
doSomething(input) {
73-
// Implementation
74-
return input * DEFAULT_VALUE;
75-
}
76-
}
77-
```
78-
79-
6. **Branching & Workflow:**
80-
To contribute a new feature or fix:
81-
82-
- Do not commit directly to `main`.
83-
- Instead, create a short‑lived branch:
84-
- `feature/<topic>` for new functionality
85-
- `fix/<issue>` for bug fixes
86-
87-
External contributors:
88-
89-
1. Fork the repo.
90-
2. Branch from `main` in your fork.
91-
3. Push and open a PR from your fork’s branch into `main`.
92-
93-
7. **Local Testing:**
94-
Before submitting a pull request, test your modifications by running the FEAScript library from a local directory. For example, you can load the library in your HTML file as follows:
95-
96-
```javascript
97-
import { FEAScriptModel, plotSolution, printVersion } from "[USER_DIRECTORY]/FEAScript-core/src/index.js";
98-
```
99-
100-
FEAScript can be run on a local server. To start a local server, you can use [Python HTTP Server](https://docs.python.org/3/library/http.server.html):
101-
102-
```bash
103-
python -m http.server
104-
```
105-
106-
where the server will be available at `http://127.0.0.1:8000/`. Static file server npm packages like [serve](https://github.com/vercel/serve#readme) and [Vite](https://vite.dev/) can also be used.
5+
## Contents
6+
7+
- [Development Environment & Coding Style](#development-environment--coding-style)
8+
- [Variable & File Naming](#variable--file-naming)
9+
- [File Structure](#file-structure)
10+
- [Branching & Workflow](#branching--workflow)
11+
- [Local Testing](#local-testing)
12+
13+
## Development Environment & Coding Style
14+
15+
- Use [Visual Studio Code](https://code.visualstudio.com/) with the [Prettier plugin](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for automatic code formatting
16+
- Use a **110-character line width** to maintain consistent formatting
17+
- Observe the code near your intended changes and aim to preserve that style in your modifications
18+
19+
## Variable & File Naming
20+
21+
- Use [camelCase](https://en.wikipedia.org/wiki/Camel_case) formatting for variable names throughout the code
22+
- 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:
23+
- Visually distinguish internal FEAScript modules from third‑party or external library files
24+
- Keep historical and stylistic consistency across the codebase
25+
26+
### Exceptions
27+
28+
- Public entry file: `index.js` (standard entry point convention)
29+
- Core model file: `FEAScript.js` (matches the library name; appending "Script" would be redundant)
30+
31+
## File Structure
32+
33+
All files in the FEAScript-core codebase should follow this structure:
34+
35+
1. Banner: All files start with the FEAScript ASCII art banner
36+
2. Imports:
37+
- External imports first, alphabetically ordered
38+
- Internal imports next, grouped by module/folder
39+
3. Classes/Functions: Implementation with proper JSDoc comments
40+
41+
Example:
42+
43+
```javascript
44+
// ______ ______ _____ _ _ //
45+
// | ____| ____| /\ / ____| (_) | | //
46+
// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ //
47+
// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| //
48+
// | | | |____ / ____ \ ____) | (__| | | | |_) | | //
49+
// |_| |______/_/ \_\_____/ \___|_| |_| __/| | //
50+
// | | | | //
51+
// |_| | |_ //
52+
// Website: https://feascript.com/ \__| //
53+
54+
// External imports
55+
import { mathLibrary } from "math-package";
56+
57+
// Internal imports
58+
import { relatedFunction } from "../utilities/helperScript.js";
59+
60+
/**
61+
* Class to handle specific functionality
62+
*/
63+
export class MyClass {
64+
/**
65+
* Constructor to initialize the class
66+
* @param {object} options - Configuration options
67+
*/
68+
constructor(options) {
69+
// Implementation
70+
}
71+
72+
/**
73+
* Function to perform a specific action
74+
* @param {number} input - Input value
75+
* @returns {number} Processed result
76+
*/
77+
doSomething(input) {
78+
// Implementation
79+
return input * DEFAULT_VALUE;
80+
}
81+
}
82+
```
83+
84+
## Branching & Workflow
85+
86+
To contribute a new feature or fix:
87+
88+
- Do not commit directly to `main`
89+
- Instead, create a short‑lived branch:
90+
- `feature/<topic>` for new functionality
91+
- `fix/<issue>` for bug fixes
92+
93+
External contributors:
94+
95+
1. Fork the repo
96+
2. Branch from `main` in your fork
97+
3. Push and open a PR from your fork’s branch into `main`
98+
99+
## Local Testing
100+
101+
Before submitting a pull request, test your modifications by running the FEAScript library from a local directory. For example, you can load the library in your HTML file as follows:
102+
103+
```javascript
104+
import { FEAScriptModel, plotSolution, printVersion } from "[USER_DIRECTORY]/FEAScript-core/src/index.js";
105+
```
106+
107+
FEAScript can be run on a local server. Ensure you start the server from the workspace root directory, where both `FEAScript-core` and `FEAScript-website` folders are located, to correctly resolve relative paths in the HTML files. To start a local server, you can use [Python HTTP Server](https://docs.python.org/3/library/http.server.html):
108+
109+
```bash
110+
python -m http.server
111+
```
112+
113+
where the server will be available at `http://127.0.0.1:8000/`. Static file server npm packages like [serve](https://github.com/vercel/serve#readme) and [Vite](https://vite.dev/) can also be used.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<!-- [![liberapay](https://img.shields.io/liberapay/receives/FEAScript.svg?logo=liberapay)](https://liberapay.com/FEAScript/) -->
88

9-
[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 the FEAScript project.
9+
[FEAScript](https://feascript.com/) is a lightweight finite element simulation library written 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 the FEAScript project.
1010

1111
> 🚧 **FEAScript is currently under heavy development.** Its functionality and interfaces may change rapidly as new features and enhancements are introduced.
1212
@@ -99,9 +99,9 @@ FEAScript also works well in interactive JavaScript notebook environments where
9999

100100
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:
101101

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

106106
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.
107107

dist/feascript.cjs.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.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

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

examples/frontPropagationScript/SolidificationFront2D/SolidificationFront2D.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import * as math from "mathjs";
1313
global.math = math;
1414

1515
// Import FEAScript library
16-
import { FEAScriptModel, logSystem, VERSION } from "feascript";
16+
import { FEAScriptModel, VERSION } from "feascript";
1717

1818
console.log("FEAScript Version:", VERSION);
1919

examples/solidHeatTransferScript/HeatConduction1DWall/HeatConduction1DWall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import * as math from "mathjs";
1313
global.math = math;
1414

1515
// Import FEAScript library
16-
import { FEAScriptModel, logSystem, VERSION } from "feascript";
16+
import { FEAScriptModel, VERSION } from "feascript";
1717

1818
console.log("FEAScript Version:", VERSION);
1919

0 commit comments

Comments
 (0)