|
|
|
@ -10,18 +10,7 @@ class Simple2DData: public BaseData
|
|
|
|
|
public: |
|
|
|
|
Simple2DData() = default; |
|
|
|
|
|
|
|
|
|
Simple2DData(size_t nx_, size_t ny_, real x0_, real y0_, real xs_, real ys_): |
|
|
|
|
BaseData( |
|
|
|
|
nx_ * ny_, [x0 = x0_, nx = nx_, xstep = xs_](size_t i) -> real { return x0 + (i % nx) * xstep; }, |
|
|
|
|
[y0 = y0_, nx = nx_, ystep = ys_](size_t i) -> real { return y0 + (i / nx) * ystep; }), |
|
|
|
|
x0(x0_), |
|
|
|
|
y0(y0_), |
|
|
|
|
nx(nx_), |
|
|
|
|
ny(ny_), |
|
|
|
|
xstep(xs_), |
|
|
|
|
ystep(ys_) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
Simple2DData(size_t nx_, size_t ny_, real x0_, real y0_, real xs_, real ys_): BaseData(nx_ * ny_), x0(x0_), y0(y0_), nx(nx_), ny(ny_), xstep(xs_), ystep(ys_) {} |
|
|
|
|
|
|
|
|
|
const real& V(size_t i) const { return BaseData::V(i); } |
|
|
|
|
real& V(size_t i) { return BaseData::V(i); } |
|
|
|
|