20#ifndef PISM_STAGGERED_H
21#define PISM_STAGGERED_H
25#include "pism/util/array/Array3D.hh"
26#include "pism/util/stencils.hh"
39 Staggered(std::shared_ptr<const Grid>
grid,
const std::string &name);
42 inline const double&
operator() (
int i,
int j,
int k)
const;
46 Staggered(std::shared_ptr<const Grid>
grid,
const std::string &name,
52 check_array_indices(i, j,
k);
54 return static_cast<double***
>(m_array)[j][i][
k];
59 check_array_indices(i, j,
k);
61 return static_cast<double***
>(m_array)[j][i][
k];
66 Staggered1(std::shared_ptr<const Grid>
grid,
const std::string &name);
81 result.
e = self(i, j, 0);
82 result.
w = self(i-1, j, 0);
83 result.
n = self(i, j, 1);
84 result.
s = self(i, j-1, 1);
103 bool include_floating_ice,
115 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...
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)
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).