Skip to content

Conversation

Stu-ops
Copy link
Contributor

@Stu-ops Stu-ops commented Oct 1, 2025

✨ New Feature: Flexible 1D PDE Solver for FEAScript

This PR introduces a general-purpose solver for 1D linear differential equations into the FEAScript core library.
The solver supports equations of the form:


🚀 Motivation

  • Provides users with the ability to solve a wide range of 1D physical problems (e.g. heat transfer, diffusion, mechanics) by specifying only the coefficients and boundary conditions.
  • Establishes a general and extensible framework for future PDE solvers within FEAScript.
  • Enhances usability for both new and advanced users, making PDE solving more accessible.

🔑 Key Changes

  • Added generalFormPDESolver.js implementing weak form assembly and solution for general 1D PDEs.
  • Support for user-defined coefficient functions and Dirichlet boundary conditions.
  • Added example script: exampleGeneralFormPDE.js.
  • Updated documentation:
    • Extended README.md with usage instructions and code samples.
    • Included an example workflow.

🧪 How to Test

  1. Install dependencies:
    npm install
    
  2. Run the example Script:
    node exampleGeneralFormPDE.js
  3. Verify that the output matches the expected results for the provided test problem.

📌 Next Steps / Future Work

● Extend solver to support Neumann and Robin boundary conditions.
● Add additional example problems and tutorials.
● Optimize solver for larger meshes and systems to improve performance.

Copy link
Member

@nikoscham nikoscham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Stu-ops for this PR! It's a solid contribution and a good start towards adding flexible PDE solving capabilities to FEAScript. I appreciate the effort put into implementing the weak form assembly, supporting user-defined coefficients, and including an example script along with updated documentation.
I'm accepting and merging this PR as-is—especially since it's Hacktoberfest, and you've earned the credit for kicking this off. However, I won't be closing the related issue (#3) just yet, as the code isn't fully integrated with the rest of FEAScript's ecosystem. For instance, to follow DRY principles, things like mesh preparation, basis function calculations, linear system solving, etc, should leverage FEAScript's existing tools and utilities rather than reimplementing them from scratch here. This will make it more maintainable and consistent with the library's architecture.
I'll take it over from here to refine the integration and build on your foundation. Thanks again for the work—feel free to contribute more in the future!
So, hacktoberfest-accepted!

@nikoscham nikoscham added hacktoberfest enhancement New feature or request labels Oct 1, 2025
@nikoscham nikoscham merged commit d606061 into FEAScript:main Oct 1, 2025
@Stu-ops
Copy link
Contributor Author

Stu-ops commented Oct 1, 2025

Thanks @nikoscham for this kind and supportive nature, from assigning the issue to me to here. you guidance and help were helpful for me on this journey to completing. If I can do something for your future, it will be good for me.

@nikoscham nikoscham linked an issue Oct 7, 2025 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Development of a new solver for 1D differential equations
2 participants