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

Uniform 1D grid on x ∈ [0, L], including both boundary nodes. More...

#include <grid.hpp>

Collaboration diagram for Grid:
Collaboration graph

Public Member Functions

 Grid (double L_cm, double dx_cm)
 Construct a grid with given length and spacing.

Public Attributes

double L
 Domain length [cm].
double dx
 Spatial step [cm].
std::size_t Nx
 Number of nodes (including boundaries).
std::vector< double > x
 Node coordinates [cm].

Detailed Description

Uniform 1D grid on x ∈ [0, L], including both boundary nodes.

Builds Nx = round(L/dx) + 1 nodes with coordinates x[i] = i * dx.

Definition at line 15 of file grid.hpp.

Constructor & Destructor Documentation

◆ Grid()

Grid::Grid ( double L_cm,
double dx_cm )

Construct a grid with given length and spacing.

Parameters
L_cmDomain length [cm]
dx_cmSpatial step [cm]

Definition at line 11 of file grid.cpp.

Member Data Documentation

◆ dx

double Grid::dx

Spatial step [cm].

Definition at line 17 of file grid.hpp.

◆ L

double Grid::L

Domain length [cm].

Definition at line 16 of file grid.hpp.

◆ Nx

std::size_t Grid::Nx

Number of nodes (including boundaries).

Definition at line 18 of file grid.hpp.

◆ x

std::vector<double> Grid::x

Node coordinates [cm].

Definition at line 19 of file grid.hpp.


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