|
[Sponsors] |
Introducing FEAScript: A JavaScript FEM Library |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 30
Rep Power: 14 ![]() |
Hello everyone,
I’d like to share with you my project, FEAScript (Website | GitHub). FEAScript is a finite element simulation library written entirely in JavaScript. My aim with FEAScript is to make FEM simulations accessible directly from the browser, empowering users with minimal setup requirements. If you have basic programming skills and a browser, you’re ready to start experimenting! Current Capabilities FEAScript is still in its early stages of development, but it already provides: - Solid heat conduction analysis: Solve steady-state heat conduction problems - Visualization: Results can be visualized using plotly - Documentation: Currently limited to a brief overview of FEM theory You can explore example tutorials on the FEAScript website. For instance, check out this simulation of heat conduction in a 2D fin. What’s Next? As FEAScript evolves, I aim to: - Add support for other physics (e.g., fluid flow, structural mechanics). - Incorporate more numerical techniques and mesh generation tools (e.g., elliptic mesh generation capabilities) - Improve API usability for easier integration with other tools. If you find this project useful or promising, please consider giving it a ⭐ on GitHub. Your support helps increase the project’s visibility and attract collaborators. I’m also eager to hear your feedback, feature ideas, or suggestions for improvement. I’ll keep this thread updated with new developments. Feel free to share your thoughts or reach out if you’d like to collaborate. Looking forward to your feedback, Nikos Chamakos Last edited by nikoscham; December 4, 2024 at 04:10. |
|
![]() |
![]() |
![]() |
![]() |
#2 | |
Senior Member
andy
Join Date: May 2009
Posts: 347
Rep Power: 18 ![]() |
Quote:
Is the end result intended to be a webpage displaying the results? If the user wishes to change the input to specify a different problem they edit some json files and post them to the web somewhere to be picked up and processed by javascript in the browser? What is the advantage compared to solving and creating the plot locally and then posting it to a webpage. Not saying there aren't advantages just that I can't see them given the latter is fairly well developed these days. |
||
![]() |
![]() |
![]() |
![]() |
#3 | |
Member
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 30
Rep Power: 14 ![]() |
Quote:
Thank you for your feedback and for taking the time to engage with my project! You’ve raised some interesting points, and I’d be happy to elaborate on the advantages of FEAScript’s approach. FEAScript is designed to run entirely in the front end for a few key reasons: 1. Minimal setup Users don’t need to install back-end solvers, configure environments, or manage dependencies. All they need is a browser to start experimenting. 2. Educational tool Educators can embed simulations in online courses or tutorials as simple URLs. Imagine a "JSFiddle" for finite elements. Users can tweak parameters and instantly see the results, encouraging interactive learning. 3. Offline capability Unlike many server-side, or cloud based solutions, FEAScript can work offline once loaded in the browser, making it convenient for quick testing or use in environments with limited connectivity. You’re absolutely right that traditional client-server approaches are well-developed and remain powerful for large-scale or complex simulations. However, FEAScript is targeting accessible lightweight and interactive FEM rather than replacing established tools for high-performance computations. Thanks again for your input. I really appreciate it! If you have additional thoughts or suggestions, I’d love to hear them. Best regards, Nikos |
||
![]() |
![]() |
![]() |
![]() |
#4 | |
Senior Member
andy
Join Date: May 2009
Posts: 347
Rep Power: 18 ![]() |
Quote:
Playing devils advocate, how would your proposed library improve on/differ from taking one of the zillions of exisinting FEA libraries, running it through empscripten and writing a few JS patches? |
||
![]() |
![]() |
![]() |
![]() |
#5 | |
Member
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 30
Rep Power: 14 ![]() |
Quote:
FEAScript is indeed dynamic. You can try it yourself: Go to the example case here. Save the HTML and the JSON files to your computer. Open the HTML, modify the JSON, refresh the page and see the updated results. You can modify e.g. the boundary conditions, the domain dimensions, the number of elements etc. I want to clarify that hosting JSON files online is just one way to define inputs. You can also store the JSON files locally (along with the FEAScript library itself if you want) after enabling cross-origin resource sharing (CORS). Regarding the Emscripten, according to my knowledge, no major FEA library has been successfully compiled to Wasm yet with full functionality. Compiling such complex software (such as Calculix for example) is theoretically possible, but challenges include extensive dependencies, file operations and performance limitations since threading, and hardware acceleration in general, may not be easily supported. On the other hand, FEAScript can provide a simpler and native solution for lightweight FEA applications directly in the browser. Additionally, a potential future enhancement could involve writing high-performance parts of FEAScript in Wasm, such as the linear system solvers, to improve efficiency where needed. Best regards, Nikos |
||
![]() |
![]() |
![]() |
![]() |
#6 |
Member
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 30
Rep Power: 14 ![]() |
I've also included the 2D heat conduction example files from the GitHub repository in the attached zip file. This will allow everyone to easily run it.
Best regards, Nikos Update as of December 2024: The example attached here is now outdated. You can download the updated example files from the following URL: https://github.com/FEAScript/FEAScri...onduction2DFin Last edited by nikoscham; December 4, 2024 at 04:14. |
|
![]() |
![]() |
![]() |
![]() |
#7 | |
Senior Member
andy
Join Date: May 2009
Posts: 347
Rep Power: 18 ![]() |
Quote:
If it was my project I would consider replacing editing json files (a data exchange format) with javascript (a scripting language) or possibly a gui. I would also consider making the posted examples dynamic rather than hoping users will download the files and install firefox in order to run the example (which worked). Unless github doesn't want this? |
||
![]() |
![]() |
![]() |
![]() |
#8 | ||||
Member
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 30
Rep Power: 14 ![]() |
Initially, I would like to thank you for running the example and providing feedback that it worked!
Quote:
Quote:
Quote:
Quote:
As for Firefox ![]() ![]() Best regards, Nikos Last edited by nikoscham; November 28, 2024 at 02:26. |
|||||
![]() |
![]() |
![]() |
![]() |
#9 | ||||||
Senior Member
andy
Join Date: May 2009
Posts: 347
Rep Power: 18 ![]() |
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
You gave instructions for firefox. I judged it quicker to install firefox and follow your recipe than read up on how to change the settings for my browser given I have no interest in learning about the details of browser security settings. Installing local browsers and FEM packages is a non-issue for most people with an interest in FEM libraries. |
|||||||
![]() |
![]() |
![]() |
![]() |
#10 | |
Member
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 30
Rep Power: 14 ![]() |
Quote:
Initially I want to thank you for your time and feedback. I really appreciate it! The main concern you raised is the JSON input format. After giving this more thought, I must admit you are right. JSON might not be the a user-friendly format. Based on your feedback and further investigation, I’ve decided to shift to JavaScript workflow, i.e. offering a JavaScript API that allows users to directly interact with the library's functions. I believe this approach will significantly improve usability. Now, it’s time to dive into coding! Best regards, Nikos |
||
![]() |
![]() |
![]() |
![]() |
#11 | |
Member
Nikos
Join Date: Aug 2012
Location: Greece
Posts: 30
Rep Power: 14 ![]() |
Quote:
Thank you again for your valuable feedback. I have transformed the library to support a JavaScript API workflow. This should eliminate the previous issues with JSON input format and provide a more interactive and user-friendly experience. Here’s a live example to demonstrate the new functionality. You can now directly edit the script in the browser without needing to handle separate files or browser configurations. You can modify the elementOrder (linear or quadratic), numElementsX, numElementsY, maxX, maxY as well as the boundary conditions. FEAScript alpha version is on its way (I hope) soon! Best regards, Nikos |
||
![]() |
![]() |
![]() |
![]() |
#12 | |
Senior Member
andy
Join Date: May 2009
Posts: 347
Rep Power: 18 ![]() |
Quote:
The reason is that writing numerical solvers in something other than Fortran, C and perhaps C++ depending on the amount boilerplate is generally a poor idea because the support (e.g. BLAS, MPI, OpenMP, etc...) is weak and the program will run slowly which matters for numerical solvers in the way it doesn't for many other tasks performed on a computer. On the other hand writing the pre/post processing in Fortran, C and C++ can be a poor choice given the higher level support and libraries available in other languages. For a few smaller cases it may sometimes make sense for the tail to wag the dog and shift the solver into pre/post processing. In the case of a javascript FE solver the only reasonable usage case I can see is interactive web pages containing small teaching examples. Personally I wouldn't write a javascript solver to address this and instead woutld either use a backend to an existing solver or transpile an existing solver. Nonetheless if a proven js FE solver existed I can see a few people authoring material to support the teaching of FEA possibly using it. I cannot see it being used as a local app like vscode because it will be slow and bloated in comparison with the many existing FEA solvers. I could be wrong though because what is technically reasonable in terms of code is only a part of what can lead to success. |
||
![]() |
![]() |
![]() |
Tags |
fem, finite elements, galerkin method, javascript, simulation |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Introducing the combined Poisson-Boltzmann-Ohmic Library for rheoTool in OpenFOAM | saicharan662000@gmail.com | OpenFOAM Running, Solving & CFD | 0 | August 13, 2024 12:53 |
Rheolef, a free C++ FEM library for solving PDE : version 6.0 is out ! | saramito | Main CFD Forum | 1 | February 22, 2019 01:11 |
decomposePar is missing a library | whk1992 | OpenFOAM Pre-Processing | 8 | March 7, 2015 07:53 |
Rheolef 6.2: an efficient FEM C++ finite element library for solving PDE | saramito | Main CFD Forum | 0 | July 2, 2012 10:58 |
Rheolef 6.1: an efficient FEM C++ finite element library for solving PDE | saramito | Main CFD Forum | 0 | May 17, 2012 03:01 |