20 #include "pism/util/label_components.hh"
22 #include "pism/util/array/Scalar.hh"
23 #include "pism/util/error_handling.hh"
24 #include "pism/util/connected_components.hh"
25 #include "pism/util/petscwrappers/Vec.hh"
31 bool identify_icebergs,
double mask_grounded) {
35 auto grid = mask.
grid();
39 if (grid->rank() == 0) {
42 static_cast<int>(grid->My()),
43 static_cast<int>(grid->Mx()),
45 static_cast<int>(mask_grounded));
void failed()
Indicates a failure of a parallel section.
void get_from_proc0(petsc::Vec &onp0)
Gets a local Array2 from processor 0.
std::shared_ptr< const Grid > grid() const
std::shared_ptr< petsc::Vec > allocate_proc0_copy() const
void put_on_proc0(petsc::Vec &onp0) const
Puts a local array::Scalar on processor 0.
Wrapper around VecGetArray and VecRestoreArray.
void label_connected_components(double *image, int nrows, int ncols, bool identify_icebergs, int mask_grounded, int first_label)
void label_components(array::Scalar &mask, petsc::Vec &mask_p0, bool identify_icebergs, double mask_grounded)