PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
SSB_Modifier.hh
Go to the documentation of this file.
1 // Copyright (C) 2010--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 #ifndef _SSB_MODIFIER_H_
20 #define _SSB_MODIFIER_H_
21 
22 #include "pism/util/array/Staggered.hh"
23 #include "pism/util/Component.hh"
24 #include "pism/util/EnthalpyConverter.hh"
25 
26 namespace pism {
27 
28 class Vars;
29 
30 namespace rheology {
31 class FlowLaw;
32 }
33 
34 namespace stressbalance {
35 
36 class Inputs;
37 
38 //! Shallow stress balance modifier (such as the non-sliding SIA).
39 class SSB_Modifier : public Component {
40 public:
41  SSB_Modifier(std::shared_ptr<const Grid> g);
42  virtual ~SSB_Modifier() = default;
43 
44  virtual void init();
45 
46  virtual void update(const array::Vector &sliding_velocity,
47  const Inputs &inputs,
48  bool full_update) = 0;
49 
50  //! \brief Get the diffusive (SIA) vertically-averaged flux on the staggered grid.
52 
53  //! \brief Get the max diffusivity (for the adaptive time-stepping).
54  double max_diffusivity() const;
55 
56  const array::Array3D& velocity_u() const;
57 
58  const array::Array3D& velocity_v() const;
59 
60  virtual std::string stdout_report() const;
61 
62  std::shared_ptr<const rheology::FlowLaw> flow_law() const;
63 
64 protected:
65  std::shared_ptr<rheology::FlowLaw> m_flow_law;
67  double m_D_max;
70 };
71 
72 
73 //! The trivial Shallow Stress Balance modifier.
75 public:
76  ConstantInColumn(std::shared_ptr<const Grid> g);
77  virtual ~ConstantInColumn() = default;
78 
79  virtual void init();
80 
81  virtual void update(const array::Vector &sliding_velocity,
82  const Inputs &inputs,
83  bool full_update);
84 };
85 
86 } // end of namespace stressbalance
87 } // end of namespace pism
88 
89 #endif /* _SSB_MODIFIER_H_ */
A class defining a common interface for most PISM sub-models.
Definition: Component.hh:118
std::shared_ptr< EnthalpyConverter > Ptr
A virtual class collecting methods common to ice and bedrock 3D fields.
Definition: Array3D.hh:33
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
Definition: Staggered.hh:35
ConstantInColumn(std::shared_ptr< const Grid > g)
Definition: SSB_Modifier.cc:88
virtual void update(const array::Vector &sliding_velocity, const Inputs &inputs, bool full_update)
Distribute the input velocity throughout the column.
The trivial Shallow Stress Balance modifier.
Definition: SSB_Modifier.hh:74
const array::Array3D & velocity_u() const
Definition: SSB_Modifier.cc:68
virtual void update(const array::Vector &sliding_velocity, const Inputs &inputs, bool full_update)=0
SSB_Modifier(std::shared_ptr< const Grid > g)
Definition: SSB_Modifier.cc:31
const array::Staggered & diffusive_flux()
Get the diffusive (SIA) vertically-averaged flux on the staggered grid.
Definition: SSB_Modifier.cc:59
std::shared_ptr< const rheology::FlowLaw > flow_law() const
Definition: SSB_Modifier.cc:80
const array::Array3D & velocity_v() const
Definition: SSB_Modifier.cc:72
EnthalpyConverter::Ptr m_EC
Definition: SSB_Modifier.hh:66
double max_diffusivity() const
Get the max diffusivity (for the adaptive time-stepping).
Definition: SSB_Modifier.cc:64
virtual std::string stdout_report() const
Definition: SSB_Modifier.cc:76
std::shared_ptr< rheology::FlowLaw > m_flow_law
Definition: SSB_Modifier.hh:65
array::Staggered1 m_diffusive_flux
Definition: SSB_Modifier.hh:68
Shallow stress balance modifier (such as the non-sliding SIA).
Definition: SSB_Modifier.hh:39
static const double g
Definition: exactTestP.cc:36