20 #ifndef PISM_STAGGERED_H
21 #define PISM_STAGGERED_H
23 #include "pism/util/array/Array3D.hh"
24 #include "pism/util/stencils.hh"
37 Staggered(std::shared_ptr<const Grid>
grid,
const std::string &name);
40 inline const double&
operator() (
int i,
int j,
int k)
const;
44 Staggered(std::shared_ptr<const Grid>
grid,
const std::string &name,
50 check_array_indices(i, j,
k);
52 return static_cast<double***
>(m_array)[j][i][
k];
57 check_array_indices(i, j,
k);
59 return static_cast<double***
>(m_array)[j][i][
k];
64 Staggered1(std::shared_ptr<const Grid>
grid,
const std::string &name);
79 result.
e =
self(i, j, 0);
80 result.
w =
self(i-1, j, 0);
81 result.
n =
self(i, j, 1);
82 result.
s =
self(i, j-1, 1);
101 bool include_floating_ice,
113 bool include_floating_ice,
std::shared_ptr< const Grid > grid() const
unsigned int stencil_width() const
Get the stencil width of the current Array. Returns 0 if ghosts are not available.
Abstract class for reading, writing, allocating, and accessing a DA-based PETSc Vec (2D and 3D fields...
Staggered1(std::shared_ptr< const Grid > grid, const std::string &name)
stencils::Star< double > star(int i, int j) const
Returns the values at interfaces of the cell i,j using the staggered grid.
double & operator()(int i, int j, int k)
void copy_from(const array::Staggered &input)
Staggered(std::shared_ptr< const Grid > grid, const std::string &name)
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
void staggered_to_regular(const array::CellType1 &cell_type, const array::Staggered1 &input, bool include_floating_ice, array::Scalar &result)
double absmax(const array::Scalar &input)
Finds maximum over all the absolute values in an array::Scalar object. Ignores ghosts.
Star stencil points (in the map-plane).