1D Heat Equation Solver 1.0
Computational Methods Assignment 2025
Loading...
Searching...
No Matches
method.hpp File Reference
#include "grid.hpp"
#include <memory>
#include <string>
#include <vector>
Include dependency graph for method.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Method
 Abstract interface for time-integration schemes solving the 1D heat equation. More...

Enumerations

enum class  SchemeKind { Richardson , DuFortFrankel , Laasonen , CrankNicolson }
 Enumeration of the numerical schemes available in the solver. More...

Functions

std::unique_ptr< Methodmake_method (SchemeKind scheme)
 Factory function to create a concrete method instance.

Enumeration Type Documentation

◆ SchemeKind

enum class SchemeKind
strong

Enumeration of the numerical schemes available in the solver.

Enumerator
Richardson 

Central time, central space (explicit, unstable).

DuFortFrankel 

Modified Richardson (explicit, stable).

Laasonen 

Simple Implicit (forward time, central space).

CrankNicolson 

Trapezoidal Implicit (second order accuracy).

Definition at line 12 of file method.hpp.

Function Documentation

◆ make_method()

std::unique_ptr< Method > make_method ( SchemeKind scheme)

Factory function to create a concrete method instance.

Parameters
schemeThe type of numerical scheme requested.
Returns
std::unique_ptr<Method> Pointer to the created solver method.

Factory function to create a concrete method instance.

Parameters
schemeIdentifier of the requested scheme.
Returns
std::unique_ptr<Method> Owning pointer to the created scheme.
Exceptions
std::invalid_argumentif the scheme is not supported.

Definition at line 27 of file method.cpp.

Here is the caller graph for this function: