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

Implementation of the uniform 1D grid and its validator. More...

#include "grid.hpp"
#include <cmath>
#include <stdexcept>
#include <cassert>
Include dependency graph for grid.cpp:

Go to the source code of this file.

Functions

bool validate_grid (const Grid &g, double tol)
 Validate grid consistency (assertions in Debug mode).

Detailed Description

Implementation of the uniform 1D grid and its validator.

Definition in file grid.cpp.

Function Documentation

◆ validate_grid()

bool validate_grid ( const Grid & g,
double tol = 1e-12 )

Validate grid consistency (assertions in Debug mode).

Checks endpoints, monotonicity, uniform spacing and Nx consistency.

Parameters
gGrid to validate
tolTolerance for floating-point comparisons (default 1e-12)
Returns
true if all assertions pass

Definition at line 26 of file grid.cpp.

Here is the caller graph for this function: