37 template <
typename T_GRID,
typename T_ARRAY>
40 m_nx(grid.numCells()[0]),
41 m_ny(grid.numCells()[1]),
42 m_nz(grid.numCells()[2]),
43 m_pad(grid.getPadding())
45 m_data.resize(m_grid.size());
47 for (
int i = 0; i < m_data.size(); ++i) {
48 m_data[i] = T_ARRAY();
52 template <
typename T_GRID,
typename T_ARRAY>
56 m_data.shrink_to_fit();
59 template <
typename T_GRID,
typename T_ARRAY>
65 template <
typename T_GRID,
typename T_ARRAY>
71 template <
typename T_GRID,
typename T_ARRAY>
77 template <
typename T_GRID,
typename T_ARRAY>
83 template <
typename T_GRID,
typename T_ARRAY>
89 template <
typename T_GRID,
typename T_ARRAY>
92 const std::size_t idx = m_grid.index(i, j, k);
96 template <
typename T_GRID,
typename T_ARRAY>
99 const std::size_t idx = m_grid.index(i, j, k);
103 template <
typename T_GRID,
typename T_ARRAY>
106 return m_data[m_grid.index(node_id)];
109 template <
typename T_GRID,
typename T_ARRAY>
112 return m_data[m_grid.index(node_id)];
115 template <
typename T_GRID,
typename T_ARRAY>
118 m_data = array.
data();
const std::size_t size() const
const Vec3< int > numCells() const
Array(const Grid< typename T_GRID::value_type, T_GRID::dim > &grid)
const T_ARRAY & operator()(const int i, const int j, const int k) const
void operator=(const Array< T_GRID, T_ARRAY > &array)
const T_GRID & grid() const
const std::vector< T_ARRAY > & data() const
const T_ARRAY & operator[](const std::size_t idx) const