- | otherwise = Grid grid_size values (cubes grid_size values)
-
-
--- | Returns a three-dimensional array of cubes centered on the grid
--- points (h*i, h*j, h*k) with the appropriate 'FunctionValues'.
-cubes :: Double -> Values3D -> CubeGrid
-cubes delta fvs
- = array (lbounds, ubounds)
- [ ((i,j,k), cube_ijk)
- | i <- [0..xmax],
- j <- [0..ymax],
- k <- [0..zmax],
- let tet_vol = (1/24)*(delta^(3::Int)),
- let cube_ijk =
- Cube delta i j k (make_values fvs i j k) tet_vol]
- where
- xmax = xsize - 1
- ymax = ysize - 1
- zmax = zsize - 1
- lbounds = (0, 0, 0)
- ubounds = (xmax, ymax, zmax)
- (xsize, ysize, zsize) = dims fvs