num::scalar_field_2d¶
Defined in header <fields/scalar_field_2d.hpp>
class scalar_field_2d;
scalar values stored at the interior nodes of a uniform square grid.
Members¶
| member | description |
|---|---|
explicit scalar_field_2d(grid2d g) |
Allocate a zero-filled field on g. |
template <typename F> scalar_field_2d(grid2d g, F &&f) |
Sample f(x,y) at every grid node during construction. |
const grid2d &grid() const |
Return the field geometry. |
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) |
Replace every field value with f(x,y) at its node. |
vec<real> &as_vec() |
Access the contiguous values in row-major grid order. |
const vec<real> &as_vec() const |
|
real *data() |
|
const real *data() const |
|
idx size() const |