1D Heat Equation Solver 1.0
Computational Methods Assignment 2025
Loading...
Searching...
No Matches
main.cpp File Reference

Test driver for the 1D heat conduction solver. Supports DuFort-Frankel, Richardson, Laasonen, and Crank-Nicolson schemes. More...

#include "grid.hpp"
#include "io.hpp"
#include "method.hpp"
#include "methods/analytical.hpp"
#include "solver.hpp"
#include "types.hpp"
#include "user_input.h"
#include <filesystem>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

void run_simulation (const PhysParams &phys, const NumParams &num, SchemeKind scheme, const std::string &schemeName)
 Run a single simulation with the specified scheme.
int main ()
 Main entry point for the 1D Heat Equation Solver.

Detailed Description

Test driver for the 1D heat conduction solver. Supports DuFort-Frankel, Richardson, Laasonen, and Crank-Nicolson schemes.

Definition in file main.cpp.

Function Documentation

◆ main()

int main ( )

Main entry point for the 1D Heat Equation Solver.

This function orchestrates the entire simulation workflow:

  1. Defines physical and numerical parameters.
  2. Validates the grid.
  3. Prompts the user for method selection.
  4. Executes the selected simulation(s).
Returns
int 0 on success, 1 on error.

Definition at line 81 of file main.cpp.

Here is the call graph for this function:

◆ run_simulation()

void run_simulation ( const PhysParams & phys,
const NumParams & num,
SchemeKind scheme,
const std::string & schemeName )

Run a single simulation with the specified scheme.

This helper function avoids code duplication by handling the solver setup, directory creation, and output callback for any given scheme.

Parameters
physPhysical parameters.
numNumerical parameters.
schemeThe numerical scheme to use.
schemeNameString name for output directory (e.g. "Crank-Nicolson").

Definition at line 35 of file main.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: