16 #ifndef GEOS_MESH_UTILITIES_STRUCTUREDGRIDUTILITIES_HPP
17 #define GEOS_MESH_UTILITIES_STRUCTUREDGRIDUTILITIES_HPP
23 namespace structuredGrid
36 template<>
inline int dimpower< 1 >(
int n ) {
return n; }
37 template<>
inline int dimpower< 2 >(
int n ) {
return n*n; }
38 template<>
inline int dimpower< 3 >(
int n ) {
return n*n*n; }
54 std::vector< int > & indices );
60 void map_index< 1 >(
const int index,
62 std::vector< int > & indices )
71 void map_index< 2 >(
const int index,
73 std::vector< int > & indices )
76 indices[0] = index % nnx;
77 indices[1] = index / nnx;
82 void map_index< 3 >(
const int index,
84 std::vector< int > & indices )
87 indices[0] = index % nnx;
88 indices[1] = (index / nnx) % nnx;
89 indices[2] = index / (nnx*nnx);
#define GEOS_DEBUG_VAR(...)
Mark a debug variable and silence compiler warnings.
#define GEOS_ASSERT_GT(lhs, rhs)
Assert that one value compares greater than the other in debug builds.
void map_index(const int index, const int nnx, std::vector< int > &indices)
Given a lexicographical index, map back to the original i,j,k indices of the point....
int dimpower(int n)
Given n, compute n^dim, where dim is the spatial dimension.