 |
Shiokaze Framework
A research-oriented fluid solver for computer graphics
|
|
Go to the documentation of this file.
25 #ifndef SHKZ_ARRAY_EXTRAPOLATOR2_H
26 #define SHKZ_ARRAY_EXTRAPOLATOR2_H
47 template<
class T>
unsigned extrapolate_if (
array2<T> &array, std::function<
bool(
int i,
int j,
int thread_index )> func,
int count=1 ) {
52 array.
dilate([&](
int i,
int j,
auto &it,
int tn ) {
57 for(
int nq=0; nq<4; nq++ ) {
68 it.set( sum / weight );
74 for(
const auto &e : counters ) sum += e;
86 return extrapolate_if(array,[&](
int i,
int j,
int tn){
return true; },count);
bool out_of_bounds(int i, int j) const
Get if the position is outside of the index space of this shape.
Definition: shape.h:341
shape2 shape() const
Get the shape of the array.
Definition: array2.h:218
bool active(int i, int j) const
Get if a position on grid is active.
Definition: array2.h:546
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
void dilate(std::function< void(int i, int j, iterator &it, int thread_index)> func, int count=1)
Dilate cells.
Definition: array2.h:1639
Fixed sized vector structure.
Definition: vec.h:38
Two dimensional array class designed to be defined as instance member in recursive_configurable class...
Definition: array2.h:42
Structure that defines shape such as width, height.
Definition: shape.h:42
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
int get_thread_num() const
Get the current number of threads for parallel processing on this grid.
Definition: array2.h:932