24 template<
size_t dimension>
26 size_t x,
size_t y,
size_t z);
30 size_t x,
size_t y,
size_t z) {
31 out.at(x, y, z) = (in.at(2 * x, y, z) + in.at(2 * x + 1, y, z)) / 2.0;
36 size_t x,
size_t y,
size_t z) {
37 out.at(x, y, z) = (in.at(2 * x, 2 * y, z) + in.at(2 * x + 1, 2 * y, z)
38 + in.at(2 * x, 2 * y + 1, z) + in.at(2 * x + 1, 2 * y + 1, z)) / 4.0;
43 size_t x,
size_t y,
size_t z) {
47 for (
size_t i = 0; i < 2; ++i) {
48 for (
size_t j = 0; j < 2; ++j) {
49 for (
size_t k = 0; k < 2; ++k) {
50 out.at(x, y, z) += in.at(2 * x + k, 2 * y + j, 2 * z + i);
55 out.at(x, y, z) /= 16;
58 template<
size_t dimension>
61 THROW(
"Currently we only support doing interpolation with the ration 2 to 1.");
69 bool hasZ = dimension > 2;
70 bool hasY = dimension > 1;
76 for (
size_t z = hasZ * ng; z < nz - hasZ * ng ; ++z) {
77 for (
size_t y = hasY * ng; y < ny - hasY * ng; ++y) {
78 for (
size_t x = ng; x < nx - ng; ++x) {
79 interpolate<dimension>(viewOut, viewIn, x, y, z);
#define THROW(message)
Definition: Exception.hpp:27
void interpolate< 3 >(memory::View< real > &out, memory::View< const real > &in, size_t x, size_t y, size_t z)
Definition: interpolate.hpp:42
virtual alsfvm::shared_ptr< memory::Memory< real > > & getScalarMemoryArea(size_t index)
getScalarMemoryArea gets the scalar memory area (real)
Definition: Volume.cpp:107
The Volume class represents a volume (a collection of cells with values for each cell (eg...
Definition: Volume.hpp:30
virtual size_t getNumberOfVariables() const
getNumberOfVariables gets the number of variables used
Definition: Volume.cpp:83
virtual size_t getTotalNumberOfYCells() const
Definition: Volume.cpp:268
size_t nx
Definition: VolumeFactory.cpp:87
virtual size_t getTotalNumberOfZCells() const
Definition: Volume.cpp:275
virtual size_t getNumberOfXGhostCells() const
Definition: Volume.cpp:238
size_t ny
Definition: VolumeFactory.cpp:88
virtual size_t getNumberOfXCells() const
Definition: Volume.cpp:201
void interpolate(memory::View< real > &out, memory::View< const real > &in, size_t x, size_t y, size_t z)
size_t nz
Definition: VolumeFactory.cpp:89
Various utility functions to implement the tecno flux.
Definition: types.hpp:30
virtual size_t getTotalNumberOfXCells() const
Definition: Volume.cpp:261
void interpolate< 1 >(memory::View< real > &out, memory::View< const real > &in, size_t x, size_t y, size_t z)
Definition: interpolate.hpp:29
void interpolate< 2 >(memory::View< real > &out, memory::View< const real > &in, size_t x, size_t y, size_t z)
Definition: interpolate.hpp:35