PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900
EmptyingProblem.hh
Go to the documentation of this file.
1 /* Copyright (C) 2019, 2020, 2021, 2022, 2023 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 EMPTYINGPROBLEM_H
21 #define EMPTYINGPROBLEM_H
22 
23 #include "pism/util/Component.hh"
24 #include "pism/util/array/Scalar.hh"
25 #include "pism/util/array/Staggered.hh"
26 #include "pism/util/array/Vector.hh"
27 
28 namespace pism {
29 
30 class Geometry;
31 
32 namespace hydrology {
33 
34 class EmptyingProblem : public Component {
35 public:
36  EmptyingProblem(std::shared_ptr<const Grid> g);
37  virtual ~EmptyingProblem() = default;
38 
39  void update(const Geometry &geometry, const array::Scalar *no_model_mask,
40  const array::Scalar &water_input_rate, bool recompute_potential = true);
41 
42  // output
43  const array::Vector &flux() const;
44 
45  // diagnostics
48  const array::Scalar &potential() const;
49  const array::Scalar &adjustment() const;
50  const array::Scalar &sinks() const;
51 
53 
54 protected:
55 
56  virtual void compute_raw_potential(const array::Scalar &ice_thickness,
58  array::Scalar &result) const;
59 
60  void compute_potential(const array::Scalar &ice_thickness,
62  const array::Scalar &domain_mask,
63  array::Scalar1 &result);
64 
66  const array::Scalar1 &mask,
67  array::Staggered &result) const;
68 
69  void compute_mask(const array::CellType &cell_type,
70  const array::Scalar *no_model_mask,
71  array::Scalar &result) const;
72 
80 
85 
86  double m_dx;
87  double m_dy;
88 
90  double m_speed;
91  double m_tau;
92 };
93 
94 } // end of namespace hydrology
95 } // end of namespace pism
96 
97 #endif /* EMPTYINGPROBLEM_H */
A class defining a common interface for most PISM sub-models.
Definition: Component.hh:118
"Cell type" mask. Adds convenience methods to array::Scalar.
Definition: CellType.hh:30
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
Definition: Staggered.hh:35
virtual ~EmptyingProblem()=default
void compute_velocity(const array::Scalar &hydraulic_potential, const array::Scalar1 &mask, array::Staggered &result) const
const array::Scalar & sinks() const
const array::Vector & flux() const
const array::Scalar & adjustment() const
void compute_mask(const array::CellType &cell_type, const array::Scalar *no_model_mask, array::Scalar &result) const
DiagnosticList diagnostics() const
const array::Scalar & potential() const
void compute_potential(const array::Scalar &ice_thickness, const array::Scalar &ice_bottom_surface, const array::Scalar &domain_mask, array::Scalar1 &result)
EmptyingProblem(std::shared_ptr< const Grid > g)
const array::Scalar & remaining_water_thickness() const
virtual void compute_raw_potential(const array::Scalar &ice_thickness, const array::Scalar &ice_bottom_surface, array::Scalar &result) const
void update(const Geometry &geometry, const array::Scalar *no_model_mask, const array::Scalar &water_input_rate, bool recompute_potential=true)
const array::Vector & effective_water_velocity() const
void hydraulic_potential(const array::Scalar &W, const array::Scalar &P, const array::Scalar &sea_level, const array::Scalar &bed, const array::Scalar &ice_thickness, array::Scalar &result)
Compute the hydraulic potential.
Definition: Routing.cc:186
static const double g
Definition: exactTestP.cc:36
std::map< std::string, Diagnostic::Ptr > DiagnosticList
Definition: Diagnostic.hh:125
void ice_bottom_surface(const Geometry &geometry, array::Scalar &result)
Definition: Geometry.cc:217