Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
de738f9
Simplify plotSolution function
nikoscham Nov 21, 2025
250790c
Update npm build
nikoscham Nov 21, 2025
d8ac5c0
Include nodal numbering in results
nikoscham Dec 2, 2025
67dbfeb
Create splitQuadrilateral function to split the quadrilateral element…
nikoscham Dec 8, 2025
4e87ee9
Add mesh utility functions for quadrilateral splitting and node neigh…
nikoscham Dec 9, 2025
42bc4c3
Start implementing adjacency-based search algorithm
nikoscham Dec 10, 2025
8ae9205
Fix splitQuadrilateral function to correctly access nodesPerElement u…
nikoscham Dec 10, 2025
901da68
Fix typos
nikoscham Dec 10, 2025
4a7f681
Update adjacency-based search
nikoscham Dec 11, 2025
8cabf61
Remove unused adjacencySearch import from plotSolutionScript.js
nikoscham Dec 11, 2025
42a5300
Update library header
nikoscham Dec 11, 2025
ff18c96
Add splitQuadrilateral function
nikoscham Dec 12, 2025
34478cd
Update point-in-triangle and point-in-quadrilateral functions to retu…
nikoscham Dec 15, 2025
4cfddd5
Create pointSearch function for improved maintainability
nikoscham Dec 15, 2025
230ba10
Update plotInterpolatedSolution and pointSearch functions for improve…
nikoscham Dec 15, 2025
823069c
Change variable names for consistency in Mesh class
nikoscham Dec 16, 2025
e3c14fd
Add TODOs (rename importGmshQuadTri and create getBoundarySegments fu…
nikoscham Dec 16, 2025
d955973
- Add getBoundarySegments function to extract boundary line segments …
nikoscham Dec 17, 2025
73a6035
Update index.js to export plotInterpolatedSolution
nikoscham Dec 17, 2025
281dabf
Update npm build
nikoscham Dec 17, 2025
2ec5ab5
Added a check to prevent re-processing of already converted meshes
nikoscham Dec 18, 2025
a4c70f5
Merge branch 'main' into feature/arbitrary-geometries2
nikoscham Dec 18, 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
2 changes: 1 addition & 1 deletion dist/feascript.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/feascript.umd.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/**
* ════════════════════════════════════════════════════════════
* FEAScript Library
* ════════════════════════════════════════════════════════════════
* FEAScript Core Library
* Lightweight Finite Element Simulation in JavaScript
* Version: 0.1.4 | https://feascript.com
* ════════════════════════════════════════════════════════════
* Version: 0.2.0 (RC) | https://feascript.com
* MIT License © 2023–2025 FEAScript
* ════════════════════════════════════════════════════════════════
*/

// Import Math.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/**
* ════════════════════════════════════════════════════════════
* FEAScript Library
* ════════════════════════════════════════════════════════════════
* FEAScript Core Library
* Lightweight Finite Element Simulation in JavaScript
* Version: 0.1.4 | https://feascript.com
* ════════════════════════════════════════════════════════════
* Version: 0.2.0 (RC) | https://feascript.com
* MIT License © 2023–2025 FEAScript
* ════════════════════════════════════════════════════════════════
*/

// Import Math.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/**
* ════════════════════════════════════════════════════════════
* FEAScript Library
* ════════════════════════════════════════════════════════════════
* FEAScript Core Library
* Lightweight Finite Element Simulation in JavaScript
* Version: 0.1.4 | https://feascript.com
* ════════════════════════════════════════════════════════════
* Version: 0.2.0 (RC) | https://feascript.com
* MIT License © 2023–2025 FEAScript
* ════════════════════════════════════════════════════════════════
*/

// Import Math.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/**
* ════════════════════════════════════════════════════════════
* FEAScript Library
* ════════════════════════════════════════════════════════════════
* FEAScript Core Library
* Lightweight Finite Element Simulation in JavaScript
* Version: 0.1.4 | https://feascript.com
* ════════════════════════════════════════════════════════════
* Version: 0.2.0 (RC) | https://feascript.com
* MIT License © 2023–2025 FEAScript
* ════════════════════════════════════════════════════════════════
*/

// Import Math.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/**
* ════════════════════════════════════════════════════════════
* FEAScript Library
* ════════════════════════════════════════════════════════════════
* FEAScript Core Library
* Lightweight Finite Element Simulation in JavaScript
* Version: 0.1.4 | https://feascript.com
* ════════════════════════════════════════════════════════════
* Version: 0.2.0 (RC) | https://feascript.com
* MIT License © 2023–2025 FEAScript
* ════════════════════════════════════════════════════════════════
*/

// Import required Node.js modules
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "feascript",
"version": "0.1.4",
"version": "0.2.0 (RC)",
"description": "Lightweight finite element simulation library built in JavaScript for browser-based physics and engineering simulations",
"main": "dist/feascript.cjs.js",
"module": "dist/feascript.esm.js",
Expand Down
31 changes: 18 additions & 13 deletions src/FEAScript.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/**
* ════════════════════════════════════════════════════════════
* FEAScript Library
* ════════════════════════════════════════════════════════════════
* FEAScript Core Library
* Lightweight Finite Element Simulation in JavaScript
* Version: 0.1.4 | https://feascript.com
* ════════════════════════════════════════════════════════════
* Version: 0.2.0 (RC) | https://feascript.com
* MIT License © 2023–2025 FEAScript
* ════════════════════════════════════════════════════════════════
*/

// Internal imports
Expand All @@ -22,7 +23,7 @@ import { basicLog, debugLog, warnLog, errorLog } from "./utilities/loggingScript
* @param {string} solverConfig - Parameter specifying the type of solver
* @param {object} meshConfig - Object containing computational mesh details
* @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis
* @returns {object} An object containifng the solution vector and additional mesh information
* @returns {object} An object containifng the solution vector and mesh information
*/
export class FEAScriptModel {
constructor() {
Expand Down Expand Up @@ -79,7 +80,7 @@ export class FEAScriptModel {
/**
* Function to solve the finite element problem synchronously
* @param {object} [options] - Additional parameters for the solver, such as `maxIterations` and `tolerance`
* @returns {object} An object containing the solution vector and the coordinates of the mesh nodes
* @returns {object} An object containing the solution vector and mesh information
*/
solve(options = {}) {
if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {
Expand All @@ -105,7 +106,7 @@ export class FEAScriptModel {
const meshData = prepareMesh(this.meshConfig);
basicLog("Mesh preparation completed");

// Extract node coordinates from meshData
// Extract node coordinates and nodal numbering from meshData
const nodesCoordinates = {
nodesXCoordinates: meshData.nodesXCoordinates,
nodesYCoordinates: meshData.nodesYCoordinates,
Expand Down Expand Up @@ -228,11 +229,16 @@ export class FEAScriptModel {
({ jacobianMatrix, residualVector } = assembleHeatConductionMat(meshData, this.boundaryConditions));

if (this.solverMethod === "jacobi-gpu") {
const { solutionVector: x } = await solveLinearSystemAsync("jacobi-gpu", jacobianMatrix, residualVector, {
computeEngine,
maxIterations: options.maxIterations ?? this.maxIterations,
tolerance: options.tolerance ?? this.tolerance,
});
const { solutionVector: x } = await solveLinearSystemAsync(
"jacobi-gpu",
jacobianMatrix,
residualVector,
{
computeEngine,
maxIterations: options.maxIterations ?? this.maxIterations,
tolerance: options.tolerance ?? this.tolerance,
}
);
solutionVector = x;
} else {
// Other async solver
Expand All @@ -243,5 +249,4 @@ export class FEAScriptModel {

return { solutionVector, nodesCoordinates };
}

}
15 changes: 8 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/**
* ════════════════════════════════════════════════════════════
* FEAScript Library
* ════════════════════════════════════════════════════════════════
* FEAScript Core Library
* Lightweight Finite Element Simulation in JavaScript
* Version: 0.1.4 | https://feascript.com
* ════════════════════════════════════════════════════════════
* Version: 0.2.0 (RC) | https://feascript.com
* MIT License © 2023–2025 FEAScript
* ════════════════════════════════════════════════════════════════
*/

export { FEAScriptModel } from "./FEAScript.js";
export { importGmshQuadTri } from "./readers/gmshReaderScript.js";
export { importGmshQuadTri } from "./readers/gmshReaderScript.js"; //TODO rename importGmshQuadTri to importGmsh
export { logSystem } from "./utilities/loggingScript.js";
export { plotSolution } from "./visualization/plotSolutionScript.js";
export { plotSolution, plotInterpolatedSolution } from "./visualization/plotSolutionScript.js";
export { FEAScriptWorker } from "./workers/workerScript.js";
export const printVersion = "0.1.4";
export const printVersion = "0.2.0 (RC)";
9 changes: 5 additions & 4 deletions src/mesh/basisFunctionsScript.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/**
* ════════════════════════════════════════════════════════════
* FEAScript Library
* ════════════════════════════════════════════════════════════════
* FEAScript Core Library
* Lightweight Finite Element Simulation in JavaScript
* Version: 0.1.4 | https://feascript.com
* ════════════════════════════════════════════════════════════
* Version: 0.2.0 (RC) | https://feascript.com
* MIT License © 2023–2025 FEAScript
* ════════════════════════════════════════════════════════════════
*/

// Internal imports
Expand Down
Loading