numerics 0.1.0
Loading...
Searching...
No Matches
scalar_field_2d.hpp File Reference

Scalar field on a 2D uniform interior grid. More...

#include "fields/grid2d.hpp"
#include "core/vector.hpp"

Go to the source code of this file.

Classes

class  num::ScalarField2D
 

Namespaces

namespace  num
 

Detailed Description

Scalar field on a 2D uniform interior grid.

ScalarField2D owns a Grid2D (geometry) and a flat Vector (values). Node (i,j) sits at ((i+1)*h, (j+1)*h); the boundary ring is implicitly zero (Dirichlet) – BCs are enforced by the operator, not the field.

num::Grid2D grid{64, 1.0/65};
num::ScalarField2D u(grid, [=](double x, double y) {
return num::gaussian2d(x, y, 0.5, 0.5, 0.06);
});
real gaussian2d(real x, real y, real cx, real cy, real sigma)
2D isotropic Gaussian centred at with width :
Definition math.hpp:310

Definition in file scalar_field_2d.hpp.