1D Heat Equation Solver 1.0
Computational Methods Assignment 2025
Loading...
Searching...
No Matches
CrankNicolson Class Reference

Crank-Nicolson scheme implementation. More...

#include <crank_nicolson.hpp>

Inheritance diagram for CrankNicolson:
Inheritance graph
Collaboration diagram for CrankNicolson:
Collaboration graph

Public Member Functions

std::string name () const override
 Get human-readable name of the scheme.
bool uses_previous_step () const noexcept override
 Indicates if the scheme requires data from time step n-1.
void step (const Grid &g, double D, double dt, const std::vector< double > &Tprev, const std::vector< double > &Tcurr, std::vector< double > &Tnext) const override
 Advance one time step using Crank-Nicolson scheme.
Public Member Functions inherited from Method
virtual ~Method ()=default

Detailed Description

Crank-Nicolson scheme implementation.

Definition at line 9 of file crank_nicolson.hpp.

Member Function Documentation

◆ name()

std::string CrankNicolson::name ( ) const
inlineoverridevirtual

Get human-readable name of the scheme.

Implements Method.

Definition at line 12 of file crank_nicolson.hpp.

◆ step()

void CrankNicolson::step ( const Grid & g,
double D,
double dt,
const std::vector< double > & Tprev,
const std::vector< double > & Tcurr,
std::vector< double > & Tnext ) const
overridevirtual

Advance one time step using Crank-Nicolson scheme.

Implements Method.

Definition at line 11 of file crank_nicolson.cpp.

◆ uses_previous_step()

bool CrankNicolson::uses_previous_step ( ) const
inlineoverridevirtualnoexcept

Indicates if the scheme requires data from time step n-1.

Returns
true For 3-level schemes (e.g., Richardson, DuFort-Frankel).
false For 2-level schemes (e.g., Laasonen, Crank-Nicolson).

Implements Method.

Definition at line 17 of file crank_nicolson.hpp.


The documentation for this class was generated from the following files: