Skip to content

Feat/crank–nicolson#54

Merged
Broky64 merged 3 commits intodevfrom
feat/crank–nicolson
Dec 1, 2025

Hidden character warning

The head ref may contain hidden characters: "feat/crank\u2013nicolson"
Merged

Feat/crank–nicolson#54
Broky64 merged 3 commits intodevfrom
feat/crank–nicolson

Conversation

@Broky64
Copy link
Owner

@Broky64 Broky64 commented Dec 1, 2025

This pull request introduces the Crank-Nicolson numerical scheme into the codebase, enabling a new time-stepping method for solving heat equations. The changes include implementing the Crank-Nicolson algorithm, updating the method factory to support it, and modifying the main simulation workflow to use and demonstrate this scheme. Additionally, some code cleanup and minor improvements are made for clarity and robustness.

Crank-Nicolson Scheme Integration:

  • Added the CrankNicolson class implementing the Crank-Nicolson scheme in include/methods/crank_nicolson.hpp and its algorithm in src/methods/crank_nicolson.cpp. The scheme uses the Thomas Algorithm to solve the tridiagonal system at each time step. [1] [2]
  • Updated the SchemeKind enum and the Method base class in include/method.hpp to include CrankNicolson and ensure consistent formatting and extensibility. [1] [2] [3]

Method Factory and Solver Updates:

  • Modified the method factory in src/method.cpp to instantiate the Crank-Nicolson scheme and handle unsupported schemes with clear error messages.
  • Updated the main simulation flow in src/main.cpp to run the Crank-Nicolson solver, set up output directories, and save results using the new scheme. [1] [2] [3]

I/O and Output Directory Handling:

  • Improved output directory handling in src/io.cpp and the main workflow to ensure results are saved to the correct location, allowing for flexible output paths. [1] [2]

These changes collectively enable the use of the Crank-Nicolson scheme for heat equation simulations, improve code clarity, and ensure results are stored in an organized manner.

@Broky64 Broky64 merged commit a64fe69 into dev Dec 1, 2025
0 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant