PISM, A Parallel Ice Sheet Model  stable v2.0.6 committed by Constantine Khrulev on 2023-01-23 15:14:38 -0900
SSB_Modifier.hh
Go to the documentation of this file.
1 // Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020, 2021 Constantine Khroulev and Ed Bueler
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/iceModelVec.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:
42  virtual ~SSB_Modifier() = default;
43 
44  virtual void init();
45 
46  virtual void update(const IceModelVec2V &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 IceModelVec3& velocity_u() const;
57 
58  const IceModelVec3& 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:
77  virtual ~ConstantInColumn() = default;
78 
79  virtual void init();
80 
81  virtual void update(const IceModelVec2V &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:101
std::shared_ptr< EnthalpyConverter > Ptr
std::shared_ptr< const IceGrid > ConstPtr
Definition: IceGrid.hh:233
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
Definition: iceModelVec.hh:449
A virtual class collecting methods common to ice and bedrock 3D fields.
Definition: iceModelVec.hh:404
virtual void update(const IceModelVec2V &sliding_velocity, const Inputs &inputs, bool full_update)
Distribute the input velocity throughout the column.
ConstantInColumn(IceGrid::ConstPtr g)
Definition: SSB_Modifier.cc:84
The trivial Shallow Stress Balance modifier.
Definition: SSB_Modifier.hh:74
const IceModelVec3 & velocity_v() const
Definition: SSB_Modifier.cc:68
SSB_Modifier(IceGrid::ConstPtr g)
Definition: SSB_Modifier.cc:32
std::shared_ptr< const rheology::FlowLaw > flow_law() const
Definition: SSB_Modifier.cc:76
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:60
virtual std::string stdout_report() const
Definition: SSB_Modifier.cc:72
const IceModelVec2Stag & diffusive_flux()
Get the diffusive (SIA) vertically-averaged flux on the staggered grid.
Definition: SSB_Modifier.cc:55
std::shared_ptr< rheology::FlowLaw > m_flow_law
Definition: SSB_Modifier.hh:65
virtual void update(const IceModelVec2V &sliding_velocity, const Inputs &inputs, bool full_update)=0
const IceModelVec3 & velocity_u() const
Definition: SSB_Modifier.cc:64
Shallow stress balance modifier (such as the non-sliding SIA).
Definition: SSB_Modifier.hh:39
static const double g
Definition: exactTestP.cc:39