20#include "pism/frontretreat/util/IcebergRemover.hh"
21#include "pism/util/connected_components/label_components.hh"
22#include "pism/util/Mask.hh"
23#include "pism/util/error_handling.hh"
24#include "pism/util/Grid.hh"
25#include "pism/util/array/CellType.hh"
26#include "pism/util/petscwrappers/Vec.hh"
32 :
Component(
g), m_iceberg_mask(m_grid,
"iceberg_mask") {
51 mask_grounded_ice = 1,
52 mask_floating_ice = 2;
61 for (
auto p =
m_grid->points(); p; p.next()) {
62 const int i = p.i(), j = p.j();
72 for (
auto p =
m_grid->points(); p; p.next()) {
73 const int i = p.i(), j = p.j();
75 if (bc_mask(i, j) > 0.5 and cell_type.
icy(i, j)) {
88 for (
auto p =
m_grid->points(); p; p.next()) {
89 const int i = p.i(), j = p.j();
92 ice_thickness(i,j) = 0.0;
const std::shared_ptr< const Grid > m_grid
grid used by this component
A class defining a common interface for most PISM sub-models.
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
void set(double c)
Result: v[j] <- c for all j.
void update_ghosts()
Updates ghost points.
bool floating_ice(int i, int j) const
bool grounded_ice(int i, int j) const
bool icy(int i, int j) const
array::Scalar1 m_iceberg_mask
virtual void update_impl(const array::Scalar &bc_mask, array::CellType1 &cell_type, array::Scalar &ice_thickness)
void update(const array::Scalar &bc_mask, array::CellType1 &cell_type, array::Scalar &ice_thickness)
IcebergRemover(std::shared_ptr< const Grid > g)
void label_isolated(array::Scalar1 &mask, int reachable)