Skip to content

num::scalar_field_2d

Defined in header <fields/scalar_field_2d.hpp>

class scalar_field_2d;

Scalar field at the interior points of a 2D grid: \(u_{ij}\).

Members

member description
explicit scalar_field_2d(grid2d g) Construct a zero field on g.
template <typename F> scalar_field_2d(grid2d g, F &&f) Construct a field from the values f(x, y).
const grid2d &grid() const Return the grid.
int N() const
double h() const
real &operator()(int i, int j)
real operator()(int i, int j) const
template <typename F> void fill(F &&f) Set the values from a function: \(u_{ij} \leftarrow f(x_i, y_j)\).
vec<real> &as_vec() Return the values as a vector, row-major.
const vec<real> &as_vec() const
real *data()
const real *data() const
idx size() const