20 #include "pism/util/node_types.hh"
22 #include "pism/util/array/Scalar.hh"
23 #include "pism/util/array/Scalar.hh"
24 #include "pism/util/Grid.hh"
25 #include "pism/util/error_handling.hh"
63 double thickness_threshold,
66 auto grid = ice_thickness.
grid();
68 const double &H_min = thickness_threshold;
74 for (
auto p = grid->points(); p; p.next()) {
75 const int i = p.i(), j = p.j();
77 auto H = ice_thickness.
box(i, j);
82 icy.c =
static_cast<int>(H.c >= H_min);
83 icy.nw =
static_cast<int>(H.nw >= H_min);
84 icy.n =
static_cast<int>(H.n >= H_min);
85 icy.ne =
static_cast<int>(H.ne >= H_min);
86 icy.e =
static_cast<int>(H.e >= H_min);
87 icy.se =
static_cast<int>(H.se >= H_min);
88 icy.s =
static_cast<int>(H.s >= H_min);
89 icy.sw =
static_cast<int>(H.sw >= H_min);
90 icy.w =
static_cast<int>(H.w >= H_min);
95 ne_element_is_icy = (
icy.c +
icy.e +
icy.ne +
icy.n) >= 3,
96 nw_element_is_icy = (
icy.c +
icy.n +
icy.nw +
icy.w) >= 3,
97 sw_element_is_icy = (
icy.c +
icy.w +
icy.sw +
icy.s) >= 3,
98 se_element_is_icy = (
icy.c +
icy.s +
icy.se +
icy.e) >= 3;
100 if (ne_element_is_icy and nw_element_is_icy and
101 sw_element_is_icy and se_element_is_icy) {
104 }
else if (
icy.c != 0) {
void failed()
Indicates a failure of a parallel section.
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
stencils::Box< T > box(int i, int j) const
std::shared_ptr< const Grid > grid() const
void update_ghosts()
Updates ghost points.
bool icy(int M)
Ice-filled cell (grounded or floating).
void compute_node_types(const array::Scalar1 &ice_thickness, double thickness_threshold, array::Scalar &result)