PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
FrontRetreat.hh
Go to the documentation of this file.
1 /* Copyright (C) 2016, 2017, 2018, 2019, 2021, 2022 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 FRONTRETREAT_H
21 #define FRONTRETREAT_H
22 
23 #include "pism/util/Component.hh"
24 #include "pism/util/array/CellType.hh"
25 #include "pism/util/MaxTimestep.hh"
26 
27 namespace pism {
28 
29 class Geometry;
30 
31 //! An abstract class implementing calving front retreat resulting from application of a
32 //! spatially-variable horizontal retreat rate.
33 /*! The retreat rate may correspond to frontal melting or calving. Requires the
34  "part_grid" mechanism and a grid with dx == dy.
35  */
36 class FrontRetreat : public Component {
37 public:
38  FrontRetreat(std::shared_ptr<const Grid> g);
39  ~FrontRetreat() = default;
40 
41  void update_geometry(double dt,
42  const Geometry &geometry,
43  const array::Scalar1 &bc_mask,
44  const array::Scalar &retreat_rate,
45  array::Scalar &Href,
46  array::Scalar1 &ice_thickness);
47 
48  MaxTimestep max_timestep(const array::CellType1 &cell_type,
49  const array::Scalar &bc_mask,
50  const array::Scalar &retreat_rate) const;
51 private:
52 
53  void compute_modified_mask(const array::CellType1 &input,
54  array::CellType1 &output) const;
55 
56  // Ghosted cell type mask
57  //
58  // We make a copy here because frontal retreat code uses a modified mask if
59  // geometry.front_retreat.wrap_around is false.
61  // Temporary storage for distributing ice loss to "full" (as opposed to "partially
62  // filled") cells near the front
64 };
65 
66 } // end of namespace pism
67 
68 
69 #endif /* FRONTRETREAT_H */
A class defining a common interface for most PISM sub-models.
Definition: Component.hh:118
void update_geometry(double dt, const Geometry &geometry, const array::Scalar1 &bc_mask, const array::Scalar &retreat_rate, array::Scalar &Href, array::Scalar1 &ice_thickness)
array::CellType1 m_cell_type
Definition: FrontRetreat.hh:60
MaxTimestep max_timestep(const array::CellType1 &cell_type, const array::Scalar &bc_mask, const array::Scalar &retreat_rate) const
Definition: FrontRetreat.cc:71
~FrontRetreat()=default
array::Scalar1 m_tmp
Definition: FrontRetreat.hh:63
FrontRetreat(std::shared_ptr< const Grid > g)
Definition: FrontRetreat.cc:30
void compute_modified_mask(const array::CellType1 &input, array::CellType1 &output) const
Definition: FrontRetreat.cc:43
Combines the max. time step with the flag indicating if a restriction is active. Makes is possible to...
Definition: MaxTimestep.hh:31
static const double g
Definition: exactTestP.cc:36