PISM, A Parallel Ice Sheet Model  stable v2.0.4 committed by Constantine Khrulev on 2022-05-25 12:02:27 -0800
IcebergRemover.hh
Go to the documentation of this file.
1 /* Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2020, 2021 PISM Authors
2  *
3  * This file is part of PISM.
4  *
5  * PISM is free software; you can redistribute it and/or modify it under the
6  * terms of the GNU General Public License as published by the Free Software
7  * Foundation; either version 3 of the License, or (at your option) any later
8  * version.
9  *
10  * PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with PISM; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 #ifndef _PISMICEBERGREMOVER_H_
21 #define _PISMICEBERGREMOVER_H_
22 
23 #include "pism/util/Component.hh"
24 #include "pism/util/iceModelVec.hh"
25 
26 namespace pism {
27 
28 class IceModelVec2CellType;
29 
30 namespace calving {
31 
32 /*! \brief PISM iceberg remover */
33 /*!
34  * Identifies and removes free-floating icebergs, which cause
35  * well-posedness problems for stress solvers.
36  *
37  * Icebergs are, in this context, floating regions that are _not_
38  * attached, through a chain of positive thickness ice-filled cells,
39  * to at least one grounded cell.
40  *
41  * They cause the SSA operator to have a nontrivial null space.
42  *
43  * They are observed to cause unrealistically large velocities that
44  * may affect ice velocities elsewhere.
45  *
46  * This class uses a serial connected component labeling algorithm to
47  * remove "icebergs".
48  */
49 class IcebergRemover : public Component
50 {
51 public:
53  virtual ~IcebergRemover() = default;
54 
55  void update(const IceModelVec2Int &bc_mask,
56  IceModelVec2CellType &pism_mask,
57  IceModelVec2S &ice_thickness);
58 protected:
59  virtual void update_impl(const IceModelVec2Int &bc_mask,
60  IceModelVec2CellType &pism_mask,
61  IceModelVec2S &ice_thickness);
62 
63 
65  std::shared_ptr<petsc::Vec> m_mask_p0;
66 };
67 
68 } // end of namespace calving
69 } // end of namespace pism
70 
71 #endif /* _PISMICEBERGREMOVER_H_ */
A class defining a common interface for most PISM sub-models.
Definition: Component.hh:101
std::shared_ptr< const IceGrid > ConstPtr
Definition: IceGrid.hh:233
"Cell type" mask. Adds convenience methods to IceModelVec2Int.
A simple class "hiding" the fact that the mask is stored as floating-point scalars (instead of intege...
Definition: iceModelVec.hh:389
std::shared_ptr< petsc::Vec > m_mask_p0
void update(const IceModelVec2Int &bc_mask, IceModelVec2CellType &pism_mask, IceModelVec2S &ice_thickness)
IcebergRemover(IceGrid::ConstPtr g)
virtual ~IcebergRemover()=default
virtual void update_impl(const IceModelVec2Int &bc_mask, IceModelVec2CellType &pism_mask, IceModelVec2S &ice_thickness)
PISM iceberg remover.
static const double g
Definition: exactTestP.cc:39