num::fill_grid¶
Defined in header <pde/stencil.hpp>
template <std::invocable<double, double> F>
void fill_grid(vec<real> &u, int N, double h, F &&f); // (1)
template <std::invocable<double, double> F>
void fill_grid(scalar_field_2d &g, F &&f); // (2)
Set grid values from a function: \(u_{ij} = f((i + 1) h,\ (j + 1) h)\).