 |
Shiokaze Framework
A research-oriented fluid solver for computer graphics
|
|
Go to the documentation of this file.
25 #ifndef SHKZ_ARRAY_GRADIENT2_H
26 #define SHKZ_ARRAY_GRADIENT2_H
38 template<
class T>
void compute_gradient(
const array2<T> &array,
macarray2<T> &gradient,
double dx ) {
39 for(
int dim : DIMS2 ) {
40 gradient[dim].
clear();
47 (array(shape.
clamp(i,j))
48 -array(shape.
clamp(i-(dim==0),j-(dim==1)))
void parallel_actives(std::function< void(typename array2< T >::iterator &it)> func)
Loop over all the active cells in parallel.
Definition: macarray2.h:554
void activate_as(const macarray2< Y > &array, const std::array< vec2i, DIM2 > &offsets={vec2i(), vec2i()})
Activate cells at the same positons where an input array is active with an offset.
Definition: macarray2.h:214
shape2 shape() const
Get the shape of the array.
Definition: array2.h:218
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
void clear()
Clear out the grid.
Definition: macarray2.h:390
Fixed sized vector structure.
Definition: vec.h:38
Class that computes the gradient of physical quantities.
Definition: array_gradient2.h:36
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
vec2i clamp(const vec2i &pi) const
Get the new constrained position within the index space of this shape.
Definition: shape.h:311
Two dimensional staggered grid class designed to be defined as instance member in recursive_configura...
Definition: macarray2.h:37