9 #ifndef VOXEL_H_INCLUDED
10 #define VOXEL_H_INCLUDED
16 #define TEST_VOXEL_SURF
17 #define TEST_VOXEL_VOLU
19 #define TEST_VOXEL_EDGE
20 #define TEST_VOXEL_VERT
61 template <
class T> T
cumsum(
const T &matIn,
int d)
66 for (
int i = 0; i < mat.rows(); ++i)
68 for (
int j = 1; j < mat.cols(); ++j)
70 mat(i, j) += mat(i, j - 1);
76 for (
int i = 1; i < mat.rows(); ++i)
78 for (
int j = 0; j < mat.cols(); ++j)
80 mat(i, j) += mat(i - 1, j);
99 template <
class T> T
cumprod(
const T &matIn,
int d)
104 for (
int i = 0; i < mat.rows(); ++i)
106 for (
int j = 1; j < mat.cols(); ++j)
108 mat(i, j) *= mat(i, j - 1);
114 for (
int i = 1; i < mat.rows(); ++i)
116 for (
int j = 0; j < mat.cols(); ++j)
118 mat(i, j) *= mat(i - 1, j);
126 int BuildBlockGrid(std::array<int, 3> &dimGrid,
mesh &blockGrid);
127 int BuildBlockGrid(
const Eigen::RowVector3i &dimGrid,
mesh &blockGrid);
128 int BuildBlockVert(
const Eigen::RowVector3i &dimGrid,
mesh &blockGrid,
int nVert,
const Eigen::Matrix3i &edgeProp,
129 const Eigen::RowVector3i &nEdgeDim);
131 int BuildBlockEdge(
const Eigen::RowVector3i &dimGrid,
mesh &blockGrid,
int nEdge,
const Eigen::RowVector3i &nEdgeDim,
132 const Eigen::RowVector3i &nSurfDim,
const Eigen::Matrix3i &edgeProp,
133 const Eigen::Matrix3i &surfProp);
135 int BuildBlockSurf(
const Eigen::RowVector3i &dimGrid,
int nSurf,
mesh &blockGrid,
const Eigen::Matrix3i &surfProp,
136 const Eigen::Matrix3i &edgeProp,
const Eigen::RowVector3i &nSurfDim,
137 const Eigen::RowVector3i &nEdgeDim);
139 int BuildBlockVolu(
const Eigen::RowVector3i &dimGrid,
int nVolu,
mesh &blockGrid,
const Eigen::RowVector3i &nSurfDim,
140 const Eigen::Matrix3i &surfProp);
142 int Test_BuildBlockGrid_noout();
145 int Test_MeshOut_Size(Eigen::RowVector3i dimGrid,
bool runReOrder =
false);
146 int Test_MeshReOrder();
Provide std::vector container with hashed index mapping.
Provide tecplot file formating for mesh and snake outputs.
T cumprod(const T &matIn, int d)
template which applies cumulative product to Eigen Matrix.
T cumsum(const T &matIn, int d)
template which applies cumulative sum to Eigen Matrix.