20 #ifndef PISM_ARRAY_SCALAR_H
21 #define PISM_ARRAY_SCALAR_H
25 #include "pism/util/array/Array2D.hh"
33 Scalar(std::shared_ptr<const Grid>
grid,
const std::string &name);
35 std::shared_ptr<Scalar>
duplicate()
const;
37 inline int as_int(
int i,
int j)
const;
42 Scalar(std::shared_ptr<const Grid>
grid,
const std::string &name,
int width);
46 const double &value = (*this)(i, j);
47 return static_cast<int>(floor(value + 0.5));
55 Scalar1(std::shared_ptr<const Grid>
grid,
const std::string &name);
61 Scalar1(std::shared_ptr<const Grid>
grid,
const std::string &name,
int width);
69 Scalar2(std::shared_ptr<const Grid>
grid,
const std::string &name);
91 return {
as_int(i, j),
as_int(i, N),
as_int(W, N),
as_int(W, j),
as_int(W,
S),
A storage vector combining related fields in a struct.
std::shared_ptr< const Grid > grid() const
Scalar1(std::shared_ptr< const Grid > grid, const std::string &name)
Scalar2(std::shared_ptr< const Grid > grid, const std::string &name)
Scalar(std::shared_ptr< const Grid > grid, const std::string &name)
int as_int(int i, int j) const
stencils::Box< int > box_int(int i, int j) const
stencils::Star< int > star_int(int i, int j) const
std::shared_ptr< Scalar > duplicate() const
void apply_mask(const array::Scalar &M, double fill, array::Scalar &result)
Masks out all the areas where by setting them to fill.
double diff_y(const array::Scalar &array, int i, int j)
Returns the y-derivative at i,j approximated using centered finite differences.
double max(const array::Scalar &input)
Finds maximum over all the values in an array::Scalar object. Ignores ghosts.
double diff_x(const array::Scalar &array, int i, int j)
Returns the x-derivative at i,j approximated using centered finite differences.
double sum(const array::Scalar &input)
Sums up all the values in an array::Scalar object. Ignores ghosts.
double diff_x_p(const array::Scalar &array, int i, int j)
Returns the x-derivative at i,j approximated using centered finite differences. Respects grid periodi...
double min(const array::Scalar &input)
Finds minimum over all the values in an array::Scalar object. Ignores ghosts.
double absmax(const array::Scalar &input)
Finds maximum over all the absolute values in an array::Scalar object. Ignores ghosts.
double diff_y_p(const array::Scalar &array, int i, int j)
Returns the y-derivative at i,j approximated using centered finite differences. Respects grid periodi...
Star stencil points (in the map-plane).
static double S(unsigned n)